Posts Tagged with textpattern

Textpattern Plugin: wyn_feed_redirector

This little thing is used to redirect your feed to another url, which is very useful if you are using some feed burn service like feedburner or feedsky. Like the FeedSmith of wordpress, but more powerful

Feature:

1. You can redirect both RSS and ATOM feed, or just redirect one of them.

2. By default, Feedburner and Feedsky clients can see the original feed. And you can add new regular expression value to filter the user agent, for advanced users.

Download: wyn_feed_redirector

Find more plugins in wyn-txp-plugins

———————————— 华丽的分割线 ————————————

这个插件用来将Textpattern的feed转至指定的url地址. 对于Feedburner或者Feedsky用户比较有用, 可以将所有的feed流量和订阅转至Feedburner或者Feedsky烧制的feed, 类似wordpress的 FeedSmith

功能:

1. Textpattern生成RSS和ATOM两种feed, 你可以任选其一, 或者两者同时做转向

2. 可以设定条件转向, 既通过对比客户端HTTP_USER_AGENT值来选择是否对其转向. 为保证Feedburner和Feedsky的spider能够正确抓到信息, 默认会忽略Feedburner和Feedsky的spider.

下载: wyn_feed_redirector

更多插件: wyn-txp-plugins

我所使用的Textpattern插件

UPDATE: 08/03/28, 启用 wyn_feed_redirector

UPDATE: 08/03/26, 启用 glx_gravatar

1. sy_sitemap 自动生成站点的Sitemap

2. chh_article_lib chh_系列插件的支持库

3. chh_if_data 模板标签, 只在标签内部确实有数据输出的时候才输出内容

4. chh_related_articles 根据Category, keywords等生成相关文章列表

5. dpcode 高亮插入文章的代码片段

6. dru_chatometer 根据留言数量排序生成文章列表

7. gho_comments_invite 用于代替comments_invite标签, 不过我只用来获取当前留言的序号

8. glx_admin_ping 发布文章时自动ping指定的服务器列表

9. mcw_templates 导入和导出模板

10. ob1_pagination 分页插件

11. tru_tags 为Textpattern加入tag功能

12. wyn_email_publish 发布文章的同时通过email发布到其他bsp, 我用来同步发布到blogger和live spaces

13. glx_gravatar 用来显示留言用户的gravatar头像, 还不知道gravator的点 这里

Textpattern Plugin: wyn_email_publish (Sync TXP to Live Space)

UPDATE 2008-03-28: 已上传至 Google Codes: wyn-txp-plugins

It has been uploaded to Google Codes: wyn-txp-plugins

————————————————-

如果msn messenger那个联系人边上的小星星能够反映除了live space以外其他blog的更新,那么这个插件绝对不会出现。。。

Wordpress有个一样功能的插件 dj-email-publish , 不过自从换到Textpattern之后就一直没找到同样的插件,最近搭错了神经自己动手写

好吧,我承认我很懒,以至于没有写任何的配置页面,连Post的style甚至email地址都全部hard coding了。。。挨骂了再改吧

用法:
1. 安装插件
2. 编辑插件,找到 txpHtmlMail (“yourmail@mail.com”, $Title, $body); 一行,修改 yourmail@mail.com 为你的邮件地址
3. 激活插件

下载
wyn_email_publish.txt

————————- 传说中的分割线 ————————-

I will never write this if the star beside contact list of msn messenger will be showed after I update my TXP blog.

Usage:
1. Install plugin
2. Edit plugin, find txpHtmlMail (“yourmail@mail.com”, $Title, $body); line and change yourmail@mail.com to your target email address.
3. Active plugin

Download
wyn_email_publish.txt

让Textpattern的URL支持中文

UPDATE: 其实原本的txp在生成urltitle的部分无非是想要trim掉空格并把大写字母转化成小写,那么我们似乎大可以不必动用urlencode,更何况urlencode的链接似乎也不那么友好

还是和下面一样,不过要添加的代码是

if (empty ($incoming['url_title'])) {
$incoming['url_title'] = trim ($incoming['Title']);
$incoming['url_title'] = preg_replace ('/s+/', '-', $incoming['url_title']);
$incoming['url_title'] = strtolower ($incoming['url_title']);
}

效果还是见本文

Textpattern的永久链接的中文bug已经是众所周知的事情了,在撰写文章或者保存文章时,如果没有指定url title,那么将根据文章的标题生成url title,最要命的是,这个生成的url title会无视标题中的中文,例如类似 中文chinese 的标题,最终生成的url title则是 chinese 不难想象,如果title全部是中文的话。。。

当然,如果你的永久链接结构包含文章id的话就没什么问题了,或者,每次都能在发表文章前记得指定一个url title

很遗憾,我不是这种人,只好想个一劳永逸的解决办法了—hack一下code

说来很简单,php提供了一个urlencode的函数,对titile调用这个函数然后把结果指定给url title就行了

编辑 textpattern/include/txp_article.php 文件,找到 textile_main_fields 函数(4.0.5版在第925行),在函数末尾

return $incoming;

之前加一段

if (empty ($incoming['url_title'])) {
$incoming['url_title'] = urlencode ($incoming['Title']);
}

即可,效果看看本文的永久链接就知道了

修正plugin和Textpattern 4.10的兼容性问题

换到4.10后发现之前的一部分插件在后台的管理功能无法正常使用,其实没什么大问题,因为插件功能还是正常,只是插件自身的后台管理部分有些问题

今天升级tru_tags到3.0,顺手也把这个毛病解决了.问题出在text_input函数上,函数的作用是生成一个输入框的html代码,不过4.10的textpattern已经完全废弃了这个函数,看了4.0.5的代码,发现这个函数不过也只是fInput的一个包装,那么解决就很easy了

编辑有问题的插件,愿意按fInput的参数列表逐个替换text_input也行,不过最方便的是在插件代码的最前面加上原来4.0.5的代码

function text_input ($name, $val, $size = '') {
return fInput ('text', $name, $val, 'edit', '', '', $size, '', $name);
}

其实把这段代码直接加到textpattern的源码也行,不过不推荐,毕竟是要废弃的函数嘛...