歡迎光臨, 訪客. 請先 登入註冊一個帳號.
三月 28, 2024, 06:07:26 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  我的PLOG升级后一直有问题诚请大大帮忙 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 我的PLOG升级后一直有问题诚请大大帮忙  (閱讀 9964 次)
mumuhsucom
新手見習
*
文章: 16


檢視個人資料
« 於: 七月 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
已記錄
mumuhsucom
新手見習
*
文章: 16


檢視個人資料
« 回覆文章 #1 於: 七月 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

是在最新评论里的
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #2 於: 七月 05, 2005, 10:56:20 上午 »

Hi mumuhsucom:

1. 你有裝 recentcomments plugins 嗎?
2. 檢查一下這個模版的 recentcomment 的語法是不是對的。

Mark
已記錄

mumuhsucom
新手見習
*
文章: 16


檢視個人資料
« 回覆文章 #3 於: 七月 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>&lt;p&gt;<br />{assign var=comments value=\$recentcomments-&gt;getRecentComments()}<br />{foreach from=\$comments item=comment}<br />{assign var=postid value=\$comment-&gt;getArticleId()}<br />{assign var=post value=\$recentcomments-&gt;getCommentArticle(\$postid)}<br />{if \$comment-&gt;getUserUrl()}<br />&lt;li&gt;&lt;a title=&quot;{\$comment-&gt;getText()|truncate:150:&quot;...&quot;|escape}&quot; href=&quot;{\$comment-&gt;getUserUrl()}&quot;&gt;{\$comment-&gt;getUsername()}&lt;/a&gt; &amp;gt;&amp;gt; &lt;a href=&quot;{\$url-&gt;postPermalink(\$post)}&quot;&gt;{\$post-&gt;getTopic()}&lt;/a&gt;&lt;/li&gt; <br />{else}<br />&lt;li&gt;&lt;a title=&quot;{\$comment-&gt;getText()|truncate:150:&quot;...&quot;|escape}&quot; href=&quot;{\$url-&gt;postPermalink(\$post)}&quot;&gt;{\$comment-&gt;getUsername()}&lt;/a&gt; &amp;gt;&amp;gt; &lt;a href=&quot;{\$url-&gt;postPermalink(\$post)}&quot;&gt;{\$post-&gt;getTopic()}&lt;/a&gt;&lt;/li&gt;<br />{/if}<br />{/foreach}<br />&lt;/p&gt;</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" );
?>
已記錄
bibicall
版主
超級會員
*****
文章: 640


我是豬老大


檢視個人資料 個人網站
« 回覆文章 #4 於: 七月 05, 2005, 11:18:28 下午 »

Hi, mumuhsucom
我想Mark前輩的意思是
你檢查一下header.template.php
裡面的語法
是不是如plugin的readme的指示
已記錄

我的虛擬主機基本資料如下
Operating system: Linux
Apache version: 1.3.37
PHP version: 4.4.4
MySQL version: 4.1.21-standard
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #5 於: 七月 06, 2005, 12:33:40 上午 »

hi mumuhsucom:

Plugins 也必須升級到 1.0,你貼上來的 plugin 還是 0.32 版的阿!當然不能 work ... Orz

你的 /plugns 中的外掛程式都必須升級到 1.0的版本,請到 sourceforge 下載。

Mark
已記錄

頁: [1]
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  我的PLOG升级后一直有问题诚请大大帮忙 « 上篇主題 下篇主題 »
    前往: