Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Feedback/Suggestions
Author Message
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

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

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: 6799
Location: Ha Noi, Viet Nam

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

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
sexycoder
Spammer and overall low life



Joined: Feb 02, 2009
Posts: 82

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

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: 2583
Location: Pittsburgh, Pennsylvania

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

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)?

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Dawg







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

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
 
jakec
Site Admin



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

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

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
Involved
Involved



Joined: Nov 19, 2003
Posts: 282

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

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







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

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
 
jakec







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

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

Looking forward to seeing your block.
 
sexycoder







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

WOW! I guess I didnt look well. Thanks jakec I found referals.
 
Dawg







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

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
 
Guardian2003







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

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');
 
Dawg







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

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
 
Palbin







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

Code:
refered_from<>'mydomain.com%'


I think.
 
Palbin







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

You may want this.

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


Not sure.
 
Dawg







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

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

Thanks!

Dawg
 
Guardian2003







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

Try this
Code:
refered_from NOT LIKE '%mydomain.com%'
 
Dawg







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

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

Dawg
 
Palbin







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

Guardian2003, Thanks can't believe I forgot the LIKE.
 
Guardian2003







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

RavensScripts
 
Dawg







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

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

Dawg
 
Dawg







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

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 />";
         };
   };






?>
 
Palbin







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

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++)
 
Dawg







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

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
 
Dawg







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

Delete please....


Last edited by Dawg on Fri Jun 05, 2009 6:18 am; edited 1 time in total 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Feedback/Suggestions

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 ©