因为测试zblog1.8版,想把原来版本上的东西都调用过来,改到标签的时候发现自己已经忘记了是怎么改了,去官方论坛看了一下!收集到两个改法,一种是巴士飞扬技术博客的大小排列!一个是月木同学的颜色显示,自已整理收藏着。
1,如何让标签排所含文章的多少自动排列大小顺序,很多博客都是这样做的,像我原来的托管博客就有这个功能,个人觉得这个很方便,修改方法如下:
定位根目录下的tags.asp,找到下面这段,
dim tag
dim strtagcloud
for each tag in tags
if isobject(tag) then
strtagcloud=strtagcloud & "<span style='font-family:verdana,sans-serif;line-height:150%;font-size:"& 12 + (tag.count/2) &"px;margin:10px;'><a title='" & tag.count & "' alt='"& tag.count &"' href='" & tag.url &"'>" & tag.name & "</a></span>"
end if
next
替换成:
dim tag
dim strtagcloud
strtagcloud="<table width=100% border=0 cellpadding=0 cellspacing=0>"
dim i
i=0
dim rowcount
rowcount=4
for each tag in tags
if isobject(tag) then
if i=0 then
strtagcloud=strtagcloud &"<tr height='22'>"
end if
strtagcloud=strtagcloud & "<td height='20'><span style='line-height:15px;'><a title='" & tag.intro & "' alt='"& tag.count &"' href='" & tag.url &"'>" & tag.name & "-" & tag.count & "篇</a></span></td>"
if i=(rowcount-1) then
strtagcloud=strtagcloud &"</tr>"
end if
i=(i+1) mod rowcount
end if
next
if i<>0 then
strtagcloud=strtagcloud & "<td colspan=""" & rowcount-i & """> </td></tr>"
end if
strtagcloud=strtagcloud &"</table>"
简要说明:
rowcount=4表示列数,可以根据须要自行修改。
td和tr的height(高度)可以按自己需求自行调整。
title='" & tag.intro & "'为鼠标放到tag上的效果,默认的是标签所包含的文章数,这里设置成了标签说明。说明在在后台编辑标签写上才会有,标签数还是移出来直接显示了。
效果请见http://www.flymoonblog.cn/tags.asp
2,标签的颜色修改,让标签不仅有大小之分,还有颜色之别。个人认为实用性不够高,所以自已没有使用。方法如下:
同样是定位根目录下的tags.asp,找到下面这段:
dim tag
dim strtagcloud
for each tag in tags
if isobject(tag) then
strtagcloud=strtagcloud & "<span style='font-family:verdana,sans-serif;line-height:150%;font-size:"& 12 + (tag.count/2) &"px;margin:10px;'><a title='" & tag.count & "' alt='"& tag.count &"' href='" & tag.url &"'>" & tag.name & "</a></span> "
end if
next
修改成:
dim tag
dim strtagcloud
dim rndtmp
for each tag in tags
if isobject(tag) then
randomize
rndtmp=int(rnd*999)
strtagcloud=strtagcloud & "<a style=' color:#"&rndtmp&";font-size:"& 12 + (tag.count/2) &"px; margin:10px;' title='" & tag.count & "' alt='"& tag.count &"' href='" & tag.url &"'>" & tag.name & "</a>"
end if
next
以上在1.7版下测试成功!不知道1.8行不行~~如果大家有什么看法可以加以评论。
本文来源于飞月博客 http://www.flymoonblog.cn/blog/ , 原文地址:http://www.flymoonblog.cn/blog/post/294.html





