A TrialSkin. php file - This is where you will put most of the code and define the layout of pages. A TrialSkin. deps. php file - This is a standard file that most likely will contain the same code. It is created to fix a bug with PHP. The trialskin directory - All other files related to your skin should go in this directory, including style-sheets and images. A /skins/trialskin/main. css file which will contain the main stylesheet for the skin - [Optional, but most likely to be needed] Browser specific stylesheet fixes files, such as /skins/trialskin/IE60Fixes. css - [Optional, but preferred]

skinname = 'trialskin'; $this->stylename = 'trialskin'; $this->template = 'TrialSkinTemplate'; } } class TrialSkinTemplate extends QuickTemplate { //Other code sections will be appended to this class body /* hijack category functions to create a proper list */ function getCategories() { $catlinks=$this->getCategoryLinks(); if(!empty($catlinks)) { return ""; } } function getCategoryLinks() { global $wgOut, $wgUser, $wgTitle, $wgUseCategoryBrowser; global $wgContLang; if(count($wgOut->mCategoryLinks) == 0) return ''; $skin = $wgUser->getSkin(); # separator $sep = ""; // use Unicode bidi embedding override characters, // to make sure links don't smash each other up in ugly ways $dir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; $embed = "
  • "; $pop = '
  • '; $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop; $msg = wfMsgExt('pagecategories', array('parsemag', 'escape'), count($wgOut->mCategoryLinks)); $s = $skin->makeLinkObj(Title::newFromText(wfMsgForContent('pagecategorieslink')), $msg) . $t; # optional 'dmoz-like' category browser - will be shown under the list # of categories an article belongs to if($wgUseCategoryBrowser) { $s . = '

    '; # get a big array of the parents tree $parenttree = $wgTitle->getParentCategoryTree(); # Skin object passed by reference because it can not be # accessed under the method subfunction drawCategoryBrowser $tempout = explode("\n", Skin::drawCategoryBrowser($parenttree, $this)); # clean out bogus first entry and sort them unset($tempout[0]); asort($tempout); # output one per line $s . = implode("
    \n", $tempout); } return $s; } The XHTML code which opens (and eventually closes) the HTML output that will be sent to the client's browser. The head element, which imports style-sheets, scripts, defines the page's meta data, and specifies the title to be displayed in the browser's title bar for the specific page being viewed. The body opening tag. This tag opens the body element of the page and specifies what happens when the page loads or is double clicked if such handlers exist. The site's name block. The site's logo image. The site's tag-line Site Notice block. User message notification block (if there is a need for it) The user's toolbar. Intrapage navigation block. Search. Toolbox. Language links. Page name. Page subtitle. Undelete notice. Page contents. Category links. Page toolbar. Footer. Closing trail. function execute() { // declaring global variables and getting the skin object in case you need to use them later global $wgUser, $wgSitename; $skin = $wgUser->getSkin(); // retrieve site name $this->set('sitename', $wgSitename); // suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); ?>0 Transitional//EN" “http://www. w3. org/TR/xhtml1/DTD/xhtml1-transitional. dtd”> <html xmlns="text('xhtmldefaultnamespace') ?>" data['xhtmlnamespaces'] as $tag => $ns) { ?>xmlns:xml:lang="text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> The head element - here, you output the head element along with all its contents. This includes style-sheets links, client-side scripts and meta data for robots and browsers. The code included here is a standard code that you might need to modify to include any custom scripts or style-sheets to be included. For this code to work as expected you’ll need to have the following files (you may remove the lines importing any of these style-sheets if you don’t need them): /common/commonPrint. css - style-sheet for printing pages. You might change the path to this style-sheet if you don’t want to use the standard print style-sheet. main. css, contents. css - main style-sheets for your skin. These must be in your skin’s directory (/skins/trialskin in this example) handheld. css - a style-sheet to be used with hand-held devices. IE50Fixes. css, IE55Fixes. css, IE60Fixes. css, IE70Fixes. css - fixes for different browsers. You may copy these files from one of the already-existing skins, most likely you’ll need to change nothing on these files. The last lines, starting at “/*** various MediaWiki-related scripts and styles */ " include user specific, page specific and site-wide specific style-sheets. If you don’t support these features, just remove them all up to the comment. It has been noticed that the $this->html(‘headscripts’) call sometimes causes trouble, so if anything goes wrong try to remove it. In case the code does not work for some reason, you might forget about this code altogether and write your own, including the style-sheet links, scripts, and title tag all written by your own code!html('headlinks') ?><?php $this->text('pagetitle') ?><link rel=“stylesheet” type=“text/css” data['printable']) ) { ?>media=“print” href="text('stylepath') ?>/common/commonPrint. css?” /> data); ?> data['jsvarurl']) { ?> data['pagecss']) { ?>data['usercss']) { ?>data['userjs']) { ?> data['userjsprev']) { ?> data['trackbackhtml']) print $this->data['trackbackhtml']; ?> html('headscripts') ?>The body opening tag - renders the opening body tag. Most likely, you won’t need to modify this unless you want to hard code the body styles into the tag.

    data['body_ondblclick']) { ?>ondblclick="text('body_ondblclick') ?>" data['body_onload']) { ?>onload="text('body_onload') ?>" class="mediawiki text('nsclass') ?> text('dir') ?> text('pageclass') ?>"> Closing trail - this is appended at the end of the file.

    It closes any opened tags, scripts, php code . . . etc. All following code should be put before this, it should be the last lines of the skin file.

    html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?> html('reporttime') ?> data['debug'] ): ?>

    Site’s name: text('sitename') ?> Site’s logo image:

    Site’s tag-line:

    msg('tagline') ?>

    The site-notice block - site notice content is usually edited and added to the WikiMedia:Sitenotice message page.

    data['sitenotice']) { ?>
    html('sitenotice') ?>
    User message notification block: data['newtalk']) { ?>
    html('newtalk') ?>
    Intrapage navigation block - this is optional. data['showjumplinks']) { ?>

    Page name:

    data['displaytitle']!=""?$this->html('title'):$this->text('title') ?>

    Page subtitle:
    html('subtitle') ?>
    Page contents: html('bodytext') ?> Category links: data['catlinks']) { ?>Footer - this code is iterative so take care while copying it!

    This renders the user’s navigation links such as the user’s page, talk page, logout link . . . etc.

    msg('personaltools') ?>
      data['personal_urls'] as $key => $item) { ?> <li id=“pt-" class=“active”><a href=""tooltipAndAccesskey('pt-'. $key) ?> class="">
    Page toolbar - which includes the edit, create, discuss links along with others depending on the user’s group.
    msg('views') ?>
      data['content_actions'] as $key => $tab) { ?> <li id=“ca-" class=""><a href=""tooltipAndAccesskey('ca-'. $key) ?>>
    Undelete notice - if the page was deleted before and the user can undelete pages, this link should appear (if you choose to).

    data['undelete']) { ?>
    html('undelete') ?>

    Search portlet - the search box. This is a minimal implementation that only shows what needs to be outputted for the search box to work.

    Toolbox portlet:
    msg('toolbox') ?>
      data['notspecialpage']) { ?>
    • <a href="data['nav_urls']['whatlinkshere']['href']) ?>"tooltipAndAccesskey('t-whatlinkshere') ?>>msg('whatlinkshere') ?>
    • data['nav_urls']['recentchangeslinked'] ) { ?>
    • <a href="data['nav_urls']['recentchangeslinked']['href']) ?>"tooltipAndAccesskey('t-recentchangeslinked') ?>>msg('recentchangeslinked') ?>
    • data['nav_urls']['trackbacklink'])) { ?>data['feeds']) { ?>data['nav_urls'][$special]) { ?>
    • <a href="data['nav_urls'][$special]['href']) ?>"tooltipAndAccesskey('t-'. $special) ?>>msg($special) ?>
    • data['nav_urls']['print']['href'])) { ?>
    • <a href="data['nav_urls']['print']['href']) ?>"tooltipAndAccesskey('t-print') ?>>msg('printableversion') ?>
    • data['nav_urls']['permalink']['href'])) { ?>data['nav_urls']['permalink']['href'] === '') { ?> <li id=“t-ispermalink”tooltip('t-ispermalink') ?>>msg('permalink') ?>
    Language links: data['language_urls'] ) { ?>
    msg('otherlanguages') ?>
      data['language_urls'] as $langlink) { ?>