修正软件兔的Z-Blog插件:文章投票(打分) V1.4
安装方法:
1、点击下载, 解压把Rating文件夹放到Z-Blog的Plugin目录下
2、在Template文件夹下的模板single.html的</body>标签前插入以下脚本:
<Script language="javascript" type="text/javascript"src="<#ZC_BLOG_HOST#>LUGIN/Rating/Rating.js"></script>
3、修改Template文件夹下的模板b_article-single.html, 在适当位置(我是在TrackBack地址下方)插件以下标签:
<div id="RatingPre"></div>
4、在b_article-guestbook.html body里任意位置加一句<div id="RatingPre" style="display:none;"></div>,否则访问留言板会报错。
5、在CSS样式表中加入以下样式:
/*---------------------------------------------------------------*/
/* 定义 文章投票 */
/*---------------------------------------------------------------*/
#Rating {
text-align:left;
border:1px #B0BDC6 solid;
padding:10px;
margin: 0 0 10px 0;
overflow: auto;
_height: 1%;
}
#Star {
background-image: url(../../PLUGIN/Rating/star.gif);
height: 30px;
width: 150px;
float: left;
}
#Star-Cur {
background-image: url(../../PLUGIN/Rating/star.gif);
background-position: 0px -60px;
width: 0px;
position: absolute;
z-index: 11;
height: 30px;
}
#Star1 {
position: absolute;
z-index: 20;
height: 30px;
width: 30px;
}
#Star2 {
position: absolute;
z-index: 19;
height: 30px;
width: 60px;
}
#Star3 {
position: absolute;
z-index: 18;
height: 30px;
width: 90px;
}
#Star4 {
position: absolute;
z-index: 17;
height: 30px;
width: 120px;
}
#Star5 {
position: absolute;
z-index: 16;
height: 30px;
width: 150px;
}
#Star1:hover, #Star2:hover, #Star3:hover, #Star4:hover, #Star5:hover {
background-image: url(../../PLUGIN/Rating/star.gif);
background-position: -30px;
}
#Score {
line-height: 30px;
text-align: center;
float: left;
width: 250px;
}
#Rating-show{ /*文章得分及投票次数*/
width: 350px;
height: 45px;
}
#Rating-now{ /*正在投票,请稍候*/
color: #FF0000;
width: 350px;
height: 45px;
}
#Rating-Tanks { /*投票成功,感谢您的投票*/
color:Green;
font-weight: bold;
width: 350px;
height: 45px;
}
#Rating-already{ /*已投过票*/
color:red;
font-weight: bold;
width: 350px;
height: 45px;
}
#Rating-err{ /*遇到错误*/
color:red;
font-weight: bold;
width: 350px;
height: 45px;
}
#Rating-no{ /*当前尚无评分记录*/
width: 350px;
height: 45px;
}
/*---------------------------------------------------------------*/
/* 文章投票 */end
/*---------------------------------------------------------------*/
使用说明:
1、以上样式表中红色部分(星级图片的地址)可能需要手工改一下,或者直接用http:/www.yourblog.cn/PLUGIN/Rating/star.gif
2、"LUGIN/Rating/"这个文件夹要有写权限
3、投票的脚本Rating.js最好是加到</body>标签之前, 不要加到页面的头部. 如果网速慢或客户端浏览器是多线程的, 把脚本放到页头的话, 可能会造成显示不正常, 但放在页面尾部则不会有问题.