歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 19, 2024, 02:37:29 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  秘密文章會在summary最新文章中題示 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 秘密文章會在summary最新文章中題示  (閱讀 16518 次)
歌德
新手見習
*
文章: 25


檢視個人資料
« 於: 八月 01, 2005, 12:36:49 下午 »

summary.php最新文章中會顯示所有新文章的節錄,包括秘密文章。
怎樣可以在summary.php程式中知道該文是秘密并不顯示他?
多謝各位!
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 八月 01, 2005, 12:47:02 下午 »

引用自: 歌德
summary.php最新文章中會顯示所有新文章的節錄,包括秘密文章。
怎樣可以在summary.php程式中知道該文是秘密并不顯示他?
多謝各位!


sigh ... 問問題前,能先搜尋一下嗎?

http://forum.lifetype.org.tw/index.php?topic=918.0&highlight=secret

Mark
已記錄

歌德
新手見習
*
文章: 25


檢視個人資料
« 回覆文章 #2 於: 八月 01, 2005, 12:55:17 下午 »

mark兄,對不起,有時就是太懶,下次不會啦
已記錄
kung1014
新手見習
*
文章: 1


檢視個人資料
« 回覆文章 #3 於: 七月 15, 2006, 06:46:19 下午 »

引用自: 歌德
summary.php最新文章中會顯示所有新文章的節錄,包括秘密文章。
怎樣可以在summary.php程式中知道該文是秘密并不顯示他?
多謝各位!

sigh ... 問問題前,能先搜尋一下嗎?

http://forum.lifetype.org.tw/index.php?topic=918.0&highlight=secret

Mark

馬克兄:

很抱歉,我很仔細讀過相關文件,有關secret plugin,在rss的部分,是要更動哪些地方,可以給我一個樣板嗎?
我已依照您的說明,改好了summary/post.template,不過在rss的部分,一直摸不到頭緒。謝謝你。
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


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

哪裡的 rss? blog 頁面,還是 summary 頁面 ...

我用 /templates/rss/rss20.template 為例子:

你必須改成:

引用
<?xml version="1.0" encoding="{$locale->getCharset()}"?>
<?xml-stylesheet href="{$url->getUrl("/styles/rss.css")}" type="text/css"?>
<rss version="2.0"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
>
 <channel>
  <title>{$blog->getBlog()|escape}</title>
  <link>{$url->blogLink()}</link>
  <description>{$blog->getAbout()|escape}</description>
  <pubDate>{$locale->formatDateAsRFC822($now)}</pubDate>
  <generator>http://www.lifetype.net</generator>
  {foreach from=$posts item=post}
{assign var=isSecretField value=$post->getFieldObject("password_protected")}
{if empty($isSecretField) || $isSecretField->getValue() != 1}

  <item>
   <title>{$post->getTopic()|escape}</title>
   <description>
    {$post->getText()|escape}
   </description>
   <link>{$url->postPermalink($post)}</link>
   <comments>{$url->postPermalink($post)}</comments>
   <guid>{$url->postPermalink($post)}</guid>
   {assign var="postOwner" value=$post->getUserInfo()}
   <dc:creator>{$postOwner->getUsername()|escape}</dc:creator>
   {foreach from=$post->getCategories() item=category}   
    <category>{$category->getName()|escape}</category>
   {/foreach}
   {assign var="postDate" value=$post->getDateObject()}
   <pubDate>{$locale->formatDateAsRFC822($postDate, $blog)}</pubDate>
   <source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
   {foreach from=$post->getArticleResources() item=resource}
    {** please uncomment the line below if you'd like to server everything but images, instead of
        only audio and video **}
    {** if !$resource->isImage() **}
    {if $resource->isSound() || $resource->isVideo()}
     <enclosure type="{$resource->getMimeType()}" length="{$resource->getFileSize()}" url="{$url->resourceDownloadLink($resource)}" />
    {/if}
   {/foreach}
  </item>
  {/foreach}
{/if}
 </channel>
</rss>

請看粗體字的部分,其他的請以此類推。

Mark
已記錄

ajer001
版主
超級會員
*****
文章: 516


張阿駕


檢視個人資料 個人網站
« 回覆文章 #5 於: 七月 18, 2006, 10:28:48 上午 »

如果你要參考語法,你可以看看我這篇文章
http://twntwn.info/blog/ajer001/archives/1144

不過沒有註釋,你可能要試著看看程式碼。
已記錄

|| FreeBSD + Apache 2.x + PHP 5.x + MySQL 5.x ||
-- ajer001 AT twntwn.info --
lizzie
新手見習
*
文章: 24


檢視個人資料
« 回覆文章 #6 於: 十一月 01, 2006, 08:39:04 下午 »

1.我在lifetype1.1裝了秘密文章外掛, 啟用後還是會在summary最新文章中題示, 這問題1.1沒有fix嗎?
   還是要自己修改post.template 嗎?
2. 我試著不啟用此外掛, 但奇怪的是設定密碼的欄位還是會出現在發表新文章的畫面, 要怎樣回復到沒有加外掛時的樣子?
3. 要移除外掛, 只需從plugin資料夾移除資料夾就可以嗎, 還需作什麼?
已記錄
evenrain
初級會員
**
文章: 98



檢視個人資料
« 回覆文章 #7 於: 十一月 02, 2006, 10:47:47 上午 »

1.我在lifetype1.1裝了秘密文章外掛, 啟用後還是會在summary最新文章中題示, 這問題1.1沒有fix嗎?
   還是要自己修改post.template 嗎?
外掛的部份 使用者必須自己修改相關模板

2. 我試著不啟用此外掛, 但奇怪的是設定密碼的欄位還是會出現在發表新文章的畫面, 要怎樣回復到沒有加外掛時的樣子?
3. 要移除外掛, 只需從plugin資料夾移除資料夾就可以嗎, 還需作什麼?
內容管理 -> 自訂欄位列表,將兩個密碼保護相關欄位刪除即可 (password_field & password_protected)
已記錄
lizzie
新手見習
*
文章: 24


檢視個人資料
« 回覆文章 #8 於: 十一月 02, 2006, 11:33:46 上午 »

太感謝了! 終於把密碼欄位給清除了!
已記錄
頁: [1]
LifeType 中文開發論壇  |  支援  |  安裝與設定  |  秘密文章會在summary最新文章中題示 « 上篇主題 下篇主題 »
    前往: