https://www.icyphoenix.com/viewtopic.php?f=35&t=674&p=6925#p6925
-----------------------------------
Frost
Wed 10 Jan, 2007 20:51

Re: Ezstats Mod
-----------------------------------
Hi, try this and let me know

Open:

includes/ezstats.php

Find:

[code linenumbers=false]
// If IP exists, do update. Else, do insert.
//
if ( $row = $db->sql_fetchrow($result) )
{
   $sql = "UPDATE " . EZSTATS_TABLE . "
      SET stamp = " . time () . ",
         user_id = " . $userdata['user_id'] . ",
         username = '" . $userdata['username'] . "',
         user_level = " . $userdata['user_level'] . ",
         user_allow_viewonline = " . $userdata['user_allow_viewonline'] . "
      WHERE ip = '" . $_SERVER['REMOTE_ADDR'] . "'
      LIMIT 1";
   if ( !$db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not update Eazystats table', '', __LINE__, __FILE__, $sql);
   }
}
else
{
   $sql = "INSERT INTO " . EZSTATS_TABLE . "
      (stamp, ip, user_id, username, user_level, user_allow_viewonline)
      VALUES
      (". time() .",
      '".$_SERVER['REMOTE_ADDR']."',
      " . $userdata['user_id'] . ",
      '" . $userdata['username'] . "',
      " . $userdata['user_level'] . ",
      " . $userdata['user_allow_viewonline'] . ")";
   if ( !$db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not insert to Eazystats table', '', __LINE__, __FILE__, $sql);
   }
}
$db->sql_freeresult($result);
[/code]

Replace With:

[code linenumbers=false]
// If IP exists, do update. Else, do insert.
//
if ( $row = $db->sql_fetchrow($result) )
{
   $sql = "UPDATE " . EZSTATS_TABLE . "
              SET stamp = " . time () . ",
                  user_id = '" . $userdata['user_id'] . "',
                  username = '" . $userdata['username'] . "',
                  user_level = '" . $userdata['user_level'] . "',
                  user_allow_viewonline = '" . $userdata['user_allow_viewonline'] . "'
              WHERE ip = '" . $_SERVER['REMOTE_ADDR'] . "'
        LIMIT 1";
   if ( !$db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not update Eazystats table', '', __LINE__, __FILE__, $sql);
   }
}
else
{
   $sql = "INSERT INTO " . EZSTATS_TABLE . "
      (stamp, ip, user_id, username, user_level, user_allow_viewonline)
      VALUES
      (". time() .",
      '".$_SERVER['REMOTE_ADDR']."',
      '" . $userdata['user_id'] . "',
      '" . $userdata['username'] . "',
      '" . $userdata['user_level'] . "',
      '" . $userdata['user_allow_viewonline'] . "')";
   if ( !$db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not insert to Eazystats table', '', __LINE__, __FILE__, $sql);
   }
}
$db->sql_freeresult($result);[/code]

[b][color=red]Remember to back-up all files you edit[/color][/b]


____________

[highlight=#00ccff]I know this is an old post but I got bored and clicked "View Unanswered Posts" in hopes that I could help and maybe.. just maybe.. these people are watching this topic, also marking SOLVED on all posts that have been solved to tidy up a bit[/highlight]


