Changeset 185
- Timestamp:
- Apr 22, 2009, 10:58:57 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/banners.php
r67 r185 5 5 ShowPage(); 6 6 7 $ID = $Database->SQLCommand( "SELECT * FROM `banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)");7 $ID = $Database->SQLCommand('SELECT * FROM `banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)'); 8 8 9 9 echo('<strong>Servery odkazující na nás:</strong> <br /> 10 10 <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery s aktivní bannerem mladším než tři měsíce.</div><br />'); 11 while($Line = mysql_fetch_a rray($ID))11 while($Line = mysql_fetch_assoc($ID)) 12 12 { 13 echo('<a href="'.$Line['Web'].'">'.$Line[' Web'].'</a> '.$Line['Description'].' <br />');13 echo('<a href="'.$Line['Web'].'">'.$Line['LastURL'].'</a> '.$Line['Description'].' <br />'); 14 14 } 15 15 -
trunk/banners/banner.php
r67 r185 6 6 $Referer = addslashes($_SERVER['HTTP_REFERER']); 7 7 $Referer = substr($Referer, strpos($Referer, '/') + 2); 8 $Referer = 'http://'.substr($Referer, 0, strpos($Referer, '/')).'/'; 9 $DbResult = mysql_query('SELECT * FROM `banner` WHERE `Web` = "'.$Referer.'"', $Database->id_connection); 10 if(mysql_num_rows($DbResult) > 0) 11 $Database->SQLCommand('UPDATE `banner` SET `DateLast` = NOW() WHERE `Web` = "'.$Referer.'"'); 12 else mysql_query('INSERT INTO `banner` (`Web`, `DateFirst`, `DateLast`) VALUES ("'.$Referer.'", NOW(), NOW( ))', $Database->id_connection); 8 $HostName = substr($Referer, 0, strpos($Referer, '/')); 9 if(substr($HostName, -1) == '.') $HostName = substr($HostName, 0, -1); 10 if($HostName != gethostbyname($HostName)) 11 { 12 $Referer = 'http://'.$HostName.'/'; 13 $DbResult = mysql_query('SELECT * FROM `banner` WHERE `Web` = "'.$Referer.'"', $Database->id_connection); 14 if(mysql_num_rows($DbResult) > 0) 15 $Database->SQLCommand('UPDATE `banner` SET `DateLast` = NOW(), `LastURL` = "'.addslashes($_SERVER['HTTP_REFERER']).'" WHERE `Web` = "'.$Referer.'"'); 16 else mysql_query('INSERT INTO `banner` (`Web`, `DateFirst`, `DateLast`, LastURL`) VALUES ("'.$Referer.'", NOW(), NOW( ), "'.addslashes($_SERVER['HTTP_REFERER']).'")', $Database->id_connection); 17 } 18 13 19 $Image = imagecreatefromjpeg(addslashes($_GET['image'])); 14 20 imagepng($Image);
Note:
See TracChangeset
for help on using the changeset viewer.