Blogger beta:首页展开/收缩评论

此文已更新,请看这儿

这是鱼在Blogger classic里曾用过的一个Hack,个人认为非常实用。Thanks to singpolyma.

1.展开代码,紧跟</head>之前,添加下面代码。

<script type="text/javascript">
//<![CDATA[
var comment_form_template = '<div class="comment-poster">[[AUTHOR]]</div>\n'
+ '<div class="comment-body"><div class="innerCmntBody">[[BODY]]</div></div>\n'
+ '<div class="comment-timestamp"><a href="[[PERMALINK]]" title="comment permalink">[[DATE]]</a></div>\n';
//]]>
</script>
<script type='text/javascript'>
//<![CDATA[
function peekaboo_comments_display(data) {
var template = '';
function zeropad( n ){ return n>9 ? n : '0'+n; }
data.items.reverse();
for(i in data.items) {
if(!data.items[i].link) continue;
var tmp = data.items[i].link.split('#');
data.items[i].link = tmp.join('#c');
var dt = data.items[i].updated.match(/^(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)\.(\d+)([+-]\d+):(\d+)$/);
var time = new Date(parseInt(dt[1],10), parseInt(dt[2],10)-1 /*since January==0 in Date lingo*/, parseInt(dt[3],10), parseInt(dt[4],10), parseInt(dt[5],10), parseInt(dt[6],10), parseInt(dt[7],10)).getTime();
time = time + -(60*60*1000*parseInt(dt[8],10)) + -(60*1000*parseInt(dt[9],10));//adjust to GMT
time = time + -(60*1000*(new Date()).getTimezoneOffset());
time = new Date(time);
time = time.getFullYear() + '-' + zeropad(time.getMonth()+1) + '-' + zeropad(time.getDate()) + ' ' + zeropad(time.getHours()) + ':' + zeropad(time.getMinutes());
if(typeof(data.items[i].content) == 'undefined' !data.items[i].content) data.items[i].content = data.items[i].summary;
var out = comment_form_template;
out = out.replace(/\[\[PERMALINK\]\]/,data.items[i].link);
out = out.replace(/\[\[DATE\]\]/,time);
out = out.replace(/\[\[AUTHOR\]\]/,data.items[i].author.name);
out = out.replace(/\[\[BODY\]\]/,data.items[i].content);
document.write(out);
}//end for i in data
}//end if function peekaboo_comments_display
//]]>
</script>

<script type="text/javascript">
function toggleitem(postid,linkid,newtxt,displaytype) {
if(!displaytype) {displaytype = 'block';}
var whichpost = document.getElementById(postid);
if (whichpost.style.display != "none") {
whichpost.style.display = "none";
} else {
whichpost.style.display = displaytype;
}
if(linkid) {
var lnk = document.getElementById(linkid);
lnk.href = "javascript:toggleitem('"+postid+"','"+linkid+"','"+lnk.innerHTML+"');";
lnk.innerHTML = newtxt;
}
}//end function toggleitem
</script>

2.找到

<b:loop values='data:post.comments' var='comment'>
<dt class='comment-author' expr:id='"comment-" + data:comment.id'>

紧跟它之前添加以下代码:

<b:loop values='data:post.feedLinks' var='f'>
<b:if cond='data:blog.pageType != "item"'>
<script expr:src='"http://xoxotools.ning.com/outlineconvert.php?output=json&amp;amp;classes=items&amp;amp;url=" + data:f.url + "&callback=peekaboo_comments_display"' type='text/javascript'/>
</b:if>
</b:loop>

3.找到

<b:includable id='comments' var='post'>
<div class='comments' id='comments'>

将红色部分替换为下面部分:

<div class='comments' expr:id='"comments" + data:post.id'>
<b:if cond='data:blog.pageType != "item"'>
<script type='text/javascript'>
document.getElementById('comments<data:post.id/>').style.display = 'none';
</script>
</b:if>

4.找到

<b:if cond='data:blog.pageType == "item"'>
<b:if cond='data:post.allowComments'>
<b:include data='post' name='comments'/>
</b:if>
</b:if>

替换为:

<b:if cond='data:post.allowComments'>
<b:include data='post' name='comments'/>
</b:if>

5.找到

<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:if>

替换为:

<b:if cond='data:post.allowComments'>
<a class='comment-link' expr:href='data:post.url + "#comments"' expr:onclick='"toggleitem(&amp;quot;comments" + data:post.id + "&amp;quot;);return false;"'><b:if cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>
</b:if>

最后保存模板。

26 条评论:

匿名 说...

我怎么不显示评论的具体内容啊……晕

咖啡鱼 说...

因为页面没有加载完的原因。在JS中用到了一个来自xoxotools.ning.com的Php文件,加载速度有些慢,如果它没有加载完的话就不能显示出内容。

匿名 说...

汗死,原来是因为我把第二项的紧跟他之前看成紧跟他之后了……跑去看英文原文博客才发现……before.....

GG 说...

提醒下大家,可以在第三项的时候顺手把下面的
1 comment:等顺手汉化成~~

1 评论:

Unknown 说...

嘿,试一下这个
http://livetips.googlepages.com/runcode.html

Unknown 说...

不好意思阿,在ie7 中点这个
http://feeds.feedburner.com/eool

出来的并不是最新的文章:
如图:http://hi.baidu.com/ihai/album/Post/08c18ccbf14700fd52664fdc.html

咖啡鱼 说...

很正常,因为我昨晚上修改了那篇文章,所以它就是最新的

yunshanlau 说...

我照你说的做老但是还是没有效果呢?和以前的一样没有你说的那种效果,是怎么回事情呢?

匿名 说...

奇怪,这篇文章的评论超过9个就不显示了?

匿名 说...

跟你说一声哈,你这个布局在IE里面显示不正常,侧边栏下沉到底部了。

咖啡鱼 说...

你用的IE6吧,鱼用的IE7,所以没发现,现在应该好了,是一个链接太长了,把侧边栏挤下去了

匿名 说...

报告一下bug。
点击older pages浏览的时候,评论默认为展开状态,但显示不出来评论内容。
怎么能调整过来?

匿名 说...

的确有这个问题~~点击older pages浏览的时候,评论默认为展开状态,但显示不出来评论内容。
怎么解决啊???

GG 说...

还好,我的博客没有这个问题,因为点击older pages看的后面的帖子都被折叠了~~哈哈

巴黎2004 说...

没有看到效果!是不是还要等?

匿名 说...

wow gold site: wow goldwow goldwow gold

匿名 说...

预祝残奥会圆满成功: 地磅解码器混凝土输送泵隐形纱窗移动空调光端机玻璃瓶监控光端机广播级光端机除湿机

匿名 说...

Look here to Buy sell wow gold, 奥特莱斯,家纺招商

匿名 说...

十一结束,开始工作:皮带秤, google排名, 高温点火器, 徐州网站建设, seo, sem

匿名 说...

