wyn_recent_comments 0.1 Release

一直觉得 Textpattern 自带的那个最新留言的tag比较弱, 只能显示作者和文章标题, 不过也凑合用了

昨天 dimlau提到 了这个问题, 于是…无聊之中又出现了一个新的插件

功能比自带的那个稍微强一点点, 可以显示评论内容, 支持字符串截取, 支持内容格式定制以及链接的title属性以及时间格式的定制, 当然数目限制和section限制也是必不可少的

直接下载点 这里

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

Description

Fine, textpattern has already provided a recent comments tag. But someone love it and someone hate it. And it indeed is not so powerful enough. So, this thing was born.

Usage

  1. class: css class, default is wyn_recent_comments
  2. wraptag: tag of wrap, default is ul
  3. break: tag of every item, default is li
  4. label: title label, default is nothing
  5. labeltag: tag of title, default is nothing
  6. limit: number of comments to show, default is 10
  7. wordcount: the length of each comment. The comment whose length is longer than this value, it will be cut off, with UTF-8 support. default is 10
  8. messagebreak: if a comment has been cut off, this value will be showed after it. default is ‘…’
  9. format: the things to show. you can customize it by using tags (%content% for comment content, %commenter% for commenter name, %time% for comment time and %title% for post title). default is %content%
  10. atitle: the title attribute of generated a links. tags can also be used here. default is %commenter% on %time%
  11. section: limit the comments into one section
  12. timeformat: the format of time. it uses standard PHP time format, you can refer PHP doc to know more. default is ‘%d %b %Y · %X’, a little difficult :D

Download HERE

---

wyn_email_publish 0.2 Release

很久之前做了一个 版本 , 不过很简陋, 邮件地址和内容都要手工修改插件才行, 于是重新翻新的一遍, 加入了后台控制面板, 可以自定义多个邮件地址, 甚至可以定义邮件的标题和内容.

至于为什么有这么个插件, 无非就是为了发post的时候同时发到别的BSP上, 例如blogger, live space之类

直接下载点 这里

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

wyn_email_publish

Description

When you publish a new post, this plugin will mail it to everywhere (email address of course :D) you want.

That means, you can publish the post onto other BSPs, which support email publish feature (like live space, or blogger), just as the same time you publish on textpattern.

History

  • 0.2: Add admin config panel, you can not only set the email addresses here, but also customize the content of mail
  • 0.1: Initialize Release, just has basal function, a little troublesome to use

Usage

  1. Install and active it, and of course, set up your email publish function of your BSPs
  2. Go to extenstion -> Email Publish
  3. Now you can set the mail address, use ‘;’ to separator if you have more than one address
  4. Set the title and body of mail, you can use the tag title, body, author and link to replace the title
    , the content, the author name and the link of the article. (NOTICE: link and body are NOT allowed in mail title)
  5. Go to write a new post to introduce this little thing :D

Download HERE

---

Textpattern Comment SOFA (TXP沙发党)

嗯, 昨天晚上无聊, 花了三个小时实现了一个雏形, 实现了对留言者统计并输出, 支持生成列表或者cloud

今天又修修补补加了用来识别用户的keyword属性, 并支持skip列表, 称之为0.2版本

后来觉得没有准确的统计沙发, 有点和名字不符, 于是又新增了restricted模式, 用来精确计算沙发党, 当然还是同时支持cloud输出和list输出. 并同时修改到0.3版本

cloud的效果如下, 喜欢的就拿去用好了

点这里 下载

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

Comment Sofa plugin for Textpattern

It can generate a cloud or a list for commenters who commented the most. OR generate them for users who got the sofa (first comment to a post) most :D

History

  • 0.3 : Add Restrict SOFA mode, which generator a cloud or a list for the users who got sofa (the first one who comment to a post) most.
  • 0.2 : Add keyword attribute to identify user by name or email and get skip value accepted a list with ‘;’ delimited.
  • 0.1 : Initialize Release

