- 搬迁服务器,速度全面提升
- WordPress 2.5.1更新 - 管理界面性能提升
- 创建、维护一个个人博客的“投入产出比”
- 最新消息WordPress 2.5预计3月10发布,附演示站点
- WordPress2.4管理系统界面出炉 - 官方尽力改善执行效率
- 狂热原创Blogger联盟 - 远离抄袭和欺诈的乌托邦
- WordPress Super Cache发布了
- WordPress2.3的tag编辑体系接近完美
- 开源工具PHPXref - PHP项目不可多得的后期助手
- 11分钟前,WordPress2.3发布了
- WordPress 2.3 RC1 发布了
- WordPress skin "TES" 1.2
- 开源CMS大赛 - 为WordPress投票
- 一款WordPress插件稍作改造兼顾FeedSky与FeedBurner
- Bloggers Free Chat - 博客闲扯
- WordCamp in Beijing - WordPress中文博客首次聚会
- 原创诚可贵,评论价更高;作者诚可贵,读者价更高
- 首届WordPress主题设计大赛
- WordPress 2.2.2 - 请安心地升级吧
- WordPress的几个问题 - Some Issues of WordPress
- Live Writer的局限和我最终的选择
- 各类Blog系统以及BSP转换到WordPress的方法
- 我为什么从LBS换到WordPress
- one More - 后含PJBlog到WordPress的完美转换|带评论及用户
- WordPress2.2及其他
- LBS to WordPress2.1 完美攻略 - 姿态永恒
- aw is back - 阿瓦归来
- LBS到此为止
- sex - 偶们谈“性”色不变~
- 交友+视频交友
- 流量稳步上涨的总结与分享
- 提高Blog初期访问量的5个必备因素
(本文暂无中文版)
Well, Brians Threaded Comments(BTC) from Brian Meidell is really a great plugin. Many famous WordPress blogger such as John Chow is a user of BTC.
I am going to integrate it into another blog ( actually a pure English blog with Chinese authors ). And this blog has already got BTC installed.
However, After installing and using it, there seems to be something strange. Or I may say, some bugs found :(
First, in IE6, the collapse icon is not shown. I am sure it's due to the foolish,old IE6, but we must know that lots of people are still using IE6.
Then, once you click "Reply to this comments", the collapse icon doesn't display correctly. I guess it's due to the JavaScript code that handles the implementation of "class" related jobs.
So, I've just made some simple change to Brian's code, and it seems working correctly now.
I even made some further changes to get some more improvement, for example, I killed the code that fix IE's CSS bugs by using the "clearfix-solution", I make the whole "title" be clickable to make the "collapse-job" more easy. You can see the Demo @ ifgogo.com (English) or just this blog (Chinese)
I will lately pub all these code with my WordPress Theme "TES" if you want it :)
( Attention: It needs jQuery, so if you don't like jQuery, I am sorry that i cannot help )
Here is the changes:
- Use an image-file instead of Brian's PNG-binary-output by PHP.
First, download this image to your current-theme's image folder ( we assume it's called "image", in fact, you can put it anywhere you want)
Then, remove the CSS declaration from briansthreadedcomments.php and add them into your current theme' CSS file:.comment .collapseicon, .collapsed .collapseicon { width: 11px; height: 11px; overflow: hidden; background: transparent url(image/icons.png) no-repeat scroll 0 0; cursor: pointer; margin: 4px 6px 0 0; } .collapsed .collapseicon { background: transparent url(image/icons.png) no-repeat scroll 0 -11px; } - Use jQuery to handle all the JavaScript works. Here is the new functions rewritten with jQuery by me, you just need to include a jQuery.js(1.2.1) and then overwrite the old code between <script> and </script> in briansthreadedcomments.php
function collapseThread(theId) {$("#"+theId).toggleClass("collapsed")} function expandThread(theId) {$("#"+theId).removeClass("collapsed")} function onAddComment() { if (checkDocumentIntegrity()) $("#commentform").submit(); } function moveAddCommentBelow(theId, threadId, collapse) { expandThread(theId); var $addComment = $("#addcomment"); var $comment = $("#"+theId); if(!$addComment.length){alert("Sorry, the comment is currently closed"); return} if(collapse) $comment.children(".comment").addClass("collapsed"); $addComment.appendTo($comment); $("#comment_reply_ID").val(threadId); $("#reroot").show(); $("#comment").focus(); } function checkDocumentIntegrity() { if($("#reroot").length && $("#addcomment").length && $("#comment_reply_ID").length && $(".commentlist").length && $("#comment").length && $("#addcommentanchor").length) { return true } return false; } function reRoot() { $("#reroot").hide(); $("#addcomment").appendTo($(".commentlist")); document.location.href="#addcommentanchor"; $("#comment").focus(); $("#comment_reply_ID").val("0"); }



分享到做啥


This is just a test from aw.
嘿嘿,看起来还不错。
果然不错,嘿嘿
确实不错。
非常不错
测试一下。
我来试一下.
"So, I've just made some simple change to Brain's code, and it seems working correctly now." => actually, it's "Brian", not "Brain".
whooo... Thanks! Let me fix it.
It's so powerful!!
Thanks for share
testing testing...
研究一下
我按照这个说明做的, 可能有地方没做对, 最后的效果不是我想要的.. 郁闷.. 给你写了邮件询问详细步骤了.
Thanks for sharing. Although you link to icon.png is no longer working ...
那个PNG文件现在无法下载?