Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Certification - Submit Scripts For RavenNuke(tm) Certification
Author Message
Dawg
RavenNuke(tm) Development Team



Joined: Nov 07, 2003
Posts: 928

PostPosted: Sat Jun 06, 2009 8:51 pm Reply with quote

Code:
<?php 


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2002 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/* 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 for RavenNuke by Dawg with Help from the RN Staff
//Palbin
//Guardian2003
//Thank You for Your Time
//~~~~~~~~~~~~~RavenNuke ROCKS! ~~~~~~~~~~~~~~~~
/************************************************************************/


if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}
global $prefix, $db;

$domain= ($_SERVER['HTTP_HOST']);
//Set $Showtime
//Set to 1 for for both Date/time
//Set to 2 for Date
// Set to 3 for  Off
$showtime= '1';
//How Many Referers to show?
$number= 30;
//No Edits needed below this line
$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) 
   or die ('invalid query in towndisplay');
   $numrows = $db->sql_numrows($result);
   for ($n=0; $n < $numrows; $n++)
   {
      list ($refered_from,$date) = $db->sql_fetchrow($result);
         if($refered_from !='on site' AND $refered_from !='none' AND $refered_from !='local') {

//Set the number below to the desired width
            if(strlen($refered_from) > 30) {
               $rfrom = substr($refered_from, 0, 30).'...';
//End Edit desired width number
            } 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 />';
         };
   };
?>


If you have any questions or concerns, Please post them here... [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
southern
Client



Joined: Jan 29, 2004
Posts: 624

PostPosted: Wed Jul 28, 2010 5:44 pm Reply with quote

That's a useful block, Dawg.
How could I combine it with an IP display?
Code:


<?php
$img_number = imagecreate(275,25);
$backcolor = imagecolorallocate($img_number,255,255,255);
$textcolor = imagecolorallocate($img_number,0,0,0);
imagefill($img_number,0,0,$backcolor);
$number = "$_SERVER[REMOTE_ADDR]";
Imagestring($img_number,10,5,5,$number,$textcolor);
header("Content-type: image/jpeg");
imagejpeg($img_number);
?>

The above is saved as image.php and called w/an img tag... is it possible to include various HTTP codes in it? Can it be used as a block? Thanks

_________________
Computer Science is no more about computers than astronomy is about telescopes.
- E. W. Dijkstra 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Certification - Submit Scripts For RavenNuke(tm) Certification

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 ©