
這個部份的修改要十分小心!請先備份你的部落格系統資料夾!
要修改的檔案如下
class/summary/action/ ->summarydefaultaction.class.php
templates/admin/ ->globalsettings_summary.templatelocale/ ->locale_zh_TW.php and locale_en_UK.php
templates/summary/ ->announces.template(*)
templates/summary/ ->index.template(*)(*)這兩個檔案為摘要頁面的樣版檔,可以依自己的需要修改,不一定要複製。
class/summary/action/ ->summarydefaultaction.class.php
先搜尋
function perform()
在
include_once( PLOG_CLASS_PATH."class/summary/dao/summarystats.class.php" );
其下加入
include_once( PLOG_CLASS_PATH.'class/dao/articles.class.php' );
在
if( $globalArticleCategoryId != ALL_GLOBAL_ARTICLE_CATEGORIES )
{
$currentGlobalArticleCategory = $categories->getGlobalArticleCategory( $globalArticleCategoryId );
$this->_view->setValue( "currentGlobalArticleCategory", $currentGlobalArticleCategory);
}
其下加入
// jay add start
//get site annonce posts from admin's blog
$siteAdminBlogId = $this->_config->getValue( "default_blog_id", 1);
$siteAnnounceCategoryId = $this->_config->getValue( "summary_announce_category_id", 1);
$articles = new Articles();
$announcePosts = $articles->getBlogArticles( $siteAdminBlogId, -1, $this->_numPosts, $siteAnnounceCategoryId, POST_STATUS_PUBLISHED );
$categories = new ArticleCategories();
$announceCategory = $categories->getCategory( $siteAnnounceCategoryId, $siteAdminBlogId );
//jay add end
找到
$this->_view->setValue( "globalArticleCategoryId", $globalArticleCategoryId );
其下加入
//jay add
$this->_view->setValue( "announces", $announcePosts );
$this->_view->setValue( "annCategory", $announceCategory );
//jay add end
結束
templates/admin/ ->globalsettings_summary.template
找到最後一行的 </div>
其上加入
<!-- summary_announce_category_id by jay -->
<div class="field">
<label for="config[summary_announce_category_id]">summary_announce_category_id</label>
<div class="formHelp">{$locale->tr("help_summary_announce_category_id")}</div>
<input style="width:100%" type="text" name="config[summary_announce_category_id]" id="config[summary_announce_category_id]" value="{$summary_announce_category_id}"/>
</div>
templates/summary/ ->index.template
找到
<tr>
<td>{$locale->tr("summary_welcome_paragraph")}
</td>
</tr>
改成
<!-- jay start
<tr>
<td>{$locale->tr("summary_welcome_paragraph")}
</td>
</tr>
-->
<!-- jay start -->
<tr>
<td>
{include file="summary/announces.template"}
</td>
</tr>
<!-- jay end -->
locale/ ->locale_zh_TW.php
加入新變數的中文解譯
找到
$messages['help_summary_disable_registration'] = '是否關閉使用者註冊新網誌的功能。';
其下加入
$messages['help_summary_announce_category_id'] = '摘要頁面公告文章的文章分類 ID。網站管理員可以自己的 blog 發佈文章並設成此一文章分類,便可以顯示在摘要頁面的首頁。';