Czuser version 5 error when edit mainfile.php

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Czuser version 5 error when edit mainfile.php
LordMaximus
CZ Super Newbie
 Codezwiz Site Donator
LordMaximus has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Feb 18, 2004
0.01 posts per day
Posts: 60
Points: 5,643
   
I get this error when I inject the code I'm told to add for Who is where.

Parse error: parse error, unexpected '}' in /home/clanspec/public_html/mainfile.php on line 667


using 7.8 patched
Please advise on what to do..

Thanks in advance.
LM


Back to top Reply with quote
#2   re: Czuser version 5 error when edit mainfile.php
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
Can you please attach your mainfile here, I will take a gander.



Back to top Reply with quote
#3   re: Czuser version 5 error when edit mainfile.php
LordMaximus
CZ Super Newbie
 Codezwiz Site Donator
LordMaximus has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Feb 18, 2004
0.01 posts per day
Posts: 60
Points: 5,643
   
Here ya go. This is minus the code since it crashes my site when adding the code.


Thanks.



Attached Files
mainfile.rar (13.96 KB, Downloaded: 5233 Time(s))


Back to top Reply with quote
#4   re: Czuser version 5 error when edit mainfile.php
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
Backup your original, then try this one. If this doesn't work, attach your edited mainfile here if you still have it please.



Attached Files
mainfile.zip (14.53 KB, Downloaded: 5244 Time(s))


Back to top Reply with quote
#5   re: Czuser version 5 error when edit mainfile.php
LordMaximus
CZ Super Newbie
 Codezwiz Site Donator
LordMaximus has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Feb 18, 2004
0.01 posts per day
Posts: 60
Points: 5,643
   
It works but no who is where to be found on the user login block.



Back to top Reply with quote
#6   re: Czuser version 5 error when edit mainfile.php
LordMaximus
CZ Super Newbie
 Codezwiz Site Donator
LordMaximus has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Feb 18, 2004
0.01 posts per day
Posts: 60
Points: 5,643
   
The install message says...

find this:
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()-3600; $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 ($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')"); } }


Replace with this:
function online() { global $user, $cookie, $prefix, $db, $name; cookiedecode($user); $ip = $_SERVER['REMOTE_ADDR']; $url = $_SERVER['REQUEST_URI']; $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(); $custom_title = addslashes($name); $url = ereg_replace("&", "&", $url); 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', module='$custom_title', url='$url' WHERE uname='$uname'"); } else { $db->sql_query("INSERT INTO ".$prefix."_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', '$ip', '$guest', '$custom_title', '$url')"); } } }



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,430
   
If you mouse over the numbers next to thier name you cant see the who is where function?




_________________
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   re: Czuser version 5 error when edit mainfile.php
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
The code in your patched 7.8 is slightly different and I thought I had it corrected, I've asked the master (Telli) to come into this thread when he has time and take a peek. Hang in there icon_wink.gif

*EDIT One minute before me Telli icon_mrgreen.gif



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,430
   
Change the function "online" in your mainfile.php to this:


function online() {
   global $user, $cookie, $prefix, $db, $name;
   cookiedecode($user);
   $ip = $_SERVER['REMOTE_ADDR'];
   $url = $_SERVER['REQUEST_URI'];
   $uname = $cookie[1];
      $guest = 0;
   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();
   $custom_title = addslashes($name);
      $uname = substr("$uname", 0, 25)
   $url = ereg_replace("&", "&", $url);
   if ($row = $db->sql_fetchrow($result)) {
      $db->sql_query("UPDATE {$prefix}_session SET uname='$uname', time='$ctime', host_addr='$ip', guest='$guest', module='$custom_title', url='$url' WHERE uname='$uname'");
   } else {
      $db->sql_query("INSERT INTO {$prefix}_session (uname, time, host_addr, guest, module, url) VALUES ('$uname', '$ctime', '$ip', '$guest', '$custom_title', '$url')");
   }
}


If you still get errors please attach the file that you edited.



_________________
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
#10   re: Czuser version 5 error when edit mainfile.php
LordMaximus
CZ Super Newbie
 Codezwiz Site Donator
LordMaximus has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Feb 18, 2004
0.01 posts per day
Posts: 60
Points: 5,643
   
Ok..I thought it was mouse over their name...Sorry...yeah its working now. Never thought about going over the number...doh!

Appreciate the help.



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