PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Mon Jun 01, 2009 4:16 pm Reply with quote Back to top

I really really miss....The Referrer Block.

I looked in the database for the NS referrers. I found it. It has them in ABC order. It does not log the entire link....just the domain url.

I really miss the Old Referrer Blocks. It made for really cool reading at times to see where the traffic was coming from.

Am I missing something here? Can we get the latest Referrer and the complete url from the NSreferrers?


If I am missing something....PLEASE tell me so I can go make a block to display them!

Dawg
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Mon Jun 01, 2009 4:32 pm Reply with quote Back to top

The referrers code was removed due to an outstanding security problem with inherited *nuke code.
As it was me that grabbed the 'issue' I didn't see the point in fixing up old code when it is more or less duplicated in NS (referer logging not the 'problem').
As we are now maintaining NS, they may be a chance of creating a block to display referers but I couldn't guarantee it for certain.
Personally, it would be nice to have such a block but have it cached so it only updated once an hour or something to save on DB reads.
View user's profile Send private message Send e-mail Visit poster's website
sexycoder
Spammer and overall low life


Joined: Feb 02, 2009
Posts: 82

PostPosted: Mon Jun 01, 2009 6:16 pm Reply with quote Back to top

Yeah I saw it was removed. I missed Referrer too. Instead of removing things why not make it more secure. I think referrer should come together with the last version of RN.
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2455
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Jun 01, 2009 6:50 pm Reply with quote Back to top

sexycoder wrote:
Yeah I saw it was removed. I missed Referrer too. Instead of removing things why not make it more secure. I think referrer should come together with the last version of RN.


Why keep duplicate features (short the block)?
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Mon Jun 01, 2009 7:01 pm Reply with quote Back to top

Palbin,
That is just it. It was not a "Duplicate" feature.....a related feature maybe.

The existing NSReferrers just needs a couple features "Added" to it....

To be able to sort by time/date
Full URL not just domains

Then writing the block would be easy.

I really miss it.

Dawg
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3038
Location: United Kingdom

PostPosted: Tue Jun 02, 2009 12:16 am Reply with quote Back to top

I think you may be looking in the wrong place.

Have a look at Tracked IP Menu, then Display Tracked Refers. In there you will be able to sort them by Date, Referer and Hits, either Ascending, or Descending.

I believe this log is more detailed than the Old Referers Module. Wink
View user's profile Send private message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Tue Jun 02, 2009 12:40 am Reply with quote Back to top

jakec wrote:
I think you may be looking in the wrong place.

Have a look at Tracked IP Menu, then Display Tracked Refers. In there you will be able to sort them by Date, Referer and Hits, either Ascending, or Descending.

I believe this log is more detailed than the Old Referers Module. Wink


It does and it even shows you what pages they visited.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Tue Jun 02, 2009 12:56 pm Reply with quote Back to top

I was looking in the wrong place THANK YOU. That is why I said in the orginal post....

"If I am missing something....PLEASE tell me so I can go make a block to display them! "

I will see if I can whip up a block tonight to display them.

Dawg
View user's profile Send private message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3038
Location: United Kingdom

PostPosted: Tue Jun 02, 2009 2:44 pm Reply with quote Back to top

Cool, I am glad we are all on the same page now. Wink

Looking forward to seeing your block.
View user's profile Send private message
sexycoder
Spammer and overall low life


Joined: Feb 02, 2009
Posts: 82

PostPosted: Tue Jun 02, 2009 10:30 pm Reply with quote Back to top

WOW! I guess I didnt look well. Thanks jakec I found referals.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Wed Jun 03, 2009 10:07 pm Reply with quote Back to top

OK....I am stuck now....

Code:
   $querystr = "SELECT refered_from,date FROM ".$prefix."_nsnst_tracked_ips ORDER BY date ASC   LIMIT 30" ;
   $result = $db->sql_query($querystr, $db)
   or die ("invalid query in towndisplay");
   for ($n=0; $n < sql_num_rows($result, $db); $n++)
      {
   list ($refered_from,$date) = mysql_fetch_row($result);

    if($refered_from !="on site" AND $refered_from !="none" AND $refered_from !="local") {
        echo "$refered_from - $date";
      echo "<br />";
    };
   $tt++;
   }


