Mar 19, 2007

Ajax Comments

本文永久地址:
http://blog.znsun.com/plugins-list/ajax-comments-reply/

MSN留言风格的Ajax Commens-Reply插件
(
MSN Type Ajax Comments-Reply Plugin)

原创于懶懶喵日記,后Zhang-Zi根据此版本制作了非常优秀的Ajax Comments-Reply插件,现在这个版本实质是将Zhang-Zi的两个版本(一个是以前的实现msn风格的留言版本,另一个是他现在用的版本)合二为一。因此,这里特别感谢两位作者之前所作的大量努力。此版本主要实现的功能如下:

  • 可以配合Smiley Javascript Buttons,插入表情符号
  • 使用回复无需刷新
  • 可以直接在各种页面上(主页,多文章页面,单篇文章)回复留言(默认为5层嵌套),使得讨论更有针对性

修订版1.5主要改了一下几个方面:

  • 修正了代码中的若干错误
  • 加入了set_innerHTML函数,使得innerHTML中的js代码也可以被运行。现在在主页或者单篇日志上均可直接使用Smiley JS Buttons的表情代码(要求系统已经安装了Smiley JS Buttons插件)。

修订版1.1β主要改了一下几个方面:

  • 修改了原插件必须放置在wordpress根目录下的缺点,同时保留了prototype.lite等函数(因为我用的litebox中也用到了prototype.lite【注】litebox是lightbox的精简版本,用以实现图片显示的特殊效果)。
  • 整合了Zhang-Zi的两个不同版本的插件,合并了部分代码,使之达到现在的显示效果。
  • 修改了留言栏的式样,使得符合我的blog风格。
  • 压缩了javascript代码,其中css文件没有压缩,如果有需要,可以参考我的文章:加速Wordpress
  • 加上了Smiley JS Buttons的表情代码,如果你安装了Smiley JS Buttons,可以在单页留言中使用表情符号。

压缩包内容,包含在一个comment-reply的文件夹:

  1. readme.html //Read Me
  2. ajax-comments.php //实现在多文章页面上留言
  3. comments.php //实现单页面上的留言
  4. comment.css // css文件,控制评论栏效果
  5. comment.js, parse.js.php //已压缩的 javascript文件
  6. moo.ajax.js, prototype.lite.js, moo.fx.js //prototype.lite 模块
  7. comments-ajax.php //ajax留言处理
  8. comment-reply.php //插件控制
  9. working.gif //Loading留言时候的动态图标
  10. unzip文件夹 //未压缩过的javascript版本

插件安装使用:

  1. 从上面链接下载安装文件,解压缩后得到一个comment-reply文件夹
  2. 把文件夹的comments.php放到模版目录下,覆盖同名文件—请备份旧的comments.php
  3. 将comment-reply文件夹整个放入插件目录。结构如下:
    ---------------Plugins/
    ----------------------/comment-reply/
    ----------------------------comment-reply.php 等文件
  4. 到管理界面启用Ajax Comments-Reply修订版插件。
  5. 在index.php中用以下代码显示评论:

    <?php $pid=$post->ID; $cnum = get_comments_number(); showcomment($pid, $cnum);?>

插件卸载:

  1. 将模版目录下备份的comments.php复原。
  2. 管理界面停用插件或者直接删除此插件文件。

欢迎使用。有任何问题,可在此留言,或者email 到 "qmqsun(AT)gmail.com",当然,也可以去问Zhang-Zi,他的G-talk是"zhang(AT)zhiqiang.org"。 :)

Post by SUN @ 7:40 am | 我的页面 | Comments (44)

WP Real Static Homepage

PLEASE Scroll down for Chinese version

This plugin enables the wp system to convert your dynamic homepage to static index.html, more importantly, keep the content up to date. It can speed up the loading for your homepage.

Readme:

  1. Plugin WP-Cron is needed for this plugin, I've packed WP-Cron v 1.4 in the zip file.
    Please upzip all the files to plugins/static-index, so that it look like:
    ------plugins/
    ------------static-index/
    ----------------static.php
    ----------------wp-cron-static-index.php
    ----------------wp-cron.php
  2. Active two plugins :WP-cron and WP-Cron Static Homepage.
  3. Create a file named index.html in your blog root folder, set
    666 permissions for it.

