歡迎光臨, 訪客. 請先 登入註冊一個帳號.
三月 29, 2024, 09:08:08 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  如何讓 RSS 只顯示文章的內文部分,而不要顯示延伸內文? « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 如何讓 RSS 只顯示文章的內文部分,而不要顯示延伸內文?  (閱讀 5543 次)
tenz
新手見習
*
文章: 1


檢視個人資料
« 於: 九月 11, 2005, 11:17:23 下午 »

pLog產生的RSS都是包含整篇文章,這樣很長又佔空間。我試著把 ./class/action/rssaction.class.php 做以下修改:
(加上 // 的部分)
程式碼:

    $postText = $article->getIntroText();
    // $postExtendedText = $article->getExtendedText();
    $pm->notifyEvent( EVENT_TEXT_FILTER, Array( "text" => &$postText ));
    // $pm->notifyEvent( EVENT_TEXT_FILTER, Array( "text" => &$postExtendedText ));
    $article->setIntroText( $postText );
   // $article->setExtendedText( $postExtendedText );
   array_push( $articles, $article );

可是無效,RSS 還是包含會整篇文章。請問該如何修改才對?謝謝!

« 最後編輯時間: 九月 11, 2005, 11:19:52 下午 由 tenz » 已記錄

AppServ 1.8.0 (Apache 1.3.24, php 4.2.3, mySQL 3.23.52-nt)
WinXP SP1
pLog 1.0.1
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 九月 12, 2005, 06:08:57 上午 »

把 rss 模版中的

程式碼:
$post->getText()


改為

程式碼:
$post->getIntroText()  // 顯示內文

或是

程式碼:
$post->getExtentedText()  // 顯示延伸內文

其他相關 method 請參考:http://lifetype.org.tw/api/dd/de6/classArticle.html

Mark
已記錄

頁: [1]
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  如何讓 RSS 只顯示文章的內文部分,而不要顯示延伸內文? « 上篇主題 下篇主題 »
    前往: