三月 06, 2007

[Lifetype1.1X] 模版要修改調整的部份

主是是 main.template 因為加入頁碼的功能,所以要更換!

還是就是文章計數的部份要重新加入!(感謝 新生國小 莊志明 老師的程式修正 )


修改 class/dao/bloginfo.class.php

/* getViewedTotal
Writen by Cmchuang in SNES 2006.09.10
*/
function getViewedTotal()
{
include_once( PLOG_CLASS_PATH."class/dao/model.class.php" );
$db = new Model();
$query = "SELECT SUM(num_reads) as total FROM ".$db->getPrefix()."articles WHERE blog_id =".$this->getId();

$result = $db->Execute( $query );

if (!$result)
return false;

$row = $result->FetchRow();

if (!isset($row["total"]))
return 0;

$result->close();

return $row["total"];
}


發佈者: 陳怡杰 老師 at 07:19│  點閱次數 (410)│ 修改文章管理迴響迴響 (2)部落格學習筆記
回應文章

1

Re:[Lifetype1.1X] 模版要修改調整的部份

我已加在程式後面,仍然無法出現,程式是加在如下面所示:
function __sleep()
{
$this->_ownerInfo = null;
$this->_usersInfo = null;
$this->_category = null;
$this->_locale = null;
//return( get_object_vars( $this ));
return( parent::__sleep());
}
}
/* getViewedTotal
Writen by Cmchuang in SNES 2006.09.10
*/
function getViewedTotal()
{
include_once( PLOG_CLASS_PATH."class/dao/model.class.php" );
$db = new Model();
$query = "SELECT SUM(num_reads) as total FROM ".$db->getPrefix()."articles WHERE blog_id =".$this->getId();

$result = $db->Execute( $query );

if (!$result)
return false;

$row = $result->FetchRow();

if (!isset($row["total"]))
return 0;

$result->close();

return $row["total"];
}
?>

Posted by 羅主任 at 19/03/2007, 18:16

2

Re:[Lifetype1.1X] 模版要修改調整的部份

我的是:[Lifetype1.4X]版,也是這樣處理嗎?

Posted by 羅主任 at 19/03/2007, 18:22
(必要)
authimage