Well, the system will update index.html automatically (per 15 mins), you may hack wp-cron.php at line 49 to change the time for scheduled exection actions.

More Tips:

  1. You may use the following php to refresh homepage when comments come in.

    <?php
    include (get_settings('siteurl') . "/wp-content/plugins/static-index/static.php");
    ?>

  2. The following script is to demo how to set cookies in the html files.

    <script type="text/javascript">
    function GetCookie(sName, id)
    {
    // cookies are separated by semicolons
    var something = document.getElementById(id);
    if(!something) return 0;
    for (var i=0; i < aCookie.length; i++)
    {
    // a name alue pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0])
    {
    if(sName=="comment_author_10add94cfc29a64b08306c8a8f9edb30")
    something.value = decodeURI(aCrumb[1]);
    else
    something.value=unescape(aCrumb[1]);
    return 1;
    }
    }
    // a cookie with the requested name does not exist
    return 0;
    }
    //please fill in with your own cookie id
    GetCookie("comment_author_8e11b42cc2f3a74aac664cc9afa5baf7", "authorname");
    GetCookie("comment_author_email_8e11b42cc2f3a74aac664cc9afa5baf7", "email");
    GetCookie("comment_author_url_8e11b42cc2f3a74aac664cc9afa5baf7", "url");</script>

Post by SUN @ 7:32 am | 我的页面 | Comments (7)

My Plugins List

下面是我安装的插件列表,其中包含了我自己写或者修改的两个插件,如果你有兴趣下载,请点击左侧My Plugins List下文章。

Plugin

Description

Ajax
Comments-Reply
此版本实质是将Zhang-Zi的两个ajax
comments版本(一个是以前的实现msn风格的留言版本,另一个是他现在用的版本)合二为一,从而实现多篇文章(包括主页)存在时的无延迟留言效果。目前是Chaney
SUN的版本
。 By Zhang-Zi.
Akismet Akismet checks your comments against the Akismet web service to see if they
look like spam or not. You need a WordPress.com
API key
to use it. You can review the spam it catches under “Comments.” To
show off your Akismet stats just put <?php akismet_counter(); ?> in your
template. By Matt
Mullenweg
.
Auto-hyperlink
URLs
Auto-hyperlink text URLs in post content and comment text to the URL they
reference. Does NOT try to hyperlink already hyperlinked URLs. Improves WordPress’s
default make_clickable function, along with adding some configuration options.
By Scott Reilly.
Collapsible
More Link
Allows you to click a link and instantly display the rest of your post instead
of loading the ‘view more’ page. By Chroder.
Extended
Live Archives (Modified)
Modified by Zhang-Zi. Implements a
dynamic archive. Visit the
ELA option panel
to initialize the plugin. By Arnaud
Froment
.
Google
(XML) Sitemaps
This generator will create a sitemaps.org compliant sitemap of your WordPress
blog which is supported By Google, MSN Search and YAHOO. Configuration
Page
By Arne
Brachhold
.
IImage
Browser
This plugin adds an “IImage Browser” button to the Quicktags area which opens
an image browser to select from all previously uploaded images and add the appropriate
code to the post. By Martin
Chlupáč
.
JS
Toggle Boxes
Reduces clutter by placing on/off JavaScript toggles on the page elements
of your choice. By Skippy,
skippy zuavra net
.
Media
Insert
Create ActiveX Media code by enclosing the info in %filename%,%width%,%height%,%detail%.
By AvP.
Page
Links To
Allows you to set a “links_to” meta key with a URI value that will be be used
when listing WP pages. Good for setting up navigational links to non-WP sections
of your By Mark Jaquith.
Quotmarks
Replacer
Convert all SBC quotation marks and suspension points into DBC case. 解决 WordPress
的全角引号问题,将全角的单引、和双引号和省略号替换成半角的格式,使后台输入的引号、省略号格式与前台读者浏览的引号格式保持一致。 By Sparanoid.
Sidebar
Slider
Makes page elements slide up and down as you scroll, so you can always have
them within easy reach. By Skippy,
skippy zuavra net
.
Smiley
Javascript Buttons
Lets you display a row of clickable smilies next to your comment textarea.
Thanks to Priyadi Iman Nurcahyo for the inspiration. By Skippy,
skippy zuavra net
.
Ultimate
Gallery2 Slideshow
Gallery2 integration for a fade-in
slideshow typically used in the Sidebar By Steven
Chung
.
Ultimate
Tag Warrior
Ultimate Tag Warrior is a tagging plugin, that’s heavy on tag visualisation.
I Like Pi! By Christine
Davis
.
WordPress
Database Backup
On-demand backup of your WordPress database. Navigate to Manage
→ Backup
to get started. By Scott Merrill and Austin
Matzko
.
wp-cache Very fast cache module. It’s composed of several modules, this plugin can
configure and manage the whole system. Once enabled, go to “Options” and select
“WP-Cache”. By Ricardo
Galli Granada
.
WP-DBManager Manages your Wordpress database. Allows you to optimize database, backup database,
restore database, delete backup database , drop/empty tables and run selected
queries. By GaMerZ.
WP-PageNavi Adds a more advanced paging navigation your WordPress blog. By GaMerZ.
Xspf_player Provides a quick a simple way to put MP3 soundtracks in your wordpress site.
Music can be either local or remote (http). Uses free flash XSPF
music player
. By Jose
Rodriguez (a.k.a. Boriel)
.
Post by SUN @ 7:28 am | 我的页面 | Comment (0)

Ajax Comments Reply

本文永久地址:
http://blog.znsun.com/plugins-list/ajax-comments-reply/

MSN留言风格的Ajax Commens-Reply插件
(
MSN Type Ajax Comments-Reply Plugin)

  • 点击下载版本:1.0β ,最近更新于2007/03/18

原创于懶懶喵日記,后Zhang-Zi根据此版本制作了非常优秀的Ajax Comments-Reply插件,现在这个版本实质是将Zhang-Zi的两个版本(一个是以前的实现msn风格的留言版本,另一个是他现在用的版本)合二为一。因此,这里特别感谢两位作者之前所作的大量努力。此版本主要实现的功能如下:

  • 回复无需刷新。
  • 可以直接在各种页面上(主页,多文章页面,单篇文章)回复留言(默认为5层嵌套),使得讨论更有针对性。

此修订版主要改了一下几个方面:

  • 修改了原插件必须放置在wordpress根目录下的缺点,同时保留了prototype.lite等函数(因为我用的litebox中也用到了prototype.lite【注】litebox是lightbox的精简版本,用以实现图片显示的特殊效果)。
  • 整合了Zhang-Zi的两个不同版本的插件,合并了部分代码,使之达到现在的显示效果。
  • 修改了留言栏的式样,使得符合我的blog风格。
  • 压缩了javascript代码,其中css文件没有压缩,如果有需要,可以参考我的文章:加速Wordpress

压缩包内容,包含在一个comment-reply的文件夹:

  1. readme.html //Read Me
  2. ajax-comments.php //实现在多文章页面上留言
  3. comments.php //实现单页面上的留言
  4. comment.css // css文件,控制评论栏效果
  5. comment.js, parse.js.php //已压缩的 javascript文件
  6. moo.ajax.js, prototype.lite.js, moo.fx.js //prototype.lite 模块
  7. comments-ajax.php //ajax留言处理
  8. comment-reply.php //插件控制
  9. working.gif //Loading留言时候的动态图标
  10. unzip文件夹 //未压缩过的javascript版本

插件安装使用:

  1. 从上面链接下载安装文件,解压缩后得到一个comment-reply文件夹
  2. 把文件夹的comments.php放到模版目录下,覆盖同名文件—请备份旧的comments.php
  3. 将comment-reply文件夹整个放入插件目录。结构如下:
    ---------------Plugins/
    ----------------------/comment-reply/
    ----------------------------comment-reply.php 等文件
  4. 到管理界面启用Ajax Comments-Reply修订版插件。
  5. 在index.php中用以下代码显示评论:

    <?php $pid=$post->ID; $cnum = get_comments_number(); showcomment($pid, $cnum);?>

插件卸载:

  1. 将模版目录下备份的comments.php复原。
  2. 管理界面停用插件或者直接删除此插件文件。

欢迎使用。有任何问题,可在此留言,或者email 到 "qmqsun(AT)gmail.com",当然,也可以去问Zhang-Zi,他的G-talk是"zhang(AT)zhiqiang.org"。 :)

Post by SUN @ 12:57 am | 与时俱进 | Comment (1)
Mar 16, 2007

WP Static Homepage

