Ezstats Mod »  Show posts from    to     

Icy Phoenix


Old Support Topics - Ezstats Mod



Leon [ Mon 04 Dec, 2006 23:16 ]
Post subject: Ezstats Mod
I have installed this mod Ezstats Mod , and everything seems to be working fine, the mod is really nice with daily graphic measurement for unique visitors visit to your site as you can see how the mod looks like here in my forum:
http://tinhthienthu.ath.cx/ezstats.php


But some how there is slightly a small problem involved to the mod that after installed the mod, when i search for users in my forum in PM or in Group CP, i got this error message:
Code: [Hide]
  1. Could not update Eazystats table  
  2.  
  3. DEBUG MODE  
  4.  
  5. SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' username = '', user_level = , user_allow_viewonline = WHERE ip = '6' at line 3  
  6.  
  7. UPDATE phpbb_ezstats SET stamp = 1165263542, user_id = , username = '', user_level = , user_allow_viewonline = WHERE ip = '69.238.117.146' LIMIT 1  
  8.  
  9. Line : 88  
  10. File : ezstats.php  
  11.  


except that small error tho mod is working great in my forum, and so does any one figure out what might be the cause of the error from the mod to the search users function ?


Frost [ Wed 10 Jan, 2007 20:51 ]
Post subject: Re: Ezstats Mod
Hi, try this and let me know

Open:

includes/ezstats.php

Find:

Code: [Hide] [Select]
// 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);


Replace With:

Code: [Hide] [Select]
// 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);


Remember to back-up all files you edit


____________

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




Powered by Icy Phoenix