Manyou诚邀开发者加盟 | 常见问题
《站长》“开发者特刊”限量赠送
立即免费下载 Discuz!6.1.0正式版
Discuz! 6.1.0使用说明 | 使用手册
Discuz!NT2.5正式版发布
开放源码下载 | 使用手册
Discuz!收费服务内容及价格
《站长》俱乐部各地聚会活动进行中
Discuz!/ECShop 专用官方虚拟主机
论坛游戏插件再开新区 助你在聚新人气
基于Discuz!的免费论坛空间5D6D
《站长》第八期:实战互联网开放平台
返回列表 回复 发帖

今天改进了一下cdb的统计功能,大家看看

http://gogo.52bx.net/gogo/misc.php?action=stats







[ 本贴由 cnteacher 于 2002-6-27 10:03 AM 最后编辑 ]
看了,不错。这个统计原来是XMB的代码,我也没怎么看。
不过平均贴数用COUNT找到总贴数,然后找到tid或pid最小的那个贴子的发贴时间,与现在时间相剪得到时间,然后相除应该可以
Comsenz President & CEO
短消息太多 无暇一一回复 有事请联系相关负责人
为了您的问题及时解决 切勿发短消息给我

没事写写 Blog 想想看生活是多艰难的一件事情
不错可以提供下载吗?
天天在localhost上自娱自乐
多谢,我改改试试
txzwxm 于 2002-6-26 05:55 PM 写道:
不错可以提供下载吗?
下载什么,不会是论坛程序吧,我还没有升级到gold版

关于统计需要首先修改模版,然后改一下misc.php就行了


[ 本贴由 cnteacher 于 2002-6-26 05:58 PM 最后编辑 ]
misc.php我那里会改,可以把你的给我试试吗?
天天在localhost上自娱自乐

不错

一个作CDB插件的高手出现了!
观点总是容易过时,而事实永远不会陈旧
修改misc.php

//发贴排行
        $query = $db->query("SELECT username,postnum,status FROM $table_members  ORDER BY postnum desc LIMIT 0, 20");
        $toppost ="<table width=100% cellPadding=2 cellSpacing=2 >";
        while($topman = $db->fetch_array($query)) {
        $toppost .= "<tr><td>o <font color=red>".$topman[username]."</font>($topman[status])</td><td align=right>".$topman[postnum]." 贴</td></tr>";
        }
        $toppost .="</table>";
//积分排行
        $query = $db->query("SELECT username,credit,status FROM $table_members  ORDER BY credit desc LIMIT 0, 20");
        $topjifen ="<table width=100% cellPadding=2 cellSpacing=2 >";
        while($topman = $db->fetch_array($query)) {
        $topjifen .= "<tr><td>o <font color=red>".$topman[username]."</font>($topman[status])</td><td align=right>".$topman[credit]." 分</td></tr>";
        }
        $topjifen .="</table>";

//今日之星
        if($bestmember == '') {
                $bestmember = "无";
                $membesthtml = "<b>$bestmember</b>";
                $bestmemberpost = "0";
        } else {
               
                $query = $db->query("SELECT username,postnum,credit,status,customstatus,avatar FROM $table_members WHERE username='$bestmember'");
                $bestinfo=$db->fetch_array($query);
                if ($bestinfo[avatar] !="" ){
                $bestavatar = "<br><table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout: fixed\">\n<tr><td align=\"center\">".image($bestinfo[avatar])."</td></tr></table>";
                $membesthtml .=$bestavatar;}
                $membesthtml .= "<br>        <b>姓名:</b><a href=\"member.php?action=viewpro&member=".rawurlencode($bestmember)."\"><b>$bestmember</b></a><br>";
                $membesthtml .= "        <b>头衔:</b>$bestinfo[customstatus]<br>";
                $membesthtml .= "        <b>身份:</b>$bestinfo[status]<br>";
                $membesthtml .= "        <b>发贴:</b>$bestinfo[postnum]<br>";
                $membesthtml .= "        <b>积分:</b>$bestinfo[credit]<br>";
                $membesthtml .= "        <b>今日发贴:</b> $info[Total]<br>";
        }



[ 本贴由 cnteacher 于 2002-6-27 07:46 AM 最后编辑 ]
下面是模版misc_stats的全文

<br><br><table cellspacing="0" cellpadding="0" border="0" width="$tablewidth" align="center">
<tr><td bgcolor="$bordercolor">
<table border="0" cellspacing="$borderwidth" cellpadding="$tablespace" width="100%">
<tr><td class="header">论坛统计
</td></tr><tr bgcolor="$altbg2" class="tablerow"><td>
<div align=center><br><br>
<table width=90% cellPadding=0 cellSpacing=0 border=0><tr bgcolor=#bc9f79
height=30><td align=center><font color=white><b>家园今日之星</b></font><td align=center><font color=white><b>家园基本情况</b></font></tr>
<tr bgcolor=#FFFFFF>
<td width=50%>
$membesthtml
<td width=%50><br><b>目前家园共有:</b>
$forums 个论坛 ($forumsa 个有效) / $members 位会员 / $threads 篇主题 / $posts 篇贴子<br><br>
<b>最热门的论坛:</b>$popforum 共有 $pop[threads] 篇主题,$pop[posts]篇回复<br><br>
<b>论坛总体统计</b><br><br>
平均每人发帖:$mempost<br>
平均每个论坛贴数:$forumpost<br>
平均每个主题回复数:$threadreply<br>
平均每日贴数:$postsday<br>
平均每日新增会员数:$membersday<br>
发贴会员百分比:$mapercent<br><br>

</tr>
</table>
<br><br>

<table width=90% cellPadding=0 cellSpacing=0 ><tr bgcolor=#bc9f79
height=30><th><font color=white>家园积分冠军榜</font><th bgcolor=#fbedd8>&nbsp<th><font color=white>家园发贴冠军榜</font></tr>
<tr bgcolor=#FFFFFF>
<td width=45%>
$topjifen<td width=10% bgcolor=#fbedd8><td width=%45>$toppost</tr>
</table>
<br><br>

<table width=90% cellPadding=0 cellSpacing=0 ><tr bgcolor=#bc9f79
height=30><th><font color=white>最受欢迎的文章</font><th bgcolor=#fbedd8>&nbsp<th><font color=white>最有号召力的文章</font></tr>
<tr bgcolor=#FFFFFF>
<td width=45%>
$viewmost<td width=10% bgcolor=#fbedd8><td width=%45>$replymost</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
我的版本是 final版
返回列表