Board logo

标题: [BBShack] 个人资料发帖回帖数分别显示,各积分不同颜色显示 [打印本页]

作者: Phoenix001    时间: 2023-2-20 14:57     标题: 个人资料发帖回帖数分别显示,各积分不同颜色显示

【for D4.0】个人资料发帖回帖数分别显示,各积分不同颜色显示
https://discuz.dismall.com/thread-212001-1-1.html
(出处: Discuz免费开源建站系统)



.......................................................................................................................




演示:http://xxgarden.net/bbs/viewthread.php?tid=113658


一、发帖回帖数分开显示

1. 打开viewthread.php,查找

    $postlist[$post['pid']] = $post;

复制代码


在上面添加

    //---------------------------------发帖回帖分开显示
                    $topicquery = $db->query("SELECT tid FROM {$tablepre}threads WHERE author='$post[author]'");
                    $post[topicallnum] = $db->num_rows($topicquery);
                    $post[posts] = $post[posts] - $post[topicallnum];
                    $post[alls] = $post[posts] + $post[topicallnum];
    //---------------------------------

复制代码



2. 打开viewthread.htm,查找

    {lang posts} $post[posts]<br>

复制代码


替换为

    主题 $post[topicallnum]<br>
                回贴 $post[posts]<br>

复制代码




二、各后台扩展积分不同颜色显示

我只用笨办法,在后台积分设置中把积分在帖子中显示的勾去掉。

打开viewthread.htm,查找

    <!--{loop $extcredits_thread $key $credit}-->
                            $credit[title] $post[$key] $credit[unit]<br>
                    <!--{/loop}-->

复制代码


在上面添加


    <!--{if $post['extcredits1']}-->威望 <font color=#FF6633>$post[extcredits1]</font> <img src="images/weiwang.gif" border="0"><br><!--{/if}-->
                <!--{if $post['extcredits4']}-->银币 <font color=#AFAFAF>$post[extcredits4]</font> <img src="images/yinbi.gif" border="0"><br><!--{/if}-->
                <!--{if $post['extcredits5']}-->金币 <font color=#FF7C3E>$post[extcredits5]</font> <img src="images/jinbi.gif" border="0"><br><!--{/if}-->

复制代码


其中的 “extcredits1-威望” “extcredits4-银币”  “extcredits5-金币” 及颜色值根据你的情况来修改,如果你的积分设置多余上面的3个,可仿照添加。


修改完毕:)

[ 本帖最后由 whitegerry 于 2006-3-22 08:57 编辑 ]




欢迎光临 AS 锡安ZionTechExchange (http://cloud.caffz.com:12345/mud/AbyssalSwamp/index/) Powered by Discuz! 4.1.0