Changeset 2054 in ExiteCMS


Ignore:
Timestamp:
11/20/08 11:17:01 (3 years ago)
Author:
webmaster
Message:

fixed not correctly updating the online record for logged in users
do not record site access by known bots (they were counted as guests)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/user_functions.php

    r2044 r2054  
    207207} 
    208208 
    209 // update the last users online information for guests 
    210 if (iGUEST) { 
    211     $result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'"); 
    212     if (dbrows($result) != 0) { 
    213         $result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user='0' AND online_ip='".USER_IP."'"); 
    214     } else { 
    215         $result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('0', '".USER_IP."', '".time()."')"); 
    216     } 
    217 } 
    218 // update the last users online information for members 
    219 if (iMEMBER) { 
    220     $result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='".$userdata['user_id']."'"); 
    221     if (dbrows($result) != 0) { 
    222         $result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user='0' AND online_ip='".USER_IP."'"); 
    223     } else { 
    224         $result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('".$userdata['user_id']."', '".USER_IP."', '".time()."')"); 
     209if (!CMS_IS_BOT) { 
     210    if (iGUEST) { 
     211        // update the last users online information for guests 
     212        $result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'"); 
     213        if (dbrows($result) != 0) { 
     214            $result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user='0' AND online_ip='".USER_IP."'"); 
     215        } else { 
     216            $result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('0', '".USER_IP."', '".time()."')"); 
     217        } 
     218    } else { 
     219        // update the last users online information for members 
     220        $result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user='".$userdata['user_id']."'"); 
     221        if (dbrows($result) != 0) { 
     222            $result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user='".$userdata['user_id']."' AND online_ip='".USER_IP."'"); 
     223        } else { 
     224            $result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('".$userdata['user_id']."', '".USER_IP."', '".time()."')"); 
     225        } 
    225226    } 
    226227} 
Note: See TracChangeset for help on using the changeset viewer.