Usage

  1. wyn_comment_sofa_cloud
    • wraptag: wrap your cloud with a tag
    • keyword: The keyword to identify user, available values are name and email, default is name
    • skip: skip the user by indicated thing, default is nothing (lots of blogs just have one admin user to do everything :D) You can set values more than one, just use a ‘;’ to separate.
    • label: the label
    • labeltag: tag of the label
    • limit: the limit of commenters, default is 10
    • class: the class of wrap
    • maxsize / minsize: the max / min font size of the most / least commenter’s link. (Percent, default is 200 and 50)
    • break: the break between links, default is a space
    • showcount: whether to show the count of comments by each commenter, default is 1
    • restricted: whether to get RESTRICTED SOFA MODE (Generate cloud by rank of first commented to posts), default is 0
  2. wyn_comment_sofa_list
    • wraptag: wrap your list with a tag
    • keyword: The keyword to identify user, available values are name and email and default is name
    • skip: skip the user by indicated thing, default is nothing (lots of blogs just have one admin user to do everything :D)
    • label: the label
    • labeltag: tag of the label
    • limit: the limit of commenters, default is 10
    • class: the class of wrap
    • break: the break between links, default is a space
    • showcount: whether to show the count of comments by each commenter, default is 1
    • restricted: whether to get RESTRICTED SOFA MODE (Generate list by rank of first commented to posts), default is 0

Download from HERE

---

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

---

修正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的代码

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

---

Textpattern Plugin Creator

熟悉了Wordpress的插件体制的用户,一下子转到Textpattern,对其插件系统可能会很不适应,就像我一样…

Wordpress设置了专有的插件目录,按照特定的格式编写php文件,放到插件目录并在后台激活就可以了,而Textpattern则不同

在Textpattern中,一个插件不仅要遵循某种格式,而且在发布前要经过所谓的“编译”,而安装后的插件也不是以文件形式来存放,而是放在数据库的txp_plugin表里

大致看了一下表的字段,除了版本作者等基本信息外,有三个比较有意思的字段: code, code_restore, code_md5

第一个code字段保存的是插件源代码,也是当前正在工作的版本

第二个code_restore字段保存的是插件的初始源代码,也就是安装时候的源代码,因为textpattern允许用户在后台随时修改插件代码,而修改后的代码会单独保存在code字段,不会涉及到初始的代码,这样在必要时可以做恢复

第三个code_md5字段保存的是插件md5校验码,大概是用来比较当前版本和初始安装的版本比较有没有变化吧

跑题了,回头看看plugin所谓的编译吧

翻了一下官方的插件模板,发现所谓的编译其实很简单,就是新建一个数组,在数组里填入插件的作者版本帮助和源码,然后算出md5一并保存,接着对这个数组序列化并转换成base64编码,不难猜到textpattern后台安装插件的动作了,无非是所有操作的逆操作

不过每次都修改模板并运行获得源码似乎也挺麻烦的,于是借鉴zem plugin template写了一个简单的“编译器”,顺便学习了一下Sajax,和我一样懒得可以用这个吧,呵呵

Textpattern Plugin Creator

简单到简陋的东西,使用说明也免了吧,谁叫我懒呢…

---

wordpress 2.3 tag 扩展 -- Simple Tags

谁说wp的dashboard没用的,今天就无意中在dashboard中发现一个好东东 — simple tags

主要功能:

tag自动补全,推荐tag,tag编辑

当然最有用的是:embedded tag和批量tag编辑

大概看了一下,发现还真是一个不可多得的tag插件

完整信息看这里

---

TagConverter Mod

终于顺利升级到wordpress2.3,最大的变化是新版的wordpress内建了tag系统,这样一来原本的utw就没有什么存在的必要了。但是如何平滑过度到新版的tag系统倒是个头疼的问题,尽管wordpress自身提供了导入utw tag的功能,再配合TagConverter插件,也实现了related post和embedded tag的功能,但是仍旧有一个小小的不足,就是原本使用embedded嵌入的tag已经没有了。

怎么看都不爽,于是决定解决这个问题。不过对于我这种实在是懒得可以的人。。。hack一下TagConverters似乎比重写一个插件要方便很多,于是就有了这个mod版本:后台TagConverter的配置页面中增加了import embedded tag的功能,用来将所有帖子里的embedded tag全部恢复出来。遇到和我一样问题的同学试试这个版本吧 :)

