Do you have an idea for a new wiki? Please share it with us here
Take the Dharma Wants You test, all about Lostpedia, here

User talk:Jabrwocky7/theorytab.php

From Lostpedia

Jump to: navigation, search

Bug Reports

Red theory tabs

Hi Jabberwock, I was looking into a way to make the Theories tab show up 'red' if the page has not been created yet. I think this or something similar should work:

//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 ) {

  $tTheoryObj = Title::newFromText($wgTitle->getText().${tTheory});
  if ($tTheoryObj->exists()) {
      $content_actions['TheoryTab'] = array(
        'text'  => $tTheoryTabName,
        'href'  => $tHREF
        );
    }
  else {
      $content_actions['TheoryTab'] = array(
        'class' => "new",
        'text'  => $tTheoryTabName,
        'href'  => $tHREF
        );
    }
  }

I gave this a shot on a local machine, and it seemed to do what I expected. Best of luck, --Dagg 20:13, 28 November 2006 (PST)