今天灵丹问起如何修改ZBLOG的TAG页面.默认的TAG页面确实很糟糕,里面的TAG顺序显示出来,自动换行,大小不一,总之就是很乱.我以前也想要改改,可是懒啊,现在人家求来了,正好借这个机会做掉它.
修改方法很简单,找到根目录下的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% >"
dim i '循环记数器
i=0
dim rowcount '每行显示几个标签
rowcount=3
For Each Tag in Tags
If IsObject(Tag) Then
if i=0 then
strTagCloud=strTagCloud &"<tr height=22>"
end if
strTagCloud=strTagCloud & "<td><span style='font-family:verdana,sans-serif;font-size:12px;line-height:150%;margin:10px;'><a title='这个标签下有 " & 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>"
效果见http://www.busfly.cn/tags.asp
当然,你最好自己改一下样式,使得看起来更漂亮
Tags: Zblog |
原创文章如转载,请注明:转载自:巴士飞扬-技术BLOG : http://www.busfly.net/
本文链接地址:http://www.busfly.net/post/zblog-tags-modfile.html
如果你喜欢本文,请顶一下,支持我,你的支持是我继续发好文章的最大动力。谢谢。
好东西需要分享,快把本文发给你的朋友吧~!~