plugins:extendedif:extendedif_code

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 &quot;&lt;%if%&gt;&quot; function in skin.<br />
Usage: &lt;%if(hasplugin,ExtendedIf,value=XXXXX)%&gt;<br />
(Please use &quot;?extendedif=XXXXX&quot; in URL.)<br />
Examples of the other usages:<br />
&lt;%if(hasplugin,ExtendedIf,home=true)%&gt;<br />
&lt;%if(hasplugin,ExtendedIf,catid=2)%&gt;<br />
&lt;%if(hasplugin,ExtendedIf,subcatid=10)%&gt;<br />
&lt;%if(hasplugin,ExtendedIf,itemid=15)%&gt;<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'); }
  }
}
?>
 
plugins/extendedif/extendedif_code.txt · 最終更新: 2011/03/23 21:28 (外部編集)