Nucleus プラグインのテンプレート
2006年3月2日
ここから始めようという、テンプレート。
<?php
class NP_Template extends NucleusPlugin {
function getName() { return preg_replace('/^.*[\/\\\\]NP_([^\/\\\\]*)\.php$/','$1',__FILE__); }
function getMinNucleusVersion() { return 220; }
function getAuthor() { return 'Katsumi'; }
function getVersion() { return '0.1'; }
function getURL() {return 'http://hp.vector.co.jp/authors/VA016157/';}
function getDescription() { return $this->getName().' plugin'; }
function supportsFeature($what) { return (int)($what=='SqlTablePrefix'); }
function getEventList() { return array(); }
//function getTableList() { return $this->sql_query('list'); }
function install() {/* $this->sql_query('create','(id int(11) not null auto_increment)'); */}
function unInstall() {/* $this->sql_query('drop'); */}
//function init() {}
//function doSkinVar($skinType,$type) {}
//function doTemplateVar(&$item,$type) {}
//function doAction($type){}
/* function sql_query($mode='name',$p1=''){
$tablename[0]=sql_table(strtolower('plugin_'.substr(get_class($this),3)));
switch($mode){
case 'create': return sql_query('CREATE TABLE IF NOT EXISTS '.$tablename[0].' '.$p1);
case 'drop': return sql_query('DROP TABLE IF EXISTS '.$tablename[0]);
case 'list': return $tablename;
case 'name': return $tablename[0];
default: return sql_query($mode.' '.$tablename[0].' '.$p1);
}
} */
function getOption($name){ return $this->_getOption('global', 0, $name); }//required for Nucleus 3.24
}
?>