Share Code online ảo cho Johncms

D

dgtupltn95

New Member
Code online ảo cho Johncms

Phương pháp thủ công
chèn vào head
PHP:
mysql_query("UPDATE `users` SET $sql `total_on_site` = '$totalonsite', `lastdate` = ". time() . " WHERE `id` = 'XX'");
Với XX là ID củng Member muốn đặt Online ảo.

nếu muốn đặt online ảo cho 1 nhóm thành viên thì dùng code sau

PHP:
for ($i = XX; $i < YY; $i  )
{
mysql_query("UPDATE `users` SET $sql `total_on_site` = '$totalonsite', `lastdate` = " . time() . " WHERE `id` = '$i'");
}

Với XX là ID bắt đầu, YY là ID kết thúc
Ví dụ:
PHP:
for ($i = 1; $i < 20; $i  )
{
mysql_query("UPDATE `users` SET $sql `total_on_site` = '$totalonsite', `lastdate` = " . time() . " WHERE `id` = '$i'");
}

Như thế là mình đã đặt các thành viên online ảo có id từ 1 -19
Save and test
 
Thank for share nhưng ko cần phức tạp như thế chỉ cần chỉnh lại time onl là đc :D
 

Facebook Comments

Similar threads

Admin
Replies
1
Views
2K
blog4meblog4me is verified member.
blog4me
cuongpro9x
Replies
3
Views
5K
giangdance
G
blog4me
2
Replies
28
Views
22K
moon2s
moon2s
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Back
Top