Difference between revisions of "MediaWiki/archive/embedding/1.14/index.php"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(New page: ==Code== <php><?php →‎HISTORY: 2009-06-06 Now works with MediaWiki 1.14 and current version of extract.php: define('kfpWebAccts','/var/www/'); define('kfpMediaWiki',kfpWebAccts.'wiki-...)
 
m (Woozle moved page MediaWiki/embedding/1.14/index.php to MediaWiki/archive/embedding/1.14/index.php without leaving a redirect: obsolete, keeps changing)
 
(7 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
HISTORY:
 
HISTORY:
 
   2009-06-06 Now works with MediaWiki 1.14 and current version of extract.php
 
   2009-06-06 Now works with MediaWiki 1.14 and current version of extract.php
 +
  2009-06-07 Added code to view error and warning messages; fixed 2 warnings which popped up
 
*/
 
*/
 
define('kfpWebAccts','/var/www/');
 
define('kfpWebAccts','/var/www/');
Line 15: Line 16:
 
It all depends on how you are using the embedded pages.
 
It all depends on how you are using the embedded pages.
 
*/
 
*/
 +
// This code helps with debugging, but it is optional.
 +
error_reporting(E_ALL | E_STRICT);
 +
ini_set('display_errors', 1);
  
set_include_path(get_include_path() . PATH_SEPARATOR . kPathToMediaWiki);
+
//set_include_path(get_include_path() . PATH_SEPARATOR . kPathToMediaWiki);
$pgtitle = $_REQUEST['wikipage'];
+
if (isset($_REQUEST['wikipage'])) {
if ($pgtitle == '') {
+
    $pgtitle = $_REQUEST['wikipage'];
$pgtitle = 'Main Page'; // default page to show
+
} else {
 +
    $pgtitle = 'Main Page'; // default page to show
 
}
 
}
  

Latest revision as of 00:08, 15 December 2017

Code

<php><?php /* HISTORY:

 2009-06-06 Now works with MediaWiki 1.14 and current version of extract.php
 2009-06-07 Added code to view error and warning messages; fixed 2 warnings which popped up
  • /

define('kfpWebAccts','/var/www/'); define('kfpMediaWiki',kfpWebAccts.'wiki-hypertwins-org/');

// To have all your extractable pages as subpages or in a namespace, give them a prefix: define('kEmbeddedPagePrefix',); /* This can be empty, but the idea is that you might want to avoid conflicts between the names of your embedded pages and the names of regular pages in your wiki (if you're using the wiki as a regular wiki too). It all depends on how you are using the embedded pages.

  • /

// This code helps with debugging, but it is optional. error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 1);

//set_include_path(get_include_path() . PATH_SEPARATOR . kPathToMediaWiki); if (isset($_REQUEST['wikipage'])) {

   $pgtitle = $_REQUEST['wikipage'];

} else {

   $pgtitle = 'Main Page';	// default page to show

}

?> loadContent(); echo $wgArticle->mContent; /* End of meta tag code CSS code below is just for standalone presentation. */ ?> </php>