User Logged in mulitple times

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Look inside your mainfile.php for the function online() copy that and paste it in here please.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#2   
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 


Originally posted by Telli @ Wed Oct 27, 2004 7:37 pm:

Look inside your mainfile.php for the function online() copy that and paste it in here please.

function online() {
    global $user, $cookie, $prefix, $db;
    cookiedecode($user);
    $ip = $_SERVER["REMOTE_ADDR"];
    $uname = $cookie[1];
    if (!isset($uname)) {
        $uname = "$ip";
        $guest = 1;
    }
    $past = time()-1800;
    $db->sql_query("DELETE FROM ".$prefix."_session WHERE time < '$past'");
    $result = $db->sql_query("SELECT time FROM ".$prefix."_session WHERE uname='$uname'");
    $ctime = time();
    if ($uname!="") {
    $uname = substr("$uname", 0,25);
    if ($row = $db->sql_fetchrow($result)) {
   $db->sql_query("UPDATE ".$prefix."_session SET uname='$uname', time='$ctime', host_addr='$ip', guest='$guest' WHERE uname='$uname'");
    } else {
   $db->sql_query("INSERT INTO ".$prefix."_session (uname, time, host_addr, guest) VALUES ('$uname', '$ctime', '$ip', '$guest')");
    }
  }
}



Back to top Reply with quote
#3   re: User Logged in mulitple times
Holbrookau
CZ Newbie
Holbrookau has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 07, 2004
0.00 posts per day
Posts: 2
Points: 84
   
I don't have the actual fix, however I can tell you the error is most likely caused by your member usernames having odd characters in them - for some reason it makes the User-Info block display them multiple times.



Back to top Reply with quote
#4   re: User Logged in mulitple times
Holbrookau
CZ Newbie
Holbrookau has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 07, 2004
0.00 posts per day
Posts: 2
Points: 84
   
I don't have the answer however I can tell you the error is most likely caused by your member usernames having odd characters in them - for some reason it makes the User-Info block display them multiple times.



Back to top Reply with quote
#5   re: User Logged in mulitple times
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 
I know the user name that appears on my list twice just has letters on it.



Back to top Reply with quote
#6   re: User Logged in mulitple times
psinh22a
CZ Super Newbie
psinh22a has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.01 posts per day
Posts: 38
Points: 2,381
   
yeah i figured out its in the mainfile, i re added one file at a time from my back up and luckly the first file i added back was the main file after i done that, the userblock worked fine,so i just went back to my back up for now



Back to top Reply with quote
#7   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Here try mine see what happens.



function online() {
    global $user, $cookie, $prefix, $db, $name;
    cookiedecode($user);   
    $ip = $_SERVER["REMOTE_ADDR"];
    $uname = $cookie[1];
    $guest = 0;
    if (!isset($uname)) {
        $uname = $ip;
        $guest = 1;
    }

    $stime = time();
    $db->sql_query("DELETE FROM ".$prefix."_session WHERE time < ".($stime-300));
    list($exists) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM ".$prefix."_session WHERE uname='$uname'"));
    if ($exists) {
        $sql = "UPDATE ".$prefix."_session SET SET uname='$uname', time='$stime', host_addr='$ip', guest='$guest WHERE uname = '$uname'";
    } else {
        $sql = "INSERT INTO ".$prefix."_session (uname, time, host_addr, guest) VALUES ('$uname', '$stime', '$ip', '$guest')";
    }
    $db->sql_query($sql);
  }




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   
JRSweets
CZ Active Member
 Codezwiz Site Donator
JRSweets has been a member for over 20 year's 20 Year Member
usa.gif massachusetts.gif
Age: 43
Gender: Male
Fav. Sports Team: NE Patriots
Website:
Status: Offline
Joined: Apr 07, 2004
0.03 posts per day
Posts: 259
Points: 19,861
  MSN Messenger 
I tried your code and it seems to be working fine. The problem doesn't happen very often to me, so I will let you know if anything changes.



Back to top Reply with quote
#9   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Anyone else?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum