CZUser Error: unexpected T_VARIABLE

  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 Error: unexpected T_VARIABLE
Zathu
CZ Newbie
 Codezwiz Site Donator
Zathu has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Apr 11, 2006
0.00 posts per day
Posts: 1
Points: 628
   
Hey, I just donated and downloaded CZUser, and ran the czuser.php file, it updated my database. I went in to edit the mainfile.php like it said, uploaded, and now my site has this error:

Parse error: parse error, unexpected T_VARIABLE in /homepages/1/d89703919/htdocs/nuke/mainfile.php on line 522

Here is the whole code:
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')");
   }
}



Back to top Reply with quote
#2   re: CZUser Error: unexpected T_VARIABLE
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 56
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.08 posts per day
Posts: 643
Points: 57,200
   
Hello Zathu & welcome to Codezwiz


Fort get a qucik answer by coders it would be fine to type ;
* which php nuke version you use ( important for mainfile while it changes often )
* and beside the all function may be better add line 522 itself too




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#3   
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,475
   
Replace the above with 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("&amp;", "&", $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')");
   }
}




_________________
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