There are a couple of "Issues" with this....
#1 I keep getting referrers from my own domain....
#2 If I limit it to 30 in the sql call....by the time I ditch the on site, local and none I have like 5 left


How do I keep looping till I get 30 referrers from OTHER sites?

#3 I am sure I have screwed this all up and I am doing is ass backward.

Help? PLEASE!

Thank You for your time for us mear wannabees!

Dawg
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Wed Jun 03, 2009 11:12 pm Reply with quote Back to top

You don't those $db's for a start.
Code:

 $querystr = "SELECT refered_from,date FROM ".$prefix."_nsnst_tracked_ips ORDER BY date ASC   LIMIT 30" ;
   $result = $db->sql_query($querystr)
   or die ("invalid query in towndisplay");
   for ($n=0; $n < sql_num_rows($result); $n++)
      {
   list ($refered_from,$date) = mysql_fetch_row($result);

    if($refered_from !="on site" AND $refered_from !="none" AND $refered_from !="local") {
        echo "$refered_from - $date";
      echo "<br />";
    };
   $tt++;
   }

I'm no SQL expert but the rest looks good to me. It seems that you are pulling only 30 results so if only 5 don't meet your exclusions (none, local and on_site) then you are only going to get 5 results returned.

Maybe you can put the exclusion in the initial query so that it returns 30 results that meet the criteria.
Code:

 $querystr = "SELECT refered_from, date FROM ".$prefix."_nsnst_tracked_ips WHERE refered_from <>'local' AND refered_from<>'on_site' AND ..... ORDER BY date ASC   LIMIT 30" ;
   $result = $db->sql_query($querystr, $db)
   or die ('No Results');
View user's profile Send private message Send e-mail Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Thu Jun 04, 2009 10:50 am Reply with quote Back to top

I had never seen that...THANK YOU!

Code:
   $querystr = "SELECT refered_from,date FROM ".$prefix."_nsnst_tracked_ips  WHERE refered_from <>'local' AND refered_from<>'on_site' AND refered_from<>'none' AND refered_from<>'mydomain.com' ORDER BY date DESC LIMIT 50" ;


Now if I can just weed out ALL the entries that come from my domain it would be RIGHT.

I tried the code above and it will remove mydomain.com but not mydomain.com/anything/anything.htm

What it needs to do is exclude any entry with mydomain.com in it?
(That would screw up things like google and someone searching for mydomain....but it is better that all mydomain.com entries)


Any ideas there?

Dawg
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2455
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Jun 04, 2009 1:03 pm Reply with quote Back to top

Code:
refered_from<>'mydomain.com%'


I think.
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2455
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Jun 04, 2009 1:04 pm Reply with quote Back to top

You may want this.

Code:
refered_from<>'%mydomain.com%'


Not sure.
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Thu Jun 04, 2009 2:20 pm Reply with quote Back to top

I tried it both ways with no love....I will keep working on it....

Thanks!

Dawg
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Thu Jun 04, 2009 3:36 pm Reply with quote Back to top

Try this
Code:
refered_from NOT LIKE '%mydomain.com%'
View user's profile Send private message Send e-mail Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Thu Jun 04, 2009 3:58 pm Reply with quote Back to top

DING DING DING.......We Have a Winner!! WOOT WOOT!

Dawg
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2455
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Jun 04, 2009 4:06 pm Reply with quote Back to top

Guardian2003, Thanks can't believe I forgot the LIKE.
View user's profile Send private message
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6373
Location: Vsetin, Czech Republic

PostPosted: Thu Jun 04, 2009 4:07 pm Reply with quote Back to top

RavensScripts
View user's profile Send private message Send e-mail Visit poster's website
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Thu Jun 04, 2009 4:31 pm Reply with quote Back to top

I have the block working.....Just adding a few more "Features" LOL!

Dawg
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Thu Jun 04, 2009 4:53 pm Reply with quote Back to top

