NP_ExtendedIf.phpのソースコード
<?php
class NP_ExtendedIf extends NucleusPlugin {
function getName() { return 'Extended If'; }
function getAuthor() { return 'Katsumi'; }
function getURL() { return 'http://hp.vector.co.jp/authors/VA016157/'; }
function getVersion() { return '0.2.0'; }
function supportsFeature($what) { return (int)($what=='SqlTablePrefix'); }
function getEventList() { return array('PreSkinParse'); }
function getDescription() { return '
Plugin to extend the "<%if%>" function in skin.<br />
Usage: <%if(hasplugin,ExtendedIf,value=XXXXX)%><br />
(Please use "?extendedif=XXXXX" in URL.)<br />
Examples of the other usages:<br />
<%if(hasplugin,ExtendedIf,home=true)%><br />
<%if(hasplugin,ExtendedIf,catid=2)%><br />
<%if(hasplugin,ExtendedIf,subcatid=10)%><br />
<%if(hasplugin,ExtendedIf,itemid=15)%><br />
';}
var $values=array();
function setOption($name,$value) { $this->values[$name]=$value; }
function getOption($name) { return $this->values[$name]; }
function event_PreSkinParse(){
global $CONF;
$this->setOption('value',$_GET['extendedif']);
$this->setOption('catid',$_GET['catid']);
$this->setOption('subcatid',$_GET['subcatid']);
$this->setOption('itemid',$_GET['itemid']);
$t=$CONF['IndexURL'];
if (@substr($t,@strpos($t,'/',8))==$_SERVER['REQUEST_URI']) { $this->setOption('home','true'); }
else { $this->setOption('home','false'); }
}
}
?>