【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:PLUGIN.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?php
/*
* Nucleus:
PHP/MySQL Weblog CMS (http://nucleuscms.org/)
* Copyright (C) 2002-2005 The Nucleus Group
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* (see nucleus/documentation/index.html#license for more info)
*/
/**
* This is an (abstract) class of which all Nucleus Plugins must inherit
*
* for more information on plugins and how to write your own, see the
* plugins.html file that is included with the Nucleus documenation
*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2005 The Nucleus Group
* @version $Id: PLUGIN.php 760 2005-08-15 10:51:09Z dekarma $
*/
class NucleusPlugin {
// these functions _have_ to be redefined in your plugin
function getName() { return 'Undefined'; }
function getAuthor() { return 'Undefined'; }
function getURL() { return 'Undefined'; }
function getVersion() { return '0.0'; }
function getDescription() { return 'Undefined';}
// these function _may_ be redefined in your plugin
function getMinNucleusVersion() { return 150; }
function getMinNucleusPatchLevel() { return 0; }
function getEventList() { return array(); }
function getTableList() { return array(); }
function hasAdminArea() { return 0; }
function install() {}
function unInstall() {}
function init() {}
function doSkinVar($skinType) {}
function doTemplateVar(&$item) {
$args = func_get_args();
array_shift($args);
array_unshift($args, 'template');
call_user_func_array(array(&$this,'doSkinVar'),$args);
}
function doTemplateCommentsVar(&$item, &$comment) {
$args = func_get_args();
array_shift($args);
array_shift($args);
array_unshift($args, 'template');
call_user_func_array(array(&$this,'doSkinVar'),$args);
}
function doAction($type) { return 'No Such Action'; }
/**
* Checks if a plugin supports a certain feature.
*
* @returns 1 if the feature is reported, 0 if not
* @param $feature
* Name of the feature. See plugin documentation for more info
* 'SqlTablePrefix' -> if the plugin uses the sql_table() method to get table names
* 'HelpPage' -> if the plugin provides a helppage
*/
function supportsFeature($feature) {
return 0;
}
/**
* Report a list of plugin that is required to function
*
* @returns an array of names of plugin, an empty array indicates no dependency
*/
function getPluginDep() { return array(); }
// these helper functions should not be redefined in your plugin
/**
* Creates a new option for this plugin
*
* @param name
* A string uniquely identifying your option. (max. length is 20 characters)
* @param description
* A description that will show up in the nucleus admin area (max. length: 255 characters)
* @param type
* Either 'text', 'yesno' or 'pass
word'
* This info is used when showing 'edit plugin options' screens
* @param value
* Initial value for the option (max. value length is 128 characters)
*/
function createOption($name, $desc, $type, $defValue = '', $typeExtras = '') {
return $this->_createOption('global', $name, $desc, $type, $defValue, $typeExtras);
}
function createBlogOption($name, $desc, $type, $defValue = '', $typeExtras = '') {
return $this->_createOption('blog', $name, $desc, $type, $defValue, $typeExtras);
}
function createMemberOption($name, $desc, $type, $defValue = '', $typeExtras = '') {
return $this->_createOption('member', $name, $desc, $type, $defValue, $typeExtras);
}
function createCategoryOption($name, $desc, $type, $defValue = '', $typeExtras = '') {
return $this->_createOption('category', $name, $desc, $type, $defValue, $typeExtras);
}
function createItemOption($name, $desc, $type, $defValue = '', $typeExtras = '') {
return $this->_createOption('item', $name, $desc, $type, $defValue, $typeExtras);
}
/**
* Removes the option from the database
*
* Note: Options get erased automatically on plugin uninstall
*/
function deleteOption($name) {
return $this->_deleteOption('global', $name);
}
function deleteBlogOption($name) {
return $this->_deleteOption('blog', $name);
}
function deleteMemberOption($name) {
return $this->_deleteOption('member', $name);
}
func