歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 19, 2024, 05:50:20 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  開發  |  外掛程式  |  寻找mark wu « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 寻找mark wu  (閱讀 8746 次)
czly
新手見習
*
文章: 31


檢視個人資料
« 於: 九月 25, 2007, 10:13:13 上午 »

我想写一个个人博客的统计插件,请提供说明
我试验您写的today的例子并没有实验成功
请具体说明一下编写我这类插件程序的实现方式
已記錄
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
已記錄
頁: [1]
LifeType 中文開發論壇  |  開發  |  外掛程式  |  寻找mark wu « 上篇主題 下篇主題 »
    前往: