modified skin for PsyCrit

computing: software: MediaWiki: customization: outward-looking: modified skin

Overview
To create the custom skins for PsyCrit, I copied the "monobook" folder and "MonoBook.php" to "psycrit" and "PsyCrit.php" respectively. Then I edited PsyCrit.php, with the final results as follows.

Contents
<?php /** * MonoBook nouveau * * Translated from gwicke's previous TAL template version to remove * dependency on PHPTAL. * * @todo document * @package MediaWiki * @subpackage Skins */

if( !defined( 'MEDIAWIKI' ) ) die( -1 );

/** */ require_once('includes/SkinTemplate.php');

/** * Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document * @package MediaWiki * @subpackage Skins */ class SkinPsyCrit extends SkinTemplate { /** Using monobook. */	function initPage( &$out ) { SkinTemplate::initPage( $out ); $this->skinname = 'psycrit'; $this->stylename = 'psycrit'; $this->template = 'PsyCritTemplate'; } }

/** * @todo document * @package MediaWiki * @subpackage Skins */ class PsyCritTemplate extends QuickTemplate { /**	 * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based * class, and a wrapper for MediaWiki's localization database, and * outputs a formatted page. *	 * @access private */	function execute { // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings;

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> text('mimetype') ?>; charset=text('charset') ?>" /> html('headlinks') ?> text('pagetitle') ?> /*<![CDATA[*/ @import "text('stylepath') ?>/text('stylename') ?>/main.css?9"; /*]]>*/ data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css" /> text('jsmimetype') ?>">var skin = 'text('skinname')?>';var stylepath = 'text('stylepath')?>'; <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js?1"> <?php	if($this->data['jsvarurl' ]) { ?> <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"> <?php	} ?> <?php	if($this->data['pagecss'  ]) { ?> <style type="text/css"><?php $this->html('pagecss'  ) ?> <?php	} if($this->data['usercss'  ]) { ?> <style type="text/css"><?php $this->html('usercss'  ) ?> <?php	} if($this->data['userjs'   ]) { ?> <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"> <?php	} if($this->data['userjsprev']) { ?> <script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?> <?php	} if($this->data['trackbackhtml']) print $this->data['trackbackhtml']; ?> <?php $this->html('headscripts') ?> <body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?> <?php if($this->data['body_onload'   ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?> class="<?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">

<a <?php ?>href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>" <?php ?>title="<?php $this->msg('mainpage') ?>"><img class=topbanner src="/skins/common/images/OwlBanner2.135pxh.png"></a>

<?php /* =================== main contents =========================== */ ?>

<?php $this->msg('views') ?> <ul> <?php global $wgUser; /* OLD CODE FOR SELECTIVELY SHOWING STANDARD MW TABS foreach($this->data['content_actions'] as $key => $tab) { $tabOk = true; if (($key == 'talk') || ($key == 'edit') || ($key == 'delete') || ($key == 'move')) { switch ($key) { case 'talk': $tabOk = true; break; case 'edit': $userGrps = $wgUser->getGroups; $tabOk = in_array('sysop', $userGrps); break; case 'delete': $tabOk = $wgUser->isAllowed('delete'); break; case 'move': $tabOk = $wgUser->isAllowed('move'); break; }		}		if ($tabOk) { ?> <li id="ca-<?php echo htmlspecialchars($key) ?>"<?php if($tab['class']) { ?> class="<?php echo htmlspecialchars($tab['class']) ?>"<?php }			?>><a href="<?php echo htmlspecialchars($tab['href']) ?>"> <?php echo htmlspecialchars($tab['text']) ?></a></li><?php }	} ?> // 2006-07-26 NEW CODE FOR JUST SHOWING JERS TABS // yes, there's a better way to do this which makes it easier to edit the tabs, //	but I don't have time to figure it out now. $title = $this->data['title']; $kSelected = ' class="selected"'; switch ($title) { case 'Introduction': $class_Home = $kSelected; break; case 'About PsyCrit': $class_About = $kSelected; break; case 'Articles': $class_Main = $kSelected; break; case 'Instructions to Authors': $class_Auth = $kSelected; break; } ?>
 * 1) 		if ($wgUser->isAllowed($key)) { ? >
 * 1) 			$tabOk = true;
 * 2) 				$tabOk = false;
 * 1) 			$tabOk = true;
 * 1) 			$tabOk = true;

<li<?php echo$class_Home ?>><a href="/">introduction</a> <li<?php echo$class_About ?>><a href="/About PsyCrit">about PsyCrit</a> <li<?php echo$class_Main ?>><a href="/Articles">articles</a> <li<?php echo$class_Auth ?>><a href="/Instructions to Authors">instructions to authors</a>

</ul>

</a> <?php if($this->data['sitenotice']) { ?> <?php $this->html('sitenotice') ?> <?php } ?> <h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?> <h3 id="siteSub"><?php $this->msg('tagline') ?> <?php $this->html('subtitle') ?> <?php if($this->data['undelete']) { ?> <?php    $this->html('undelete') ?> <?php } ?> <?php if($this->data['newtalk'] ) { ?> <?php $this->html('newtalk') ?> <?php } ?> <?php if($this->data['showjumplinks']) { ?> <?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a> <?php } ?> <?php $this->html('bodytext') ?> <?php if($this->data['catlinks']) { ?> <?php      $this->html('catlinks') ?> <?php } ?>

<?php if($this->data['poweredbyico']) { ?> <?php $this->html('poweredbyico') ?> <?php 	} if($this->data['copyrightico']) { ?> <?php $this->html('copyrightico') ?> <?php	}

?> <?php /*		$footerlinks = array(			'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright',			'privacy', 'about', 'disclaimer', 'tagline', */		$footerlinks = array( 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright', 'tagline', ); ?>	<script type="text/javascript"> if (window.runOnloadHook) runOnloadHook; <?php $this->html('reporttime') ?> <ul id="f-list"> <?php		// Generate additional footer links		foreach( $footerlinks as $aLink ) {			if( $this->data[$aLink] ) { ?>				<li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li> <?php 		}		} ?><li>This website is in no way affiliated with "psyccritiques" or the American Psychological Association. </ul> <?php	wfRestoreWarnings;	} // end of execute method } // end of class ?>