czly
新手見習

文章: 31
|
 |
« 回覆文章 #1 於: 九月 25, 2007, 10:37:06 上午 » |
|
<?php include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" ); include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" ); include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" ); class PluginToday extends PluginBase { function PluginToday() { $this->PluginBase(); $this->desc = "Very simple plugin that will tell today's date."; $this->author = "The pLog team"; } function show() { $t = new Timestamp();
$todayDate = $t->getDay()."/".$t->getMonth()."/".$t->getYear();
return $todayDate; } } PluginManager::registerPlugin( "today", "PluginToday" ); ?>
我将这样的程序码存在today.class.php,放在plugin目录下,在后台管理中去没有办法发现这个插件
前台main模板中添加{$today->show()}又会报这个错误 Fatal error: Call to a member function show() on a non-object in D:\JOB\baby\root\tmp\1\%%AB^AB5^AB5C16A9%%main.template.php on line 27
|