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
|
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
- include template('discuz');
Sao chép mã
thêm dưới
- //เริ่มตัวจำลองผี START
- $virtualhack = '0'; // 1=mo 0=tat
- if($virtualhack=='1') {
- $mintime = 500; // เวลาออนไลน์น้อยสุด (วินาที)
- $maxtime = 800; // เวลาออนไลน์มากสุด (วินาที)
- $dis_time = 810; // มากกว่า dis_time (วินาที) จะลบออก
- $current_user = 200; // จำนวนสมาชิกบัจจุบัน ปกติใส่ 10 ขึ้นไปหากต้องการให้สร้างผี
- $min_user = 20; // กำหนดจำนวนสมาชิกที่เพิ่มขึ้นขั่นต่ำ
- $max_user = 100; // กำหนดจำนวนสมาชิกที่เพิ่มขึ้นสูงสุด
- $min_guest = 50; // กำหนดจำนวนผู้เข้าชมที่เพิ่มขึ้นขั่นต่ำ
- $max_guest = 80; // กำหนดจำนวนผู้เข้าชมที่เพิ่มขึ้นสูงสุด
- $start_uid = 2; // เริ่มตั้งแต่ UID
- $end_uid = 180; // สิ้นสุด UID
-
- $action_arr = array("0","0","1","1","2","191","1","2","2","2","31","51"); //กำหนดการกระทำที่ผีทำได้
- $current = time();
- $current_different = $current - $dis_time;
- $db -> query("DELETE FROM {$tablepre}sessions WHERE ip1='000' AND lastactivity <='$current_different'");
- $query = $db -> query("SELECT COUNT(*) FROM {$tablepre}sessions ");
- $onlineuser = $db -> result($query, 0);
- if($onlineuser <= $current_user ) {
- $randguest = mt_rand($min_guest, $max_guest); //ผู้เข้าชม
- $randuser = mt_rand($min_user, $max_user); //สมาชิก
- $query = $db -> query("SELECT fid FROM {$tablepre}forums WHERE type = 'forum'");
- while($fidresult = $db -> fetch_array($query)) {
- $fidscope[] = $fidresult['fid'];
- }
- // สุ่มสมาชิกที่ออนไลน์
- for($i = 1; $i <= $randuser; $i++) {
- $randtime = mt_rand($mintime, $maxtime);
- $onlinetime = $current - $randtime;
- $randaction = mt_rand(0, count($action_arr));
- $onlineaction = $action_arr[$randaction];
- $onlinefid = 0;
- if($onlineaction == '2') {
- $randfid = mt_rand(0, count($fidscope));
- $onlinefid = $fidscope[$randfid];
- }
- $online_sid = random(6);
-
- $rand_uid = mt_rand($start_uid, $end_uid);
- $query = $db -> query("SELECT `uid`,`username` FROM {$tablepre}members WHERE `uid` = '$rand_uid'");
- while($row = $db -> fetch_array($query)){
- $db -> query("INSERT INTO {$tablepre}sessions (sid,ip1, groupid, styleid, lastactivity, action, fid, uid, username )
- VALUES ('$online_sid','000' ,'10', '1','$onlinetime','$onlineaction','$onlinefid','$row[uid]','$row[username]')");
- }
- }
- // สุ่มผู้เข้าชมออนไลน์
- for($i = 1; $i <= $randguest; $i++) {
- $randtime = mt_rand($mintime, $maxtime);
- $onlinetime = $current - $randtime;
- $randaction = mt_rand(0,count($action_arr));
- $onlineaction = $action_arr[$randaction];
- $onlinefid = 0;
- if($onlineaction == '2') {
- $randfid = mt_rand(0,count($fidscope));
- $onlinefid = $fidscope[$randfid];
- }
- $online_sid = random(6);
- $db -> query("INSERT INTO {$tablepre}sessions (sid,ip1, groupid, styleid, lastactivity, action, fid )
- VALUES ('$online_sid','000' ,'7', '1','$onlinetime','$onlineaction','$onlinefid')");
- }
- }
- }
- //จบการจำลองผี END
Sao chép mã
|
|