- เครดิต
- 246
- เพื่อน
- ทักทาย
- บล็อก
- อัลบั้ม
- โพสต์
- กระทู้
- แชร์
- สำคัญ
- สิทธิ์อ่าน
- 20
- จำนวนผู้ติดตาม
- จำนวนผู้กำลังติดตาม
- เพศ
- ไม่บอก
|
nasz
โพสต์ 2009-1-14 12:26:54
- // Virtual online Member + visitors START
- $ virtualhack ='1 '; // 1 = Open 0 = Close
- if ($ virtualhack =='1 ') (
- $ mintime = 500; // online minimum (seconds)
- $ maxtime = 800; // online maximum (seconds)
- $ dis_time = 810; // more than dis_time (seconds) to delete
- $ current_user = 180; // the current user is less than 10, on the implementation of virtual users
- $ min_user = 20; // Set the number of members want to increase the minimum
- $ max_user = 100; // Set the number of members want to increase the maximum
- $ min_guest = 50; // Set the number of visitors would like to increase the minimum
- $ max_guest = 80; // Set the number of visitors would like to increase the maximum
- $ start_uid = 2; // Start Member UID
- $ end_uid = 600; // end of Member UID
- $ action_arr = array ( "0", "0", "1", "1", "2", "191", "1", "2", "2", "2", "31", " 51 "); // set of virtual users to allow actions
- $ 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); // visitors
- $ randuser = mt_rand ($ min_user, $ max_user); // Member
- $ query = $ db -> query ( "SELECT fid FROM ($ tablepre) forums WHERE type = 'forum'");
- while ($ fidresult = $ db -> fetch_array ($ query)) (
- $ fidscope [] = $ fidresult [ 'fid'];
- )
- // Random insertion online Member
- 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] ') ");
- )
- )
- // Random insertion online visitors
- 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')");
- )
- )
- )
- // Virtual online Member + visitors END
คัดลอกไปที่คลิปบอร์ด |
|