2 removals
3 additions
1.function online() { 1.function online() {
2.
2. global $prefix, $db, $name, $board_config, $userinfo, $identify; 3. global $prefix, $db, $name, $board_config, $userinfo, $identify;
3. 4.
4. $ip = $identify->get_ip(); 5. $ip = $identify->get_ip();
5. $url = (defined('ADMIN_FILE')) ? 'index.php' : Fix_Quotes($_SERVER['REQUEST_URI']); 6. $url = (defined('ADMIN_FILE')) ? 'index.php' : Fix_Quotes($_SERVER['REQUEST_URI']);
6. $uname = $ip; 7. $uname = $ip;
7. $guest = 1; 8. $guest = 1;
8. $user_agent = $identify->identify_agent(); 9. $user_agent = $identify->identify_agent();
9. if (is_user()) { 10. if (is_user()) {
10. $uname = $userinfo['username']; 11. $uname = $userinfo['username'];
11. $guest = 0; 12. $guest = 0;
12./*****[BEGIN]****************************************** 13./*****[BEGIN]******************************************
13. [ Base: Advanced Security Extension v1.0.0 ] 14. [ Base: Advanced Security Extension v1.0.0 ]
14. ******************************************************/ 15. ******************************************************/
15. } elseif($user_agent['engine'] == 'bot') { 16. } elseif($user_agent['engine'] == 'bot') {
16. $uname = $user_agent['bot']; 17. $uname = $user_agent['bot'];
17. $guest = 3; 18. $guest = 3;
18. } 19. }
19./*****[END]******************************************** 20./*****[END]********************************************
20. [ Base: Advanced Security Extension v1.0.0 ] 21. [ Base: Advanced Security Extension v1.0.0 ]
21. ******************************************************/ 22. ******************************************************/
22. $custom_title = $name; 23. $custom_title = $name;
23. $url = str_replace("&", "&", $url); 24. $url = str_replace("&", "&", $url);
24. $past = time()-$board_config['online_time']; 25. $past = time() - $board_config['online_time'];
25. $db->sql_query('DELETE FROM '.$prefix.'_session WHERE time < "'.$past.'"'); 26. $db->sql_query('DELETE FROM '.$prefix.'_session WHERE time < "'.$past.'"');
26. $ctime = time(); 27. $ctime = time();
27. list($count) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_session WHERE uname='$uname' OR host_addr='$ip'"); 28. list($count) = $db->sql_ufetchrow("SELECT COUNT(*) FROM ".$prefix."_session WHERE uname='$uname' OR host_addr='$ip'");
28. if ($count >= 1) { 29. if ($count >= 1) {
29. $result = $db->sql_query('UPDATE '.$prefix.'_session SET uname="'.$uname.'", time="'.$ctime.'", guest="'.$guest.'", module="'.$custom_title.'", url="'.$url.'" WHERE host_addr="'.$ip.'"'); 30. $result = $db->sql_query('UPDATE '.$prefix.'_session SET time="'.$ctime.'", guest="'.$guest.'", module="'.$custom_title.'", url="'.$url.'" WHERE uname="'.$uname.'" OR host_addr="'.$ip.'"');
30. $db->sql_freeresult($result); 31. $db->sql_freeresult($result);
31. } else { 32. } else {
32. $db->sql_query('INSERT INTO '.$prefix.'_session (uname, time, starttime, host_addr, guest, module, url) VALUES ("'.$uname.'", "'.$ctime.'", "'.$ctime.'", "'.$ip.'", "'.$guest.'","'.$custom_title.'", "'.$url.'")'); 33. $db->sql_query('INSERT INTO '.$prefix.'_session (uname, time, starttime, host_addr, guest, module, url) VALUES ("'.$uname.'", "'.$ctime.'", "'.$ctime.'", "'.$ip.'", "'.$guest.'","'.$custom_title.'", "'.$url.'")');
33. } 34. }
34.}35.}
original text
changed text