Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
TheosEleos
Life Cycles Becoming CPU Cycles


Joined: Sep 18, 2003
Posts: 960
Location: Missouri

PostPosted: Sat Aug 21, 2004 9:43 pm Reply with quote

The one thing about protector I really liked was the way it would keep a log of all ips that came to my site. If the ip was a member it had that in the database as well.

Is there anything out there that does that besides protector?

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
GeekyGuy
Client


Joined: Jun 03, 2004
Posts: 302
Location: Huber Heights Ohio

PostPosted: Sat Aug 21, 2004 10:00 pm Reply with quote

TheosEleos,
You might check this link Only registered users can see links on this board! Get registered or login! for an IP tracker

_________________
"The Daytona 500 is ours! We won it, we won it, we won it!", Dale Earnhardt, February 15th, 1998, Daytona 500 
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
TheosEleos
PostPosted: Sat Aug 21, 2004 10:06 pm Reply with quote

Cool, I'll give it a try.

Shanks!
 
TheosEleos
PostPosted: Thu Sep 02, 2004 1:58 pm Reply with quote

This is the stinker that is keeping me from getting to your_account. When I disable it I can access your account while logged in as admin.

In counter.php I have to add the line....

include_once("modules/IP_Tracking/iptracking.php");

Here is the code for iptracking.php. Maybe someone can look through it and fix it for me?

It tracks me by my nuke admin name not my nuke user name.

Code:
<?php


####################################################################
# IP Tracking                                                      #
#                                                                  #
# Copyright (c) 2003 by Scott Rubin - phpnuke id: scottr           #
# http://www.ierealtor.com                                         #
#                                                                  #
# Insert into the IP Tracking table if $trackip == 1               #
#                                                                  #
# Delete $ipdel rows from IP Tracking table                        #
# if number of rows in IP Tracking table reaches $ipmax            #
#                                                                  #
####################################################################

global $prefix, $db, $trackip, $ipmax, $ipdel, $numip, $ipaddr, $hostnm, $exclude_me;
global $hide_ipseg, $hide_host, $ipmaskchar, $members_see_iphost, $members_see_users;
global $show_hits, $offset_hours, $cookie, $user, $admin, $members_see_online, $admin_see_online;

require("modules/IP_Tracking/ipconfig.php");

if ($trackip == 1) {
   # capture User, Timestamp, IP Address, Resolved IP Address, Web Page
   $dt = date("Y-m-d H:i:s", time() + ($offset_hours * 60 * 60)) ;
   $ipaddr = $_SERVER["REMOTE_ADDR"] ;
   $hostnm = gethostbyaddr("$ipaddr");
   if(is_user($user)) {
      cookiedecode($user);
      $username=$cookie[1];
   }
   if(is_admin($admin)) {
      if(!is_array($admin)) {
         $admin = base64_decode($admin);
         $admin = explode(":", $admin);
         $username = "$admin[0]";
      } else {
         $username = "$admin[0]";
      }
   }

   $exclude_me=false;
   array_walk($exclude_ips, 'IPTrack_exclude_ip');
   if(!$exclude_me) array_walk($exclude_hosts, 'IPTrack_exclude_host');
   if (!$exclude_me) {
      # concatenate SCRIPT_NAME and QUERY_STRING since REQUEST_URI not used in Windows hosted sites.
      # $pg = getenv(REQUEST_URI);
      # $pg = getenv(SCRIPT_NAME);
      $pg = $_SERVER["SCRIPT_NAME"];
      # if ((getenv(QUERY_STRING)) != "") { $pg = $pg . "?" . getenv(QUERY_STRING) ; }
      if (($_SERVER["QUERY_STRING"]) != "") { $pg = $pg . "?" . $_SERVER["QUERY_STRING"] ; }

      if($username==''){
         # let the database insert a null into the username column
         $sql = "INSERT INTO ".$prefix."_iptracking (date_time, ip_address, hostname, page)
                                             VALUES ('$dt', '$ipaddr', '$hostnm', '$pg')";
         $db->sql_query($sql);
      } else {
         $sql = "INSERT INTO ".$prefix."_iptracking (username, date_time, ip_address, hostname, page)
                    VALUES ('$username', '$dt', '$ipaddr', '$hostnm', '$pg')";
         $db->sql_query($sql);
      }
      # Delete from the iptracking table based on parameters set in ipsettings.php
      if ($ipmax > 0 and $ipdel > 0 and $ipmax >= $ipdel) {
         # replaced for speed v3.1.2
         #$tresult = sql_query("SELECT * FROM ".$prefix."_iptracking", $dbi);
         #$numrows = sql_num_rows($tresult, $dbi);
         $tsql = "SELECT COUNT(*) FROM ".$prefix."_iptracking";
         $tresult = $db->sql_query($tsql);
         list($numrows) = $db->sql_fetchrow($tresult);
         if($numrows>=$ipmax) {
            # 'DELETE ... LIMIT' not ready until mysql 4.0
            # $tsql = "DELETE FROM ".$prefix."_iptracking ORDER BY date_time LIMIT ".$ipdel;
            # $db->sql_query($tsql);
            $tsql = "SELECT date_time FROM ".$prefix."_iptracking ORDER BY date_time LIMIT " .$ipdel.",1";
            $tresult = $db->sql_query($tsql);
            list($date_time) = $db->sql_fetchrow($tresult);
            $tsql = "DELETE FROM ".$prefix."_iptracking WHERE date_time <= '".$date_time."'";
            $db->sql_query($tsql);
         }   
      }   
   }
}   

