本帖最后由 saleroad 于 2009-5-5 10:24 编辑
这里给大家分享一个SS7.0添加顶踩的功能,演示地址:
内文页面http://www.365724.com/viewnews-45-page-1.html
评论页面http://www.365724.com/action-viewcomment-itemid-44.html
具体方法:
1、修改模板目录css下的common.css查找- #xspace-rates { text-align:center; height:50px; padding:20px 0; border-bottom:none; margin-bottom:0; }
- #xspace-rates-bg { width:210px; height:30px; margin:0 auto 5px; background:url(../../../images/base/rate_star.gif); }
- #xspace-rates-star { height:30px; background:url(../../../images/base/rate_star.gif) 0 -30px; margin:0 auto 0 0; }
- #xspace-rates-a { height:30px; margin-top:-30px; }
- #xspace-rates a { float:left; text-align:left; width:30px; height:30px; text-indent:-999px; overflow:hidden; background-color:transparent !important; }
- .xspace-rates-5 { width:30px; }
- .xspace-rates-3 { width:60px; }
- .xspace-rates-1 { width:90px; }
- .xspace-rates0 { width:120px; }
- .xspace-rates1 { width:150px; }
- .xspace-rates3 { width:180px; }
- .xspace-rates5 { width:210px; }
复制代码 替换为- #xspace-rates { text-align: center; background: #FFF; padding: 10px 0 20px 0; border-bottom: none; margin-bottom: 0; }
- #xspace-rates-bg { width: 320px; /*background: url(../../../images/base/rate_star.gif);*/ }
- #xspace-rates-star { }
- #xspace-rates-a { }
- #xspace-rates a { float: left; text-align: center; width: 60px; height: 67px; margin:0 10px; overflow: hidden; }
- /* .xspace-rates-5 { width: 30px; }
- .xspace-rates-3 { width: 60px; }
- .xspace-rates-1 { width: 90px; }
- .xspace-rates0 { width: 120px; }
- .xspace-rates1 { width: 150px; }
- .xspace-rates3 { width: 180px; }
- .xspace-rates5 { width: 210px; }*/
复制代码 2、在css文件的最底部添加- a.newbtn {position:relative;font-size:120px;}
- a.newbtn .pos_1{position:absolute;top:2px;left:18px;}
- a.newbtn .pos_2{position:absolute;top:27px;left:0px; width:60px;height:15px;text-align:center;font-size:12px;line-height:normal;}
- a.newbtn .pos_3{position:absolute;top:17px;left:0px; width:60px;height:15px;text-align:center;font-size:12px;line-height:normal;}
- a.newbtn:link, a.newbtn:visited, a.newbtn:hover, a.newbtn:active {text-decoration:none;}
- a.newbtn_box1{color:#F00;}
- a.newbtn_box2{color:#360;}
复制代码 3、修改news_view.html.php
查找- <div class="block" id="xspace-rates">
- <div id="xspace-rates-bg">
- <div id="xspace-rates-star" class="xspace-rates0"> </div>
- <div id="xspace-rates-a">
- <a href="javascript:;" onmouseover="rateHover(-5);" onmouseout="rateOut();" onclick="setRateXML('-5', '$news[itemid]');">-5</a>
- <a href="javascript:;" onmouseover="rateHover(-3);" onmouseout="rateOut();" onclick="setRateXML('-3', '$news[itemid]');">-3</a>
- <a href="javascript:;" onmouseover="rateHover(-1);" onmouseout="rateOut();" onclick="setRateXML('-1', '$news[itemid]');">-1</a>
- <a href="javascript:;" onmouseover="rateHover(0);" onmouseout="rateOut();" onclick="setRateXML('0', '$news[itemid]');">-</a>
- <a href="javascript:;" onmouseover="rateHover(1);" onmouseout="rateOut();" onclick="setRateXML('1', '$news[itemid]');">+1</a>
- <a href="javascript:;" onmouseover="rateHover(3);" onmouseout="rateOut();" onclick="setRateXML('3', '$news[itemid]');">+3</a>
- <a href="javascript:;" onmouseover="rateHover(5);" onmouseout="rateOut();" onclick="setRateXML('5', '$news[itemid]');">+5</a>
- </div>
- <input type="hidden" id="xspace-rates-value" name="rates" value="0" />
- </div>
- <p>评分:<span id="xspace-rates-tip">0</span></p>
- </div>
复制代码 修改为- <div id="xspace-rates" class="block">
- <div id="xspace-rates-bg">
- <div id="xspace-rates-star" class="xspace-rates0"> </div>
- <div id="xspace-rates-a">
- <a href="#action/viewcomment/itemid/$news[itemid]#" ><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topic_act_1.gif" width="60" height="67" alt="我要发言" /></a>
- <a href="javascript:;" class="newbtn newbtn_box2" onmouseover="rateHover(-1);" onmouseout="rateOut();" onclick="setRateXML('-1', '$news[itemid]');"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topac_cai.gif" width="60" height="67" style="cursor: pointer;" /><div class="pos_1"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/cai.gif" width="21" height="21" style="cursor: pointer;" /></div><div class="pos_2" id="topac_cai_shower">$news[badrate]次</div></a>
- <a href="javascript:;" class="newbtn newbtn_box1" onmouseover="rateHover(1);" onmouseout="rateOut();" onclick="setRateXML('1', '$news[itemid]');"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topac_ding.gif" width="60" height="67" style="cursor: pointer;" /><div class="pos_1"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/ting.gif" width="21" height="21" style="cursor: pointer;" /></div><div class="pos_2" id="topac_ding_shower">$news[goodrate]次</div></a>
- <a href="{S_URL}/"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topic_act_3.gif" width="60" height="67" alt="返回首页" /></a>
- </div>
- <input type="hidden" id="xspace-rates-value" name="rates" value="0" />
- </div>
- <p style="display:none;">评分:<span id="xspace-rates-tip">0</span></p>
- </div>
复制代码 4、把附件上传到css目录下即可
ding.rar
(7.84 KB, 下载次数: 289)
5、修改news_viewcomment.html.php
查找- <div class="block" id="xspace-rates">
- <div id="xspace-rates" class="block">
- <div id="xspace-rates-bg">
- <div id="xspace-rates-star" class="xspace-rates0"> </div>
- <div id="xspace-rates-a">
- <a href="javascript:;" onmouseover="rateHover(-5);" onmouseout="rateOut();" onclick="setRateXML('-5', '$news[itemid]');">-5</a>
- <a href="javascript:;" onmouseover="rateHover(-3);" onmouseout="rateOut();" onclick="setRateXML('-3', '$news[itemid]');">-3</a>
- <a href="javascript:;" onmouseover="rateHover(-1);" onmouseout="rateOut();" onclick="setRateXML('-1', '$news[itemid]');">-1</a>
- <a href="javascript:;" onmouseover="rateHover(0);" onmouseout="rateOut();" onclick="setRateXML('0', '$news[itemid]');">-</a>
- <a href="javascript:;" onmouseover="rateHover(1);" onmouseout="rateOut();" onclick="setRateXML('1', '$news[itemid]');">+1</a>
- <a href="javascript:;" onmouseover="rateHover(3);" onmouseout="rateOut();" onclick="setRateXML('3', '$news[itemid]');">+3</a>
- <a href="javascript:;" onmouseover="rateHover(5);" onmouseout="rateOut();" onclick="setRateXML('5', '$news[itemid]');">+5</a>
- </div>
- <input type="hidden" id="xspace-rates-value" name="rates" value="0" />
- </div>
- <p>评分:<span id="xspace-rates-tip">0</span></p>
- </div>
- </div>
复制代码 修改为- <div id="xspace-rates" class="block">
- <div id="xspace-rates-bg">
- <div id="xspace-rates-star" class="xspace-rates0"> </div>
- <div id="xspace-rates-a">
- <a href="#action/viewcomment/itemid/$news[itemid]#" ><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topic_act_1.gif" width="60" height="67" alt="我要发言" /></a>
- <a href="javascript:;" class="newbtn newbtn_box2" onmouseover="rateHover(-1);" onmouseout="rateOut();" onclick="setRateXML('-1', '$item[itemid]');"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topac_cai.gif" width="60" height="67" style="cursor: pointer;" /><div class="pos_1"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/cai.gif" width="21" height="21" style="cursor: pointer;" /></div><div class="pos_2" id="topac_cai_shower">$item[badrate]次</div></a>
- <a href="javascript:;" class="newbtn newbtn_box1" onmouseover="rateHover(1);" onmouseout="rateOut();" onclick="setRateXML('1', '$item[itemid]');"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topac_ding.gif" width="60" height="67" style="cursor: pointer;" /><div class="pos_1"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/ting.gif" width="21" height="21" style="cursor: pointer;" /></div><div class="pos_2" id="topac_ding_shower">$item[goodrate]
- </div></a>
- <a href="{S_URL}/"><img src="{S_URL}/templates/$_SCONFIG[template]/css/ding/topic_act_3.gif" width="60" height="67" alt="返回首页" /></a>
- </div>
- <input type="hidden" id="xspace-rates-value" name="rates" value="0" />
- </div>
- <p style="display:none;">评分:<span id="xspace-rates-tip">0</span></p>
- </div>
复制代码 6、如果你用的模板不是默认的,请对照修改即可。
对于3楼的问题,是我把第5步遗忘的原因,抱歉。
演示如下:
|