CLEAN UP ON AISLE 1 PLEASE!

This is the part where you show me how crappy I code!!

Thank You for Ya'lls HELP!

Dawg

Code:
<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* Last referers block for phpNuke portal                               */
/* Copyright (c) 2001 by Jack Kozbial (jack@internetintl.com            */
/* http://www.InternetIntl.com                                          */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
//Latest Referrer Block by Dawg with Help from the RN Staff
//~~~~~~~~~~~~~RavenNuke ROCKS! ~~~~~~~~~~~~~~~~
/************************************************************************/


if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}

global $prefix, $db, $admin, $admin_file;
//Add your Domain Name here with NO http:// or www
   $domain= "southcarolina-offshore.com";
//Set $Showtime
// Set to 1 for for both Date/time
//Set to 2 for Date
// Set to 3 for  No Date
$showtime= "3";
//How Many Referers to show?
$number= 30;
   
$querystr = "SELECT refered_from,date FROM ".$prefix."_nsnst_tracked_ips  WHERE refered_from NOT LIKE 'local' AND refered_from NOT LIKE 'on site' AND refered_from NOT LIKE 'none' AND refered_from NOT LIKE '%$domain%' ORDER BY date DESC LIMIT $number" ;
   $result = $db->sql_query($querystr, $db)
   or die ("invalid query in towndisplay");
   for ($n=0; $n < sql_num_rows($result, $db); $n++)
   {
      list ($refered_from,$date) = mysql_fetch_row($result);
         if($refered_from !="on site" AND $refered_from !="none" AND $refered_from !="local") {
            if(strlen($refered_from) > 30) {
               $rfrom = substr($refered_from, 0, 30)."...";
            } else {
               $rfrom = $refered_from;
               }
            $content .= "<a href='$refered_from' title='$refered_from' target='_blank'>$rfrom</a>";
            if ($showtime==1){
               $timestamp = strftime("%D - %r",$date);
               $content .= " - $timestamp";
            }
            elseif($showtime==2){
               $timestamp = strftime("%D",$date);
               $content .= " - $timestamp";
            }
            elseif($showtime==3){
               $content .= "";
            }
            $content .= "<br />";
         };
   };






?>
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2455
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Jun 04, 2009 9:29 pm Reply with quote Back to top

Code:

$result = $db->sql_query($querystr, $db)

should be
Code:

$result = $db->sql_query($querystr)


Code:

for ($n=0; $n < sql_num_rows($result, $db); $n++)

should be
Code:

for ($n=0; $n < $db->sql_numrows($result); $n++)


Code:

list ($refered_from,$date) = mysql_fetch_row($result);

should be
Code:

list ($refered_from,$date) = $db->sql_fetchrow($result);


You should be using ' ... ' for your stings not "....".
For example:
Code:

$content .= "<a href='$refered_from' title='$refered_from' target='_blank'>$rfrom</a>";

Code:

$content .= '<a href="' . $refered_from . '" title="' . $refered_from . '" target="_blank">' . $rfrom . '</a>';

If you do this you can not wrape variables in [ $content .= ' - $timestamp'; ] like you can do [ $content .= " - $timestamp"; ]. It needs to be[ $content .= ' - ' . $timestamp; ].



You should get out of the habit of using queries in loops.
Code:

for ($n=0; $n < $db->sql_numrows($result); $n++)

Should be something like:
Code:

$numrows = $db->sql_numrows($result);
for ($n=0; $n < $numrows; $n++)
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Fri Jun 05, 2009 5:22 am Reply with quote Back to top

Palbin,
Thank You for taking the time to show me the "Right" way. If you teach me right....I will do it right.

I will have another version coming very shortly.

Dawg
View user's profile Send private message
Dawg
RavenNuke(tm) Development Team


Joined: Nov 07, 2003
Posts: 889

PostPosted: Fri Jun 05, 2009 5:38 am Reply with quote Back to top

Delete please....


Last edited by Dawg on Fri Jun 05, 2009 6:18 am; edited 1 time in total
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum