czuserinfo_v5_universal with nuke sentinel

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   czuserinfo_v5_universal with nuke sentinel
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
I wanted to give this block a shot, and just check it out. I installed nuke sentinel a few days ago and had to change some code in my mainfile.php. On the Install of czusers it ask me to change some code in the mainfile.php. It tells me to 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')");
    }
}


and change 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')");
   }
}


My mainfile.php looks like this

function online() {
  global $nsnst_const, $user, $cookie, $prefix, $db;
  if(!file_exists('includes/nukesentinel.php')) {
    $ip = $_SERVER['REMOTE_ADDR'];
  } else {
    $ip = $nsnst_const['remote_ip'];
  }
  $guest = 0;
  if (is_user($user)) {
    cookiedecode($user);
    $uname = $cookie[1];
    if (!isset($uname)) {
      $uname = $ip;
      $guest = 1;
    }
  } else {
    $uname = $ip;
    $guest = 1;
  }
  $past = time()-3600;
  $sql = "DELETE FROM ".$prefix."_session WHERE time < '$past'";
  $db->sql_query($sql);
  $sql = "SELECT time FROM ".$prefix."_session WHERE uname='$uname'";
  $result = $db->sql_query($sql);
  $ctime = time();
  if (!empty($uname)) {
    $uname = substr($uname, 0,25);
    $row = $db->sql_fetchrow($result);
    if ($row) {
      $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')");
    }
  }
  $db->sql_freeresult($result);
}


I could prolly take some guesses at how to changed this but the outcome might not be any good icon_razz.gif


Back to top Reply with quote
#2   re: czuserinfo_v5_universal with nuke sentinel
craigmack
CZ Active Member
 Codezwiz Site Donator
craigmack has been a member for over 19 year's 19 Year Member
usa.gif michigan.gif
Age: 46
Gender: Male
Fav. Sports Team: Pistons
Status: Offline
Joined: Feb 15, 2005
0.02 posts per day
Posts: 147
Points: 6,072
   
check this post see if it helps you [ Register or login to view links on this board. ]



Back to top Reply with quote
#3   re: czuserinfo_v5_universal with nuke sentinel
floppydrivez
CZ Addict
 Codezwiz Site Donator
floppydrivez has been a member for over 18 year's 18 Year Member
usa.gif mississippi.gif
Occupation: graphic design
Age: 43
Gender: Male
Website:
Status: Offline
Joined: Feb 26, 2006
0.08 posts per day
Posts: 518
Points: 4,848
AIM Address Yahoo Messenger MSN Messenger 
Yep that worked.

function online() {
    global $user, $cookie, $prefix, $db, $name, $nsnst_const;
    cookiedecode($user);
    if(!file_exists('includes/nukesentinel.php')) {
        $ip = $_SERVER['REMOTE_ADDR'];
    } else {
        $ip = $nsnst_const['remote_ip'];
    }
    $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("&amp;", "&", $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')");
    }
  }
  $db->sql_freeresult($result);
}



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