General
This plugin is used to show the related posts based on the intersection of tags. More the tags are the same, more the relatedness will be.
Installation
- Unzip the file
- Put the folder 'relatedposts' to /user/plugins and activate it
Configuration Option
After activated it, click <Configure> button to setup the plugin.
- No. of Post to be shown - just the number of related posts you want to be shown
- Show in RSS Feed? - Select "Yes" to show related posts in RSS feed, select "No" to skip showing
- Title to be shown in RSS Feed (allow HTML) - When selected "Yes" in option "Show in RSS Feed?", this option is used to display whatever text you like as the title of related posts in RSS feed
Usage
- Use the following code to show the related post inside theme.
An unordered list will be shown with the following structure.echo $related_posts;<ul class="related-post"> <li class="related-post-odd">Post 1</li> <li class="related-post-even">Post 2</li> <li class="related-post-odd">Post 3</li> . . </ul>You can use CSS to style the output.
- When select "Yes" in option "Show in RSS Feed?", related posts will be append to the end of the post in RSS feed by using the following structure.
Title to be shown in configuration option <ul class="related-post"> <li class="related-post-odd">Post 1</li> <li class="related-post-even">Post 2</li> <li class="related-post-odd">Post 3</li> . . </ul>
Changelog
- Version 0.5 - Initial release
- Version 0.6 - Changed to use theme variable instead of function call to better support MVC model of Habari
- Version 0.7 - Add configuration page to setup number of related posts to be shown
- Version 0.8 - Support SQLite
- Version 0.9 - Support PostgreSQL, i18n
- Version 1.0 - Modified to support new FormUI, some code cleanups and setup default configuration option during activation
- Version 1.1 - Fixed the duplicated posts problem that caused by plugin hook 'action_add_template_vars()' called several times and output is appended to template variable '$related_posts' several times due to no initialization is done.
- Version 1.1a - Modified to support both Habari 0.7-alpha (trunk) and Habari 0.6.x (stable) version
- Version 1.2 - Modified to support "Tags as Terms" introduced from r3829 in trunk
- Version 1.3 - Modified to support showing related posts in RSS feed
- Version 1.3a - Modified to support user selected title of related post shown in RSS feed
Download
- For Habari 0.7-alpha (trunk) (Downloaded 1128 times)
- For Habari 0.6.x (stable) (Downloaded 274 times)
簡介
這個 plugin 是用作顯示 related posts,據著 tag 的關聯來斷定文章是否有關,愈多 tag 相同,關聯性便愈高。
安裝
- 將下載了的 zip file 解壓
- 把 'relatedposts' folder 放在 /user/plugins 中,然後啟動 plugin
設定選項
啟動 plugin 後,click <Configure> button 來設定選項。
- No. of Post to be shown - Related posts 顯示的數量
- Show in RSS Feed? - 希望在 RSS feed 內顯示 related posts 的話,請選擇 "Yes",否則請選擇 "No"
- Title to be shown in RSS Feed (allow HTML) - 若在選項 "Show in RSS Feed?" 中選擇了 "Yes",這個選項是用作在 RSS feed 內 related posts 的標題
使用方法
- 在 theme file 中使用以下的 code 來顯示 related posts。
以下結構的 unordered list 將會顯示出來。echo $related_posts;
大家可使用 CSS 來修飾顯示效果。<ul class="related-post"> <li class="related-post-odd">Post 1</li> <li class="related-post-even">Post 2</li> <li class="related-post-odd">Post 3</li> . . </ul> - 當在選項 "Show in RSS Feed?" 選擇了 "Yes",related posts 會以以下的結構自動加在 RSS feed 中每文章的最尾。
Title to be shown in configuration option <ul class="related-post"> <li class="related-post-odd">Post 1</li> <li class="related-post-even">Post 2</li> <li class="related-post-odd">Post 3</li> . . </ul>
版本資料
- Version 0.5 - 最初發布版本
- Version 0.6 - 由 function call 改為 theme variable,這樣可更切合 Habari 的 MVC model
- Version 0.7 - 加入使用 FormUI 做的設定頁面,可設定 related posts 的顯示數量
- Version 0.8 - 支援 SQLite
- Version 0.9 - 支援 PostgreSQL、i18n
- Version 1.0 - 使用了新的 FormUI、code cleanups 和在啟動 plugin 時自動設定 plugin 的預設選項
- Version 1.1 - 修正了因 plugin hook 'action_add_template_vars()' call 了數次而忘記 initialize template variable '$related_posts' 引致的重覆 posts 問題
- Version 1.1a - 支援 Habari 0.7-alpha (trunk) 和 Habari 0.6.x (stable) 版本
- Version 1.2 - 支援由 trunk r3829 開始的 "Tags as Terms"
- Version 1.3 - 支援在 RSS feed 顯示 related posts
- Version 1.3a - 支援自行設定在 RSS feed 中 related posts 的標題
下載
- Habari 0.7-alpha (trunk) 版本(已經下載了 1128 次)
- Habari 0.6.x (stable) 版本(已經下載了 274 次)
国人关注的好像很少啊!
@偶愛偶妻:我想我是華人圈中極少數留意 Habari 甚至有意轉用 Habari 的人。
Same as the other one (as you said structure is the same) and I also got 500 error, this time I just commented that line out and this works again.
@sfong, what the error message shown in apache error log?
其实我也挺关注的.呵呵.但是离转换平台还有段距离.现在的Habari还有许多对中文用户来说的硬伤,比如文章链接地址,如果文章名称为中文的话那链接地就惨不忍睹了.
@iHao 對我來說已經接近轉用 Habari 的時機,最好可支援 XMLRPC 和留言 email alert,但沒有也不是大問題,估計最快九月我應該可以轉到 Habari 去。
Hi,
I got a error when I install Habari,
the message/log are:
--------------------------------------------------
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
04/18/08 15:01:59
Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5
---------------------------------------------------
running latest HEAD, the plugin is echoing the list of related posts 4 times. Any ideas?
天呐,问题总算解决了,谢谢天佑,我这边的问题也解决了,就差升级0.5的DB了。
All the related posts are displayed 2 times by me.
Hi, are you plannig to make it a block for the 0.7 version? That would be really neat :)