TagConverterMod

---

Quoter插件的Bug

换了Sandbox并调整了一下主题,发现ajax comments无效了,一直以为是模板的关系,仔细跟了一下才发现居然是Quoter搞的鬼。

因该算是Quoter的一个Bug吧,所有带js参数的url全部返回Quoter的JS,于是。。。ajax comments的js便失效了,comment的提交代码自然也就不存在了。

解决:其实可以仿照ajax comments的做法(这点ajax comments的作者要比quoter的作者考虑的周到),就是在返回js之前,判断url是不是quoter的,如果是的话再返回,diff文件如下:


—- quoter.php.ori 2007-08-30 01:38:24.000000000 -0700
+++ quoter.php 2007-08-30 01:42:41.000000000 -0700
-26,8 +26,12
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */

+define(‘PLUGIN_QUOTER_FILE’, ‘quoter.php’);
+define(‘PLUGIN_QUOTER_PATH’, ‘/wp-content/plugins/quoter/’);
+
// Javascript code
-if (isset($_GET[‘js’])) {
+if(strstr($_SERVER[‘PHP_SELF’], PLUGIN_QUOTER_PATH.PLUGIN_QUOTER_FILE)
+ && isset($_GET[‘js’])) {
quoter_JScode();
}

-148,7 +152,8

// If it’s a server side quote page don’t let robots index it – if (isset($_GET[‘quote’]) && $_GET[‘quote’] != “”){
+ if(strstr($_SERVER[‘PHP_SELF’], PLUGIN_QUOTER_PATH.PLUGIN_QUOTER_FILE)
+ && isset($_GET[‘quote’]) && $_GET[‘quote’] != “”){

echo (“n”);

---

Feedsky Ping Plugin for wordpress - Mod

今天终于决定将我的RSS托管从Feedburner迁移到Feedsky,然后开始想办法搞定feed转向的问题

开始是用FeedSmith修改来用的,只要在FeedSmith的选项里填入feedsky的地址,然后对FeedSmith稍加修改:

找到这一段:

if (!preg_match(”/feedburner|feedvalidator/i”, $_SERVER[‘HTTP_USER_AGENT’])) {
add_action(‘template_redirect’, ‘ol_feed_redirect’);
add_action(‘init’,‘ol_check_url’);
}

改成

if (!preg_match(”/feedsky|feedburner|feedvalidator/i”, $_SERVER[‘HTTP_USER_AGENT’])) {
add_action(‘template_redirect’, ‘ol_feed_redirect’);
add_action(‘init’,‘ol_check_url’);
}

后来偶然发现Feedsky有一个已经做好的wordpress插件,而且提供ping的功能,但是这个plugin有一个限制,只能输入feedsky的feed名称,也就是说,所有feed会被转向到feed.feedsky.com/feedname的地址,其实对于不做域名绑定的用户已经完美了,不过对于绑定了域名的用户这种转向就没什么意义了,于是动手稍稍改动了一下。

稍微说明一下:在后台设置feed名的后面会比原来的版本多出加了一个文本输入框,用来填feed地址,如果这个feed地址置空的话则会默认使用feed.feedsky.com/feedname,因为我实在是比较懒,所以也没有加什么说明文字,同时也没有做feed地址的校验,所以。。。各位将就一下吧,能用就成,哈哈

下载 Feedsky Ping Reload

---

修正 Wordpress 2.2 Widget 的 bug

尽管Wordpress 2.2的Widget和Automattic的Sidebar Widget插件兼容,但是却存在一个不大不小的bug:

在调用register_sidebar注册超过一个Sidebar的时候,如果同时指定了Sidebar的名称,那么最终只能注册成功一个

Sidebar,例如按照Automattic的API应该可以使用register_sidebar (2, array (‘name’ => ‘aaa %d’))注册依次为aaa 1,aaa 2的sidebar,而在wordpress中的结果则是只有一个名为aaa的sidebar,看看代码(WORDPRESS DIR/wp-include/widgets.php)


function register_sidebars($number = 1, $args = array()) {
$number = (int) $number;
if ( is_string($args) )
parse_str($args, $args);

$i = 1;
while ( $i < = $number ) {
$_args = $args;
if ( $number > 1 ) {
$_args[‘name’] = isset($args[‘name’]) ? $args[‘name’] : sprintf(__(‘Sidebar %d’), $i);
} else {
$_args[‘name’] = isset($args[‘name’]) ? $args[‘name’] : __(‘Sidebar’);
}

$_args[‘id’] = isset($args[‘id’]) ? $args[‘id’] : “sidebar-$i”;
register_sidebar($_args);
++$i;
}
}

嗯。。。相信已经有同学看出来了,在注册多于一个sidebar时,sidebar的名字是

isset($args[’name’]) ? $args[’name’] : sprintf(__(’Sidebar %d’), $i);

就是说如果指定了名字则已指定的名字为准,没有指定名称时才会按数字递增,那么修改就很容易了(其实照抄Automattic Sidebar Widget的就可以了,嘿嘿)


function register_sidebars($number = 1, $args = array()) {
$number = (int) $number;
if ( is_string($args) )
parse_str($args, $args);

$name = $args[‘name’] ? $args[‘name’] : __(‘Sidebar’);

$i = 1;
while ( $i < = $number ) {
if ( isset($args[‘name’]) && $number > 1 ) {
if ( !strstr($name, ‘%d’) )
$name = “$name %d”;
$args[‘name’] = sprintf($name, $i);
}
register_sidebar($args);
++$i;
}
}

ok,收工

---

重设Gregarius密码

打算加海豚兄到好友更新里的,才突然发现不但忘记了Gregarius的密码,就连用户名也不记得了。。。最近记忆力减退?

于是Google啊Google啊,被我找到这么一个插件:

Password Reset


下载后直接扔到Gregarius的plugins目录,然后在浏览器里:

http://yoursite/plugins/PasswordReset.phps

比如我的http://feed.waynezhang.com/plugins/PasswordReset.phps

ok,用户名密码都么的了,想怎么办就怎么办吧

不过一定要注意:

这个插件属于极端危险的那种,用完了记得删掉,要不……不用讲你也知道了

---

firefox 扩展 hack

edgy的firefox已经升到 2.0b1 了,不过这样以来原来的好多扩展都不能用了,等了几天也不见作者更近,郁闷……自己动手吧

扩展的.xpi文件其实都是zip压缩文件,这个简单,unzip xxx.xpi,ok,解压缩的文件中有一个install.rdf,这个文件定义了扩展名称,版本,支持的firefox版本以及其他的一些附加信息:

<RDF xmlns=“http://www.w3.org/1999/02/22-rdf-syntax-ns#”
xmlns:em=“http://www.mozilla.org/2004/em-rdf#”>

<Description about=“urn:mozilla:install-manifest”>
<em:id>{2722cbe5-82a8-4037-a8f5-e1cb2100e3b2}</em:id>
<em:name>Adsense Notifier</em:name>
<em:version>0.9.1</em:version>
<em:description>Displays your adsense earnings on the statusbar.</em:description>
<em:creator>Allen Holman</em:creator>
<em:homepageURL>http://code.mincus.com</em:homepageURL>
<em:iconURL>chrome://adsense/skin/adsense.png</em:iconURL>
<em:optionsURL>chrome://adsense/content/options.xul</em:optionsURL>
<em:aboutURL>chrome://adsense/content/about.xul</em:aboutURL>
<em:file>
<Description about=“urn:mozilla:extension:file:adsense.jar”>
<em:locale>locale/de-DE/adsense/</em:locale>
<em:locale>locale/en-US/adsense/</em:locale>
<em:locale>locale/it-IT/adsense/</em:locale>
<em:locale>locale/pl-PL/adsense/</em:locale>
<em:locale>locale/zh-CN/adsense/</em:locale>
<em:package>content/adsense/</em:package>
<em:skin>skin/classic/adsense/</em:skin>
</Description>
</em:file>

<!— Firefox —>
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.0</em:minVersion>
<em:maxVersion>1.5.0.*</em:maxVersion>

</Description>
</em:targetApplication>

<!— Flock —>
<em:targetApplication>
<Description>
<em:id>{a463f10c-3994-11da-9945-000d60ca027b}</em:id>
<em:maxVersion>1.0+</em:maxVersion>
<em:minVersion>1.0+</em:minVersion>
</Description>
</em:targetApplication>

</Description>
</RDF>

看到了么? 粗体表示出来的那两句,em:minVersion定义了所支持的firefox的最小版本,em:maxVersion所定义的是最大版本,不用多说了,把那

<em:maxVersion>1.5.0.*</em:maxVersion>

改成大于你的firefox版本就行了:

<em:maxVersion>3.5.0.*</em:maxVersion>

然后打包,注意还是要xpi结尾

zip -r xxx.xpi *

ok,现在用firefox打开新的xpi文件,安装成功

对于已经安装的扩展就更简单了:

cd ~/.mozilla/firefox/

然后是你的profile的文件夹名称,类似于xpciff4l.default这样的

cd xpciff4l.default/extensions

这里存放了所有已经安装的扩展,扩展的文件夹是一些类似于{2722cbe5-82a8-4037-a8f5-e1cb2100e3b2}的文件夹,都是已经解压缩好的插件,还是看这些文件夹下面的install.rdf文件,做做版本号的修改就行了

注意:这样修改只是让扩展可以运行,但并不能保证可以正常运行,目前我所常用的插件可以正常使用的有:

del.icio.us
external ip
compact menu
stop or reload button
web developer

不能用的只有  tab mix plus,不过这个插件可以去作者的网站上下到支持ff2的版本,mozilla主站上是没有的

还有,其实很多主题也可以用类似的方法修改,如果遇到显示不正常的话就要改主题的css了,比较麻烦的说

---

跟风-本站所使用的插件

Update 2007.9.12:  折腾来折腾去的,也懒得更新这个了,索性找个插件建了个Page,绝对时时更新,所以……看这里

BloggingPro China 号召大家列出blog所使用的插件,这几天终于把blog调的差不多了,也总结一篇,呵呵

aLinks 用于将文章中的关键词替换为url链接以及在链接后加小图标美化,新版功能增强了很多,很多都不太会用,呵呵,demo见本帖的链接

Audio player 音频播放器插件,flash界面很简洁漂亮,不过中文音乐名显示会有问题,demo一下 [audio:http://www.waynezhang.com/audio/献世.mp3]

Brian’s Latest Comments 显示最新留言,demo见本站sidebar

Edit n Place 不用进入后台直接修改文章内容,使用ajax技术,并且对UltimateTagWarrior插件有良好的支持,强烈推荐

首字下沉插件 文章首字放大,demo见本站文章

flickrRSS 用于读取flickr的rss以显示最新照片,有后台控制,demo见本站最下方

FancyTooltips 美化链接的description,在link中加入title属性,后台激活即可,demo见本站链接

中文 Wordpress 工具箱 提供最新留言,最新文章,留言最多文章等,同时可以解决中文文章摘要显示的问题,本站用以后者

Feedburner Feed Replacement Feedburner不少人都烧过的吧,这个插件用来将本站的rss feed自动替换为feedburner的rss feed

Spam Karma 2 用于阻止垃圾留言,效果还是很不错滴,推荐

Google Sitemaps 用于给google生成站点地图

Ultimate Tag Warrior 为wordpress加入tag支持,demo见文章后的tag链接,荐

WP-Cron 定时执行一些任务,用来支持数据库定期备份,必备

WordPress Database Backup 用于备份wordpress数据库,必备

Admin Drop Down Menu 减少后台的pageview,必备

Tiger Style Administration 将后台界面改成Tiger系统的风格,纯粹为了好看 审美疲劳,停用

UPDATE 06 / 06 / 27: DJ-Email-Publish 用于和msn spaces同步

---