主題: 我的PLOG升级后一直有问题诚请大大帮忙 作者: mumuhsucom 於 七月 04, 2005, 11:37:46 下午 我的PLOG自从0.32升级以来一直有问题出现,
过去三个星期了一直找不到问题答案 诚请这儿的大大帮帮忙看看是啥问题 我的PLOG首页看似无什么问题 http://blog.bitscn.com 但打开里面会员的BLOG就出现问题了 http://bitscn.com/blog/index.php?blogId=9 我的环境: win2000+SP4+MYSQL4.0.15+PHP4.3.11+IIS+ZendOptimizer-2.5.10 主題: 我的PLOG升级后一直有问题诚请大大帮忙 作者: mumuhsucom 於 七月 04, 2005, 11:38:40 下午 出错信息:
Fatal error: Call to a member function on a non-object in D:\WE\bitscn.com\blog\tmp\9\%%115^%%1155534757^header.template.php on line 94 是在最新评论里的 主題: 我的PLOG升级后一直有问题诚请大大帮忙 作者: markwu 於 七月 05, 2005, 10:56:20 上午 Hi mumuhsucom:
1. 你有裝 recentcomments plugins 嗎? 2. 檢查一下這個模版的 recentcomment 的語法是不是對的。 Mark 主題: 我的PLOG升级后一直有问题诚请大大帮忙 作者: mumuhsucom 於 七月 05, 2005, 04:20:43 下午 Dear Mark
这个插件的作者没想到也是你老人家呀^^ 我一个地方都没改过,原般抄过来给你看看 <?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/dao/articlecomments.class.php" ); include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" ); include_once( PLOG_CLASS_PATH."class/dao/article.class.php" ); /** * Plugin that offers features to return a recent article comments from the current blog */ class PluginRecentComments extends PluginBase { function PluginRecentComments() { $this->author = "Mark Wu"; $this->desc = "This plugin offers the most recently article comments. Usage as follow:<br /><br />Add the following code to header.template<br /><br /><strong><p><br />{assign var=comments value=\$recentcomments->getRecentComments()}<br />{foreach from=\$comments item=comment}<br />{assign var=postid value=\$comment->getArticleId()}<br />{assign var=post value=\$recentcomments->getCommentArticle(\$postid)}<br />{if \$comment->getUserUrl()}<br /><li><a title="{\$comment->getText()|truncate:150:"..."|escape}" href="{\$comment->getUserUrl()}">{\$comment->getUsername()}</a> &gt;&gt; <a href="{\$url->postPermalink(\$post)}">{\$post->getTopic()}</a></li> <br />{else}<br /><li><a title="{\$comment->getText()|truncate:150:"..."|escape}" href="{\$url->postPermalink(\$post)}">{\$comment->getUsername()}</a> &gt;&gt; <a href="{\$url->postPermalink(\$post)}">{\$post->getTopic()}</a></li><br />{/if}<br />{/foreach}<br /></p></strong><br /><br />You can use <br /><br /><strong>getRecentComments(5)</strong> to get recent 5 comments. The default view is BLOG. <br /><strong>getRecentComments(10, 'SITE')</strong> to get recent 10 comments from SITE view. It is very convenient for pLog Host Provider.<br /><br />"; $this->PluginBase(); } /** * Returns the recent comments object of current blog */ function getRecentComments($maxComments = 12, $based = 'BLOG') { $comments = new ArticleComments(); $config = new Config(); $prefix = $config->getValue('db_prefix'); $blogId = $this->blogInfo->getId(); if ($based == 'BLOG') { $query = "SELECT ".$prefix."articles_comments.* FROM ".$prefix."articles_comments, ".$prefix."articles"; $query .= " WHERE ".$prefix."articles_comments.article_id = ".$prefix."articles.id AND ".$prefix."articles.blog_id = ".$blogId." AND ".$prefix."articles.status = 'published'"; $query .= " ORDER BY ".$prefix."articles_comments.date DESC"; } elseif ($based == 'SITE') { $query = "SELECT ".$prefix."articles_comments.* FROM ".$prefix."articles_comments, ".$prefix."articles"; $query .= " WHERE ".$prefix."articles_comments.article_id = ".$prefix."articles.id AND ".$prefix."articles.status = 'published'"; $query .= " ORDER BY ".$prefix."articles_comments.date DESC"; } else { return false; } if( $maxComments > 0 ) $query .= " LIMIT 0,".$maxComments; $result = $comments->_db->Execute( $query ); if( !$result ) return false; $recentcomments = Array(); while( $row = $result->FetchRow()) { array_push( $recentcomments, $comments->_fillCommentInformation($row)); } return $recentcomments; } function getCommentArticle( $artId ) { $articles = new Articles(); $config = new Config(); $prefix = $config->getValue('db_prefix'); $blogId = $this->blogInfo->getId(); $query = "SELECT * FROM ".$prefix."articles WHERE id = ".$artId; $query .= " AND blog_id = ".$blogId; $query .= ";"; // we send the query and then fetch the first array with the result $result = $articles->_db->Execute( $query ); if( $result == false ) return false; if ( $result->RecordCount() == 0) return false; $row = $result->FetchRow( $result ); $article = $articles->_fillArticleInformation( $row ); return $article; } } PluginManager::registerPlugin( "recentcomments", "PluginRecentComments" ); ?> 主題: 我的PLOG升级后一直有问题诚请大大帮忙 作者: bibicall 於 七月 05, 2005, 11:18:28 下午 Hi, mumuhsucom
我想Mark前輩的意思是 你檢查一下header.template.php 裡面的語法 是不是如plugin的readme的指示 主題: 我的PLOG升级后一直有问题诚请大大帮忙 作者: markwu 於 七月 06, 2005, 12:33:40 上午 hi mumuhsucom:
Plugins 也必須升級到 1.0,你貼上來的 plugin 還是 0.32 版的阿!當然不能 work ... Orz 你的 /plugns 中的外掛程式都必須升級到 1.0的版本,請到 sourceforge 下載。 Mark |