Notice:
We're still getting this site set up. Feel free to help out if you feel you can. Thank you for your patience.

Header

From Tp Wiki

(Difference between revisions)
m (Reverted edit of No. 1 Chelsea Fan, changed back to last version by Seba Nile)
Line 1: Line 1:
-
<style type="text/css">
+
<?php
-
  /*
+
-
      Notes:
+
-
      -You must log as admin to edit this page
+
-
      -Whatever you enter in this page will be added to the html in the header after the standard style sheet, so you can override styles.
+
-
      -if you want your code to look nice on this page, put a space at the beginning of each line
+
-
      -This is the default style sheet that you can override : http://editthis.info/wiki/skins/monobook/main.css
+
-
     
+
-
      For example uncomment this next section to turn all the text green:
+
-
  */
+
-
  /*
+
-
body {
+
-
    color: green;
+
-
}
+
-
  */
+
-
</style>
+
-
<script type="text/javascript">
+
if(!defined('MEDIAWIKI')) {
-
   //Feel free to add your javascript code here.
+
  header("HTTP/1.1 404 Not Found");
-
  </script>
+
  die('<H1>404 Not found</H1>');
 +
   }
 +
 
 +
/**
 +
* A hook that adds a theories tab to Lostpedia
 +
*
 +
* @package MediaWiki
 +
* @subpackage Extensions
 +
*
 +
* @author Jabberwock @ Lostpedia
 +
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 +
*/
 +
$wgExtensionFunctions[] = 'wfTheoryTab';
 +
$wgExtensionCredits['other'][] = array(
 +
    'name' => 'Theory Tab',
 +
    'description' => 'Adds a theories tab to articles',
 +
    'author' => '[http://lostpedia.com/wiki/User:jabrwocky7 Jabberwock]'
 +
);
 +
 
 +
# Enable subpages in the main namespace
 +
$wgNamespacesWithSubpages[NS_MAIN] = true;
 +
 
 +
//install extension hooks
 +
$wgHooks['SkinTemplateTabs'][] = 'TheoryTabHook';
 +
 
 +
 
 +
// Intialize
 +
function wfTheoryTab() {
 +
  global $wgMessageCache, $wgParser, $wgUser, $wgVersion;
 +
 
 +
// add a tab on the article page
 +
function TheoryTabHook(&$skin , &$content_actions ) {
 +
  global $wgTitle, $tMain, $tTheory, $tHREF, $tTheoryTabName, $tParentTabName, $tAction;
 +
 
 +
  $tMain = $wgTitle->getLocalUrl('');
 +
  $tTheory = "/Theories";
 +
  $tHREF = $tMain.$tTheory;
 +
  $tTheoryTabName = 'Theories';
 +
  $tParentTabName = 'Main Article';
 +
  $tAction = '?action=edit';
 +
 
 +
//create the theory tab for regular articles in NS_MAIN namespace
 +
if ( $wgTitle->getNamespace() == NS_MAIN
 +
    && $wgTitle->isTalkPage() !== 1
 +
    && strstr($wgTitle->getLocalUrl(''),"Main_Page") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),"Portal:") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),"Category:") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),"Template:") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),$tTheoryTabName) == FALSE ) {
 +
 
 +
  $content_actions['TheoryTab'] = array(
 +
    'text' => $tTheoryTabName,
 +
    'href'  => $tHREF
 +
    );
 +
  }
 +
 
 +
 
 +
//If already on the theory page, make a tab for the parent article.
 +
if ( strstr($wgTitle->getLocalUrl(''),$tTheoryTabName) == TRUE
 +
    && $wgTitle->isTalkPage() !== 1
 +
    && strstr($wgTitle->getLocalUrl(''),"Main_Page") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),"Portal:") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),"Category:") == FALSE
 +
    && strstr($wgTitle->getLocalUrl(''),"Template:") == FALSE  ) {
 +
 
 +
  $tMain = substr_replace ($tMain, '', -(strlen($tTheory)));
 +
  $content_actions['TheoryTab'] = array(
 +
    'text'  => $tParentTabName,
 +
    'href'  => $tMain
 +
    );
 +
  }
 +
 
 +
}//endfunction wfTheoryTabHook
 +
 
 +
 
 +
}//endfunction wfTheoryTab
 +
 
 +
 
 +
?>

Revision as of 14:33, 19 December 2006

<?php

if(!defined('MEDIAWIKI')) {

  header("HTTP/1.1 404 Not Found");
die('

404 Not found

');
  }

/**

* A hook that adds a theories tab to Lostpedia
*
* @package MediaWiki
* @subpackage Extensions
*
* @author Jabberwock @ Lostpedia
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/

$wgExtensionFunctions[] = 'wfTheoryTab'; $wgExtensionCredits['other'][] = array(

   'name' => 'Theory Tab',
   'description' => 'Adds a theories tab to articles',
   'author' => 'Jabberwock'

);

  1. Enable subpages in the main namespace

$wgNamespacesWithSubpages[NS_MAIN] = true;

//install extension hooks $wgHooks['SkinTemplateTabs'][] = 'TheoryTabHook';


// Intialize function wfTheoryTab() {

 global $wgMessageCache, $wgParser, $wgUser, $wgVersion;

// add a tab on the article page function TheoryTabHook(&$skin , &$content_actions ) {

 global $wgTitle, $tMain, $tTheory, $tHREF, $tTheoryTabName, $tParentTabName, $tAction;
 $tMain = $wgTitle->getLocalUrl();
 $tTheory = "/Theories";
 $tHREF = $tMain.$tTheory;
 $tTheoryTabName = 'Theories';
 $tParentTabName = 'Main Article';
 $tAction = '?action=edit';
 

//create the theory tab for regular articles in NS_MAIN namespace if ( $wgTitle->getNamespace() == NS_MAIN

    && $wgTitle->isTalkPage() !== 1 
    && strstr($wgTitle->getLocalUrl(),"Main_Page") == FALSE 
    && strstr($wgTitle->getLocalUrl(),"Portal:") == FALSE 
    && strstr($wgTitle->getLocalUrl(),"Category:") == FALSE 
    && strstr($wgTitle->getLocalUrl(),"Template:") == FALSE 
    && strstr($wgTitle->getLocalUrl(),$tTheoryTabName) == FALSE ) {
 
 $content_actions['TheoryTab'] = array(
   'text'  => $tTheoryTabName,
   'href'  => $tHREF
   );
 }


//If already on the theory page, make a tab for the parent article. if ( strstr($wgTitle->getLocalUrl(),$tTheoryTabName) == TRUE

    && $wgTitle->isTalkPage() !== 1 
    && strstr($wgTitle->getLocalUrl(),"Main_Page") == FALSE 
    && strstr($wgTitle->getLocalUrl(),"Portal:") == FALSE 
    && strstr($wgTitle->getLocalUrl(),"Category:") == FALSE 
    && strstr($wgTitle->getLocalUrl(),"Template:") == FALSE  ) {
 
 $tMain = substr_replace ($tMain, , -(strlen($tTheory)));
 $content_actions['TheoryTab'] = array(
   'text'  => $tParentTabName,
   'href'  => $tMain
   );
 }

}//endfunction wfTheoryTabHook


}//endfunction wfTheoryTab


?>

Personal tools