I have been hacking mediawiki for the last couple of months but have some questions I havent been able to locate answers to, any help appreciated:
1. I need access to both the article File_Name (not path info, but I can regexp it if necessary) and the edit link for the current article from my skin's execute() function (I know its somewhere in content_links but I am not a PHP expert and not sure how to dig it out).
Is there a reference somewhere for variables available to the skin?
2. How do you remove 'Retrieved from: blah' from bottom of page in the skin? For some reason it is embedded in the body text and is not a seperate var.
Thanks
Seth Brundle wrote the following on Wednesday, November 07, 2007 9:09 AM:
- I need access to both the article File_Name (not path info, but I
can >regexp it if necessary) and the edit link for the current
article from my skin's execute() function (I know its somewhere in content_links but I am not a PHP expert and not sure how to dig it
out).
Is there a reference somewhere for variables available to the skin?
I think you can get the title from $this->data['skin']->mTitle;
I found this function in includes/Skin.php It seems to imply you can use all those variables in a skin. /** * Make a <script> tag containing global variables * @param array $data Associative array containing one element: * skinname => the skin name * The odd calling convention is for backwards compatibility */ static function makeGlobalVariablesScript( $data ) { global $wgStylePath, $wgUser; global $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang, $wgLang; global $wgTitle, $wgCanonicalNamespaceNames, $wgOut, $wgArticle; global $wgBreakFrames;
$ns = $wgTitle->getNamespace(); $nsname = isset( $wgCanonicalNamespaceNames[ $ns ] ) ? $wgCanonicalNamespaceNames[ $ns ] : $wgTitle->getNsText(); $vars = array( 'skin' => $data['skinname'], 'stylepath' => $wgStylePath, 'wgArticlePath' => $wgArticlePath, 'wgScriptPath' => $wgScriptPath, 'wgServer' => $wgServer, 'wgCanonicalNamespace' => $nsname, 'wgCanonicalSpecialPageName' => SpecialPage::resolveAlias( $wgTitle->getDBKey() ), 'wgNamespaceNumber' => $wgTitle->getNamespace(), 'wgPageName' => $wgTitle->getPrefixedDBKey(), 'wgTitle' => $wgTitle->getText(), 'wgArticleId' => $wgTitle->getArticleId(), 'wgIsArticle' => $wgOut->isArticle(), 'wgUserName' => $wgUser->isAnon() ? NULL : $wgUser->getName(), 'wgUserLanguage' => $wgLang->getCode(), 'wgContentLanguage' => $wgContLang->getCode(), 'wgBreakFrames' => $wgBreakFrames, 'wgCurRevisionId' => isset( $wgArticle ) ? $wgArticle->getLatest() : 0, );
return self::makeVariablesScript( $vars ); }
- How do you remove 'Retrieved from: blah' from bottom of page in the
skin? For some reason it is embedded in the body text and is not a seperate
var.
Add .printfooter { display:none } to your CSS to get rid of the Retrieved from stuff.
Good luck! -Courtney
mediawiki-l@lists.wikimedia.org