分享,收藏,评分,复制,道具贴内合一美化版
[i=s] 本帖最後由 无界 於 2014-6-2 16:11 編輯 [/i]这个代码早就有了,是discuz官方某个大神作品,前几天看到sclub论坛有会员咨询,特意找出来整理一下拿出来与大家共享!sclub测试使用正常。
先看截图:
[attach]25931[/attach]
[attach]25932[/attach]
修改方法:
一、编辑[color=red][b]viewthread_node.htm[/b][/color]模板
[color=darkred]1、找到代码
[/color][code]{$pluginhooks[viewthread_postbottom][$postcount]}[/code][color=red]和[/color][code]<div id="post_rate_div_$post[pid]"></div>[/code]将这两句中间代码([color=red]是中间代码哦,不包括这两句[/color]),替换为:[code]<!--{if !empty($post['ratelog'])}-->
<style type="text/css">
/* 贴子评分 */
.rate_main{width:700px;border:1px solid #D0D0BF;background:#F8F8F8;margin-top:20px;padding:10px}
.rate_main h5{height:30px;font-size:12px;}
.rate_list{width:100%}
.rate_list li{ width:100%; height:20px; line-height:20px; padding:2px 0}
.rate_list li:hover{ background:#f2f2f2}
.rate_user{float:left; width:120px;}
.rate_user img{border:1px solid #ccc; padding:1px;vertical-align: middle;width:20px;height:20px;}
.rate_cent{float:left; width:200px;}
.rate_cent img{padding:2px;vertical-align: middle;}
.rate_cent strong{padding-right:5px}
.rate_msg{float:right; width:380px; margin-top:5px}
.rate_msg em{font-size:10px; float:right}
.rate_total{padding:5px 0 0 0; border-top:1px solid #ccc; margin-top:10px }
.rate_option{ float:right;}
/* 贴子评分结束 */
</style>
<div class="rate_main">
<h5>评分记录</h5>
<ul class="rate_list">
<!--{loop $post['ratelog'] $uid $ratelog}-->
<li>
<div class="rate_user">
<a href="space.php?uid=$uid" target="_blank">{echo discuz_uc_avatar($uid, 'small');}</a> <a href="space.php?uid=$uid" target="_blank">$ratelog[username]</a>
</div>
<div class="rate_cent">
<!--{loop $ratelog['score'] $id $score}-->
<!--{if $score > 0}-->
<img src="http://tlb.look.in/zg/_agree.gif" alt="" /><em><font color="#ff6600">{$extcredits[$id][title]} + $score $extcredits[$id][unit]</font></em>
<!--{else}-->
<img src="http://tlb.look.in/zg/_disagree.gif" alt="" /><em><font color="#62910A">{$extcredits[$id][title]} $score $extcredits[$id][unit]</font></em>
<!--{/if}-->
<!--{/loop}-->
</div>
<div class="rate_msg">
<em>$ratelog[dateline]</em>$ratelog[reason]
</div>
</li>
<!--{/loop}-->
</ul>
<div class="rate_total">
<span class="rate_option">
<a href="misc.php?action=viewratings&tid=$tid&pid=$post[pid]" onclick="showWindow('viewratings', this.href);return false;" title="{lang thread_rate_log_lately}">查看评分记录</a>
</span>
总计:<strong><a href="misc.php?action=viewratings&tid=$tid&pid=$post[pid]" onclick="showWindow('viewratings', this.href);return false;" title="{lang thread_rate_log_lately}">{echo count($postlist[$post[pid]][totalrate]);}</a></strong> 人评分 共 <strong>{echo $postlist[$post[pid]][rate];}</strong> 积分
</div>
</div>
<!--{else}-->[/code]2、[color=darkred]再找到[/color][code]<div class="useraction{if $allowrecommend && $recommendthread[status]} nrate{/if}">[/code]在这段[color=red]下[/color]面加上[code]<!--// 帖子复制地址代码开始 -->
<!--{if $post['number'] == 1}-->
<script language="JavaScript">
<!--
function copyUrl(url){
var content='';
window.clipboardData.setData("Text",url);
alert("复制成功,您可以用Ctrl+V粘贴到你的QQ/MSN上推荐给你的好友");
}//-->
</script>
<br>
<a id="tuijian" href="javascript:copyUrl('$post[subject]\n{$boardurl}thread-$tid-1-1.html')">复制</a></font>
<!--{/if}-->
<!--// 帖子复制地址代码结束 -->
<!-- // 道具代码开始 -->
<a id="daoju" a href="magic.php?action=getmagic&fid=$fid&pid=$post[pid]" id="usermagicopt$post[pid]" class="dropmenu">道具</a>
<!-- // 道具代码结束 -->[/code]3、然后找到[code]<a href="javascript:;" id="share" onclick="showDialog($('sharewin').innerHTML, 'info', '{lang thread_share}')">{lang thread_share}</a>[/code]在[color=red]下[/color]面加[code]<!--// 评分代码开始 -->
<a id="biaoyang" {if $discuz_uid} onclick="showWindow('rate', this.href);return false;" href="misc.php?action=rate&tid=$tid&pid=$post[pid]"{else}href="logging.php?action=login"{/if}>{lang rate}</a>
<!--// 评分代码结束 -->[/code][color=blue]修改viewthread_node.htm结束,提交。[/color]
[b][color=red]二、编辑[/color][color=red]css_script.htm[/color][/b]
1、找到[code].useraction #share { background-position: 0 -50px; }[/code]在[color=red]下[/color]面加[code].useraction #tuijian { background-position: 0 -100px; }
.useraction #biaoyang { background-position: 0 -150px; }
.useraction #daoju { background-position: 0 -200px; }[/code]2、再找到**** Hidden Message *****
3、[color=Red]追加一条找到[/color][code].useraction { height: 50px; width: 110px; clear: both; display: block; margin: 20px auto; }[/code][color=Red][b][size=3]将默认宽度width: 110px;改为width: 300px;[/size][/b][/color]
[color=blue]修改完毕后提交,更新缓存完成。[/color]
[color=#0000ff][/color]
[color=#0000ff]预览地址:[url=http://tlb.258club.com/thread-2432-1-1.html]http://tlb.258club.com/thread-2432-1-1.html[/url][/color]
图片附件失效了,在这里补上。
[attach]36447[/attach] 謝謝樓主熱心分享 感谢LZ分享~ 我很喜欢{:16_1001:} 好复杂呀。 [b]回復 [url=http://sclub.com.tw/discuz/redirect.php?goto=findpost&pid=203764&ptid=26366]5#[/url] [i]pigeon[/i] [/b]
还好吧、没什么大的改动,基本都是添加。 谢。谢。分。享。 [b]回復 [url=http://www.sclub.com.tw/discuz/redirect.php?goto=findpost&pid=203772&ptid=26366]6#[/url] [i]无界[/i] [/b]
老大,%>_<%为什么按照你的提示改完了,论坛的帖子都打不开了?怎么办呀 能不能把被替换掉的之前的东西给贴上来呀,我做失败了,论坛帖子打不开了,我要还原回去怎么办呀 [b]回復 [url=http://sclub.com.tw/discuz/redirect.php?goto=findpost&pid=203776&ptid=26366]9#[/url] [i]pigeon[/i] [/b][code]<!--{if !empty($post['ratelog'])}-->
<dl class="newrate">
<dt>
<!--{if !empty($postlist[$post[pid]]['totalrate'])}-->
<strong><a href="misc.php?action=viewratings&tid=$tid&pid=$post[pid]" onclick="showWindow('viewratings', this.href);return false;" title="{lang thread_rate_log_lately}">{echo count($postlist[$post[pid]][totalrate]);}</a></strong>
<p>{lang thread_rate_count}</p>
<!--{/if}-->
</dt>
<dd>
<ul class="s_clear">
<div id="post_rate_$post[pid]"></div>
<!--{if $ratelogon}-->
<ul class="s_clear ratelist">
<!--{loop $post['ratelog'] $uid $ratelog}-->
<li id="rate_{$post[pid]}_{$uid}" class="ratelistavatar">
<a href="space.php?uid=$uid" target="_blank">{echo discuz_uc_avatar($uid, 'small');}</a><a href="space.php?uid=$uid" target="_blank">$ratelog[username]:</a>
$ratelog[reason]
<!--{loop $ratelog['score'] $id $score}-->
<!--{if $score > 0}-->
<em>{$extcredits[$id][title]} + $score $extcredits[$id][unit]</em>
<!--{else}-->
<span>{$extcredits[$id][title]} $score $extcredits[$id][unit]</span>
<!--{/if}-->
<!--{/loop}-->
</li>
<!--{/loop}-->
</ul>
<!--{else}-->
<!--{loop $post['ratelog'] $uid $ratelog}-->
<li>
<div id="rate_{$post[pid]}_{$uid}_menu" class="attach_popup" style="display: none;">
<p class="cornerlayger">$ratelog[reason]
<!--{loop $ratelog['score'] $id $score}-->
<!--{if $score > 0}-->
<em>{$extcredits[$id][title]} + $score $extcredits[$id][unit]</em>
<!--{else}-->
<span>{$extcredits[$id][title]} $score $extcredits[$id][unit]</span>
<!--{/if}-->
<!--{/loop}-->
</p>
<p class="minicorner"></p>
</div>
<p id="rate_{$post[pid]}_{$uid}" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" class="rateavatar"><a href="space.php?uid=$uid" target="_blank">{echo discuz_uc_avatar($uid, 'small');}</a></p>
<p><a href="space.php?uid=$uid" target="_blank">$ratelog[username]</a></p>
</li>
<!--{/loop}-->
<!--{/if}-->
</ul>
</dd>
</dl>
<!--{else}-->[/code] [b]回復 [url=http://sclub.com.tw/discuz/redirect.php?goto=findpost&pid=203774&ptid=26366]8#[/url] [i]pigeon[/i] [/b]
我看了你的论坛,可以打开呀 刚才对照了,有些错误改正了,可是下面的按钮排版不对呀,怎么修改呢?
[attach]25964[/attach] 蠻美觀的,加來看的。 [b]回復 [url=http://sclub.com.tw/discuz/redirect.php?goto=findpost&pid=203779&ptid=26366]12#[/url] [i]pigeon[/i] [/b]
打开css_script.htm 找到
.useraction { height: 50px; width: 110px; clear: both; display: block; margin: 20px 225px; }
把width: 110px; 改为width: 300px; 這個教學真不錯來學習看看謝謝教學 [b]回復 [url=http://www.sclub.com.tw/discuz/redirect.php?goto=findpost&pid=203781&ptid=26366]14#[/url] [i]无界[/i] [/b]
灰常感谢,已经好了,3Q 好了就ok 支持无界大叔 **** 作者被禁止或刪除 內容自動屏蔽 **** 真好看,谢谢
頁:
[1]
2