function IPTrack_exclude_ip($item) {
# this function checks if the ip address is in the list of ip addresses in the $exclude_ips array
# if it is, set global variable $exclude=true
# wildcard chars are allowed
   global $ipaddr, $exclude_me;
   if(eregi($item, $ipaddr)) $exclude_me=true;
}

function IPTrack_exclude_host($item) {
# this function checks if the hostname is in the list of hostnames in the $exclude_hosts array
# if it is, set global variable $exclude=true
# wildcard chars are allowed
   global $hostnm, $exclude_me;
   if(eregi($item, $hostnm)) $exclude_me=true;
}

?>
 
TheosEleos
PostPosted: Thu Sep 02, 2004 9:04 pm Reply with quote

Anyone? Perty please?

Maybe make it so it ignores admins completely?

I don't want to have to go to nukecops to get this solved! Don't make me do it!
 
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 17077

PostPosted: Thu Sep 02, 2004 9:33 pm Reply with quote

The referrer module that comes stock in nuke does this except the user part.
 
View user's profile Send private message
TheosEleos
PostPosted: Thu Sep 02, 2004 9:38 pm Reply with quote

I'm sorry, what?
 
Raven
PostPosted: Thu Sep 02, 2004 9:41 pm Reply with quote

HTTP referers in your nuke Admin panel.
 
TheosEleos
PostPosted: Thu Sep 02, 2004 9:44 pm Reply with quote

I understand that HTTP referers is an admin module but what do you mean it doesn't except the user part?
 
Raven
PostPosted: Thu Sep 02, 2004 9:46 pm Reply with quote

TheosEleos wrote:
The one thing about protector I really liked was the way it would keep a log of all ips that came to my site. If the ip was a member it had that in the database as well.

Is there anything out there that does that besides protector?
You asked this in your original post. You can have all the IP's using the HTTP Referers. It doesn't track users/members.
 
TheosEleos
PostPosted: Thu Sep 02, 2004 9:48 pm Reply with quote

So how do I get http referers to track ips? If that is what you are suggesting.
 
Raven
PostPosted: Thu Sep 02, 2004 9:53 pm Reply with quote

It does it automatically if you set it to on in Preferences.
 
TheosEleos
PostPosted: Thu Sep 02, 2004 10:28 pm Reply with quote

HTTP referers is activated but it doesn't track ips. I don't see an option to get it to track ips.

I want to track users related to ips. That is why I downloaded ip_tracker. It keeps me out of the your_account module.
 
Raven
PostPosted: Thu Sep 02, 2004 10:41 pm Reply with quote

It can be modified to add IP's. I'm just trying to give you options. Take the code you have in that module and make it do whatever you want Wink
 
TheosEleos
PostPosted: Thu Sep 02, 2004 10:45 pm Reply with quote

So I have to learn php after all? rofl
 
TheosEleos
PostPosted: Thu Sep 02, 2004 11:06 pm Reply with quote

I just commented out this and it works now. Twisted Evil

Code:
//if(is_admin($admin)) {

   //   if(!is_array($admin)) {
   //      $admin = base64_decode($admin);
   //      $admin = explode(":", $admin);
   //      $username = "$admin[0]";
   //   } else {
   //      $username = "$admin[0]";
   //   }
   //}
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©