[url=http://www.ebuycs.com/catalog_30.html]商用榨汁机[/url]|[url=http://www.ebuycs.com/catalog_34.html]电导/pH表[/url]|[url=http://www.ebuycs.com/catalog_35.html]纯水机[/url]|[url=http://www.ebuycs.com/catalog_33.html]滴定器[/url]|[url=http://www.ebuycs.com/catalog_29.html]实验室通用仪器[/url]|[url=http://www.ebuycs.com/catalog_28.html]卫生监督与环境监测[/url]|[url=http://www.ebuycs.com/catalog_27.html]水质分析[/url]|[url=http://www.ebuycs.com/catalog_26.html]微生物产品[/url]|[url=http://www.ebuycs.com/catalog_25.html]数码望远镜|is70[/url]|[url=http://www.ebuycs.com/catalog_24.html]射线报警器[/url]|[url=http://www.ebuycs.com/catalog_23.html]移液器[/url]|[url=http://www.ebuycs.com/catalog_32.html]空气采样器[/url]|[url=http://www.ebuycs.com/catalog_31.html]必能信|超声波破碎仪[/url]|[url=http://www.ebuycs.com/catalog_22.html]必能信|超声波清洗机[/url]|[url=http://www.ebuycs.com/catalog_21.html]电缆定位仪[/url]|[url=http://www.ebuycs.com/catalog_20.html]红外成像仪[/url]|[url=http://www.ebuycs.com/catalog_19.html]手持金属探测器[/url]|[url=http://www.ebuycs.com/yeshiyi.html]夜视仪[/url]|[url=http://www.ebuycs.com/catalog_17.html]望远镜[/url]|[url=http://www.ebuycs.com/catalog_16.html]稳像望远镜[/url]|[url=http://www.ebuycs.com/catalog_15.html]手持GPS[/url]|[url=http://www.ebuycs.com/catalog_14.html]雷达测速仪[/url]|[url=http://www.ebuycs.com/catalog_13.html]酒精检测仪[/url]|[url=http://www.ebuycs.com/catalog_12.html]色谱柱[/url]|[url=http://www.ebuycs.com/catalog_11.html]探伤仪[/url]|[url=http://www.ebuycs.com/catalog_10.html]粗糙度仪[/url]|[url=http://www.ebuycs.com/catalog_9.html]硬度计[/url]|[url=http://www.ebuycs.com/catalog_8.html]测厚仪[/url]|[url=http://www.ebuycs.com/spy.html]水平仪[/url]|[url=http://www.ebuycs.com/catalog_7.html]水准仪[/url]|[url=http://www.ebuycs.com/catalog_6.html]木材水分测试仪[/url]|[url=http://www.ebuycs.com/catalog_5.html]防爆照相机|防爆摄像机[/url]|[url=http://www.ebuycs.com/catalog_4.html]接地电阻测试仪[/url]|[url=http://www.ebuycs.com/jgbxy.html]激光标线仪[/url]|[url=http://www.ebuycs.com/catalog_3.html]钳形表[/url]|[url=http://www.ebuycs.com/cgq.html]测距传感器[/url]|[url=http://www.ebuycs.com/catalog_18.html]线缆测高仪|测高仪[/url]|[url=http://www.ebuycs.com/catalog_2.html]测距望远镜|激光测距仪|测距仪[/url]|[url=http://www.ebuycs.com/catalog_1.html]测温仪[/url]|
[url=http://www.googlsee.org/sfcsy.html]测距仪|激光测距仪[/url]|[url=http://www.googlsee.org/sfcsy.html]|测距传感器[/url]|[url=http://www.googlsee.org/sfcsy.html]|测距望远镜[/url]|[url=http://www.googlsee.org/sfcsy.html]|激光测高仪[/url]|[url=http://www.googlsee.org/sfcsy.html]|超声波测高仪|测高仪|线缆测高仪[/url]|[url=http://www.googlsee.org/sfcsy.html]|水准仪[/url]|[url=http://www.googlsee.org/sfcsy.html]水分测试仪[/url]|[url=http://www.googlsee.org/qxj.html]超声波清洗器[/url]|[url=http://www.googlsee.org/jstcq.html]手持金属探测器[/url]|[url=http://www.googlsee.org/jddzcsy.html]接地电阻测试仪[/url]|[url=http://www.googlsee.org/jwbx.html]降温背心[/url]|[url=http://www.googlsee.org/wyj.html]望远镜[/url]|[url=http://www.googlsee.org/smwyj.html]数码望远镜[/url]|[url=http://www.googlsee.org/wxwyj.html]稳像望远镜[/url]|[url=http://www.googlsee.org/ysy.html]夜视仪[/url]|[url=http://www.googlsee.org/jjjcy.html]酒精检测仪[/url]|[url=http://www.googlsee.org/ldcsy.html]测速仪[/url]|

匿名 说...

商用榨汁机|电导/pH表|纯水机|滴定器|实验室通用仪器|卫生监督与环境监测|水质分析|微生物产品|数码望远镜|is70|射线报警器|移液器|空气采样器|必能信|超声波破碎仪|必能信|超声波清洗机|电缆定位仪|红外成像仪|手持金属探测器|夜视仪|望远镜|稳像望远镜|手持GPS|雷达测速仪|酒精检测仪|色谱柱|探伤仪|粗糙度仪|硬度计|测厚仪|水平仪|水准仪|木材水分测试仪|防爆照相机|防爆摄像机|接地电阻测试仪|激光标线仪|钳形表|测距传感器|线缆测高仪|测高仪|测距望远镜|激光测距仪|测距仪|测温仪|
测距仪|激光测距仪||测距传感器||测距望远镜||激光测高仪||超声波测高仪|测高仪|线缆测高仪||水准仪|水分测试仪|超声波清洗器|手持金属探测器|接地电阻测试仪|降温背心|望远镜|数码望远镜|稳像望远镜|夜视仪|酒精检测仪|测速仪|

匿名 说...

buy cheap wow gold,wow power leveling.

Buy wow gold website: cheap wow gold,buy wow gold,world of warcraft gold,wow power leveling.

buy wow gold,cheap wow gold.

匿名 说...

[b]
[url=http://www.wynlawyer.cn/]深圳律师咨询[/url]-[url=http://www.wuchenwenyaqi.com/]变压器[/url]-[url=http://www.wuchenwenyaqi.com/cpzs.asp]稳压电源[/url]-[url=http://www.huaheng.com.cn]塑料桶[/url]-[url=http://www.bjsdtz.com/waiqiang.asp]外墙保温[/url]-[url=http://www.huaheng.com.cn]塑料制品[/url]-[url=http://bjxgy.com/]发电机出租[/url]-[url=http://nova.gd.cn/]牙齿美白[/url]-[url=http://www.altwels.com/AboutUs.asp]工作台[/url]-[url=http://www.altwels.com/AboutUs.asp]工具柜[/url]-[url=http://bjxgy.com/]发电机租赁[/url]-[url=http://www.chengs100.com/productshow.asp?id=45]负荷开关[/url]-[url=http://www.altwels.com/]搬运车[/url]-[url=http://www.altwels.com/]平台车[/url]-[url=http://www.altwells.com/]塑料托盘[/url]-[url=http://www.bjsfjj.com/zn/Product.asp?CID=1]无纺布袋[/url][/b]

匿名 说...

坏点包括3种:塑料制品亮点(白点)——始终白色,暗点——始终黑色(不亮),色点——变压器始终是某种特定颜色。现在稳压器多把色点也归到亮点里面,所外墙保温某些厂商的“无亮点”承诺,塑料托盘其实是指不含白点和色点。 【点距】每个液晶单元中心冷光牙齿到相邻液晶单元中心的距离。工具柜在最高分辨率下,液晶的点距就是工作台相邻像素间的距离。标准15寸液晶的塑料桶q点距都是0.297mm,17寸的是0.264mm,18寸的是0.28mm,19寸的是0.294mm,20寸的快速门是0.255mm。 【最佳分辨率】搬运车液晶的最佳分辨率就是最高分辨率,在这个分辨下,电动叉车每个液晶单元负责显示一个像素,平台车是最清楚的。各尺寸的深圳律师咨询液晶最佳分辨CPLD开发板标准15寸是1024×768,17寸-19寸均为1280×1024,20寸的是1600×1200。

Unknown 说...

有点难

匿名 说...

The biggest news wow gold was the tale of Karatechop. From Armory sleuthing, we discovered that he’d been one-shotting Ulduar thanks to a GM Item. Blizzard shut down his account and the accounts of most of his guild, and he talked to us about it. The debate on what he should have done rages on. Of course, if you’ve had your fill of Martin Fury, we have more for you to browse.These codes are region locked, so they’re only valid in North America. buy wow gold We’ll do what we can for you guys another time.



Despite the defeat medivh orc tribes, but still aion代练 have the advantage. When the army of orcs will win, one of the greatest orc chieftain of Greg, the perceived that began when they are in the draenor started in the spread of corruption in the tribe. His old friend from exile DuLongTan come back again to the land, he revealed iggulden of treason. The killer iggulden soon assassinated DuLongTan family left him, and the son of young. The DuLongTan don't know the name of the blood by a black, essien dellas, lieutenant's wow gold human and like a raise his slaves.

The young orc later became known as the great leader of the orcs.



Obama DuLongTan by Greg's death, he started to fall from the evil orc tribe save, finally he killed iggulden han, instead of the puppet black orc tribes became chief. In his governing the cheap wow gold orcs, ruthless to stormwind castle launched attacks. Ryan king badly underestimated the orc tribes, he watched helplessly as their kingdoms fall into the hands of the green skin. Finally, add luona - by orcs among wow gold 5000 the shadow council which one killer assassination.

Lothar and his warriors from karaoke zan, hoping to reduce people back injuries and save their homes. However, they came back too late, they love into the kingdom has ruins. Orc tribes still to every inch of lothar, forced to hide themselves and his companions to set, heavy atallcosts regain their homes.


If you are looking for the Cheat to get Gold in World of Warcraft then this article will radically help you. You will learn a couple of secrets of cheap wow gold Cheat by reviewing this article. In world of warcraft, players get so addicted to the game that they very often look for shortcuts, to increase their gaming experience and joy. Some people chase for what is called ‘easy gold’ in wow, by using illegal activities. Gatherint illegal gold its not my forte, and if Blizzard catches you, you will 永恒之塔代练 be banned permanently.