PLEASE Scroll down for Chinese version

This plugin enables the wp system to convert your dynamic homepage to static index.html, more importantly, keep the content up to date. It can speed up the loading for your homepage.

Readme:

  1. Plugin WP-Cron is needed for this plugin, I've packed WP-Cron v 1.4 in the zip file.
    Please upzip all the files to plugins/static-index, so that it look like:
    ------plugins/
    ------------static-index/
    ----------------static.php
    ----------------wp-cron-static-index.php
    ----------------wp-cron.php
  2. Active two plugins :WP-cron and WP-Cron Static Homepage.
  3. Create a file named index.html in your blog root folder, set
    666 permissions for it.

Well, the system will update index.html automatically (per 15 mins), you may hack wp-cron.php at line 49 to change the time for scheduled exection actions.

More Tips:

  1. You may use the following php to refresh homepage when comments come in.

    <?php
    include (get_settings('siteurl') . "/wp-content/plugins/static-index/static.php");
    ?>

  2. The following script is to demo how to set cookies in the html files.

    <script type="text/javascript">
    function GetCookie(sName, id)
    {
    // cookies are separated by semicolons
    var something = document.getElementById(id);
    if(!something) return 0;
    for (var i=0; i < aCookie.length; i++)
    {
    // a name alue pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0])
    {
    if(sName=="comment_author_10add94cfc29a64b08306c8a8f9edb30")
    something.value = decodeURI(aCrumb[1]);
    else
    something.value=unescape(aCrumb[1]);
    return 1;
    }
    }
    // a cookie with the requested name does not exist
    return 0;
    }
    //please fill in with your own cookie id
    GetCookie("comment_author_8e11b42cc2f3a74aac664cc9afa5baf7", "authorname");
    GetCookie("comment_author_email_8e11b42cc2f3a74aac664cc9afa5baf7", "email");
    GetCookie("comment_author_url_8e11b42cc2f3a74aac664cc9afa5baf7", "url");</script>

Post by SUN @ 5:22 pm | 与时俱进 | Comments (2)
Mar 14, 2007

推荐一款在线播放器

本文于2009年08月20日再次更新

Web2.0的时代,不少人喜欢在自己的blog或者网站上放音乐,不可否认,我也喜欢。
但如何加载音乐的确是个问题,因为大多数在线播放器都会在加载该页面的同时读取相应的mp3文件,这样就降低了网页浏览速度。所以我碰到加载速度慢的mp3,一般都是直接block掉,免得影响自己的浏览速度。

这儿推荐一款flash在线播放器,flash在线播放器的最大的好处就是加载速度快,不会影响网页浏览的速度(至于音乐的加载速度,主要决定于你的带宽)。
如果你是wordpress的用户,我推荐你安装XSPF_Player插件

如果你的blog不是wordpress系统或者你想在自己的其他网页上添加播放器,请用如下的代码:

<object type="application/x-shockwave-flash" data="http://www.znsun.com/Music/player_mp3_maxi.swf" width="200" height="20">
<param name="wmode" value="transparent" />
<param name="movie" value="http://www.znsun.com/Music/player_mp3_maxi.swf" />
<param name="FlashVars" value="mp3=歌曲地址栏&amp;bgcolor1=ffffff&amp;bgcolor2=cccccc&amp;buttoncolor=999999&amp;buttonovercolor=0&amp;slidercolor1=cccccc&amp;slidercolor2=999999&amp;sliderovercolor=666666&amp;textcolor=0&amp;showvolume=1&amp;autoplay=0&amp;loop=0" />
<p>Texte alternative</p>
</object>

注:
上面包含了两段播放代码,针对不同的浏览器有效,满足不同人士需要啦。
这个播放器本身是在我网站上的,你可以下载后再上传到自己的网站上。
其中

  1. 歌曲地址栏请包含完整的歌曲 URL代码
  2. &autoplay=0 用来控制是否自动播放(1为自动播放),如果不需要请删除此部分代码。
  3. &loop=0用来控制是否重复播放(1为重复播放),如果不需要请删除此部分代码。

更多的参考请参阅:http://flash-mp3-player.net/

最后的实际效果见下,自动播放被我取消了,请自行点击开始欣赏。

Texte alternatif

Tags:     
Post by SUN @ 5:07 pm | 与时俱进 | Comment (0)