Low level customization

From InnovationCell

Jump to:navigation, search

We try to avoid customization of base code, but in some cases it is necessary (unless we missed a hook).

Support Google site code

mediawiki/includes/OutputPage.php, after protected function addDefaultMeta() {

// DHM 20100411 adding google site validation
 global $googSiteVal; // <meta name="google-site-verification" content="G99c-te9nUPfxDwNV68PuXOVtdTis_6AP6FjsE9paVA" />
 if ($googSiteVal) {
   $this->addMeta('google-site-verification', $googSiteVal);
 }

near the start of mediawiki/skins/Vector.php:

 global $googSiteVal;
 $googSiteVal = "G99c-te9nUPfxDwNV68PuXOVtdTis_6AP6FjsE9paVA";

Support custom HTML pages (Splash)

after global $wgRequest, $wgOut, $wgContLang; in public function execute() {

 $title = $wgRequest->getVal('title');
 if ($title == "Main_Page") {
   include("fp.php");
   exit;
 }

mediawiki/skins/fp.php:

 <?php

   function getPageText($title) {
     $id = Title::newFromText($title)->getArticleId(); //Get the id for the article called Test_page
     $myArticle = Article::newFromId($id); //Make an article object from that id
     return $myArticle->getRawText();
 }

 echo getPageText("MediaWiki:Splash");
Navigation
Toolbox