Diễn đàn Trái Tim Yên Bái 2024

 Quên mật khẩu
 Đăng ký
Xem: 1977|Trả lời: 4
Thu gọn cột thông tin

[Mod Discuz] Discuz 7.0 Mod Online ảo

[Lấy địa chỉ]
  • Tâm trạng hàng ngày
    Suy ngẫm
    22-4-2024 05:18 PM
  • Đã viết: 4 ngày

    [LV.2]Spam 2

    Đăng lúc 18-1-2009 01:07 PM | Xem tất |Chế độ đọc

    Mời bạn đăng ký để giao lưu kết bạn nhé <3

    Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký

    x
    Mở  DISCUZ_ROOT/index.php tìm
    1. include template('discuz');
    Sao chép mã

    thêm dưới
    1. //เริ่มตัวจำลองผี START

    2. $virtualhack = '0';                 // 1=mo 0=tat

    3. if($virtualhack=='1') {

    4.     $mintime = 500;                // เวลาออนไลน์น้อยสุด (วินาที)
    5.     $maxtime = 800;                // เวลาออนไลน์มากสุด (วินาที)
    6.     $dis_time = 810;               // มากกว่า dis_time (วินาที) จะลบออก

    7.     $current_user = 200;             // จำนวนสมาชิกบัจจุบัน ปกติใส่ 10 ขึ้นไปหากต้องการให้สร้างผี

    8.     $min_user = 20;                // กำหนดจำนวนสมาชิกที่เพิ่มขึ้นขั่นต่ำ
    9.     $max_user = 100;                // กำหนดจำนวนสมาชิกที่เพิ่มขึ้นสูงสุด

    10.     $min_guest = 50;                // กำหนดจำนวนผู้เข้าชมที่เพิ่มขึ้นขั่นต่ำ
    11.     $max_guest = 80;                // กำหนดจำนวนผู้เข้าชมที่เพิ่มขึ้นสูงสุด

    12.     $start_uid = 2;             //  เริ่มตั้งแต่ UID
    13.     $end_uid = 180;            //  สิ้นสุด UID
    14.    
    15.     $action_arr = array("0","0","1","1","2","191","1","2","2","2","31","51"); //กำหนดการกระทำที่ผีทำได้

    16.     $current = time();
    17.     $current_different = $current - $dis_time;

    18.     $db -> query("DELETE FROM {$tablepre}sessions WHERE ip1='000' AND lastactivity <='$current_different'");

    19.     $query = $db -> query("SELECT COUNT(*) FROM {$tablepre}sessions ");
    20.     $onlineuser = $db -> result($query, 0);

    21.     if($onlineuser <= $current_user ) {

    22.         $randguest = mt_rand($min_guest, $max_guest); //ผู้เข้าชม
    23.         $randuser = mt_rand($min_user, $max_user);    //สมาชิก

    24.         $query = $db -> query("SELECT fid FROM {$tablepre}forums WHERE type = 'forum'");
    25.         while($fidresult = $db -> fetch_array($query)) {
    26.             $fidscope[] = $fidresult['fid'];
    27.         }

    28. //  สุ่มสมาชิกที่ออนไลน์
    29.         for($i = 1; $i <= $randuser; $i++) {

    30.             $randtime = mt_rand($mintime, $maxtime);
    31.             $onlinetime = $current - $randtime;

    32.             $randaction = mt_rand(0, count($action_arr));
    33.             $onlineaction = $action_arr[$randaction];

    34.             $onlinefid = 0;
    35.             if($onlineaction == '2') {
    36.                 $randfid = mt_rand(0, count($fidscope));
    37.                 $onlinefid = $fidscope[$randfid];
    38.             }
    39.             $online_sid = random(6);   
    40.             

    41.             $rand_uid = mt_rand($start_uid, $end_uid);
    42.             $query = $db -> query("SELECT `uid`,`username` FROM {$tablepre}members WHERE `uid` = '$rand_uid'");
    43.             while($row = $db -> fetch_array($query)){
    44.                 $db -> query("INSERT INTO {$tablepre}sessions (sid,ip1, groupid, styleid, lastactivity, action, fid, uid, username )
    45.                 VALUES ('$online_sid','000' ,'10', '1','$onlinetime','$onlineaction','$onlinefid','$row[uid]','$row[username]')");
    46.             }
    47.         }

    48. //  สุ่มผู้เข้าชมออนไลน์
    49.         for($i = 1; $i <= $randguest; $i++) {
    50.             $randtime = mt_rand($mintime, $maxtime);
    51.             $onlinetime = $current - $randtime;

    52.             $randaction = mt_rand(0,count($action_arr));
    53.             $onlineaction = $action_arr[$randaction];

    54.             $onlinefid = 0;
    55.             if($onlineaction == '2') {
    56.                 $randfid = mt_rand(0,count($fidscope));
    57.                 $onlinefid = $fidscope[$randfid];
    58.             }
    59.             $online_sid = random(6);
    60.             $db -> query("INSERT INTO {$tablepre}sessions (sid,ip1, groupid, styleid, lastactivity, action, fid )
    61.                 VALUES ('$online_sid','000' ,'7', '1','$onlinetime','$onlineaction','$onlinefid')");
    62.         }


    63.     }
    64. }

    65. //จบการจำลองผี END
    Sao chép mã

    Đăng lúc 19-1-2009 10:51 PM | Xem tất
    Lổi rồi ... check lại đoạn code bác ới !! hicihihc
  • Tâm trạng hàng ngày
    Hạnh phúc
    2-7-2025 09:43 PM
  • Đã viết: 13 ngày

    [LV.3]Spam 3

    Đăng lúc 19-1-2009 11:51 PM | Xem tất
    chưa có time test mà sr thử sau nhé
    Đăng lúc 12-4-2009 12:29 AM | Xem tất
    Nhưng mà nghĩa là gì ? online ảo là sao
    Đăng lúc 23-5-2010 02:52 PM | Xem tất
    Tạo số  lượng trực tuyến ảo trên diễn đàn ấy bác...
    Bạn phải đăng nhập mới được đăng bài Đăng nhập | Đăng ký

    Quy tắc điểm

    Đóng

    Thông báoTrước /1 Sau

    Phòng tối|Lưu trữ|Diễn đàn Yên Bái 2024 Community Guidelines |

    GMT+7, 6-12-2026 09:15 AM , Processed in 0.033406 second(s), 22 queries .

    Powered by Discuz! X3.4

    © 2001-2013 Comsenz Inc.

    Trả lời nhanh Lên trên Trở lại danh sách