- Timestamp:
- Feb 8, 2008, 11:08:10 PM (17 years ago)
- Location:
- quests
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/banners/baner_468_60.php
r295 r297 4 4 include('../includes/databaseconection.php'); 5 5 6 7 6 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); 8 7 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 9 8 $Database->SelectDatabase($Config['Database']['Database']); 10 9 10 function HaveInArray($Array,$String) 11 { // BEGIN function HaveInArray 12 for ( $i = 0; $i < count($Array); ++$i) { 13 if ($String == $Array[$i]) { 14 return true; 15 } 16 } 17 } // END function HaveInArray 18 19 function GetIP($Web) 20 { // BEGIN function GetIP 21 $result_string = substr($Web,0,strpos($Web,'/')); 22 $Web = substr($Web,strlen($result_string)+1,strlen($Web)-strlen($result_string)); 23 $result_string1 = substr($Web,0,strpos($Web,'/')); 24 $Web = substr($Web,strlen($result_string1)+1,strlen($Web)-strlen($result_string1)); 25 $result_string2 = substr($Web,0,strpos($Web,'/')); 26 $Web = substr($Web,strlen($result_string2)+1,strlen($Web)-strlen($result_string2)); 27 return $result_string2; 28 } // END function GetIP 29 30 function GetArrayWebs() 31 { // BEGIN function GetArrayWebs 32 global $Database; 33 $ID = $Database->SQLCommand("SELECT * FROM `banner`"); 34 $i = 0; 35 while($Line = mysql_fetch_array($ID)) { 36 $result[$i] = GetIP($Line['Web']); 37 ++$i; 38 } 39 return $result; 40 } // END function GetArrayWebs 41 11 42 $img = imagecreatefromjpeg('baner_468_60.jpg'); 12 43 $address = @$_SERVER["HTTP_REFERER"]; 44 $ArrayWebIP = GetArrayWebs(); 45 46 if (HaveInArray($ArrayWebIP,GetIP($address)) == false) { 47 $CanWrite = true; 48 } else { 49 $CanWrite = false; 50 } 13 51 14 52 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM banner WHERE Web = '$address'")); 15 if ( !$Line) {53 if ((!$Line) and $CanWrite) { 16 54 $Database->SQLCommand("INSERT INTO `banner` ( `Date` , `Web` ) VALUES ( NOW() , '$address');"); 17 55 } … … 21 59 // imagestring($img, 10, 10, 30, 'Pøispupujete z: '.$address, $Color3); 22 60 61 // Header('Content-Disposition: attachment; filename="img_468_60.jpg"'); 23 62 header('Content-Type: image/png'); 24 // Header('Content-Disposition: attachment; filename="img_468_60.jpg"');25 63 imagepng($img); 26 64 -
quests/banners/baner_88_31.php
r295 r297 4 4 include('../includes/databaseconection.php'); 5 5 6 7 6 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); 8 7 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 9 8 $Database->SelectDatabase($Config['Database']['Database']); 10 9 10 function HaveInArray($Array,$String) 11 { // BEGIN function HaveInArray 12 for ( $i = 0; $i < count($Array); ++$i) { 13 if ($String == $Array[$i]) { 14 return true; 15 } 16 } 17 } // END function HaveInArray 18 19 function GetIP($Web) 20 { // BEGIN function GetIP 21 $result_string = substr($Web,0,strpos($Web,'/')); 22 $Web = substr($Web,strlen($result_string)+1,strlen($Web)-strlen($result_string)); 23 $result_string1 = substr($Web,0,strpos($Web,'/')); 24 $Web = substr($Web,strlen($result_string1)+1,strlen($Web)-strlen($result_string1)); 25 $result_string2 = substr($Web,0,strpos($Web,'/')); 26 $Web = substr($Web,strlen($result_string2)+1,strlen($Web)-strlen($result_string2)); 27 return $result_string2; 28 } // END function GetIP 29 30 function GetArrayWebs() 31 { // BEGIN function GetArrayWebs 32 global $Database; 33 $ID = $Database->SQLCommand("SELECT * FROM `banner`"); 34 $i = 0; 35 while($Line = mysql_fetch_array($ID)) { 36 $result[$i] = GetIP($Line['Web']); 37 ++$i; 38 } 39 return $result; 40 } // END function GetArrayWebs 41 11 42 $img = imagecreatefromjpeg('baner_88_31.jpg'); 12 43 $address = @$_SERVER["HTTP_REFERER"]; 44 $ArrayWebIP = GetArrayWebs(); 45 46 if (HaveInArray($ArrayWebIP,GetIP($address)) == false) { 47 $CanWrite = true; 48 } else { 49 $CanWrite = false; 50 } 13 51 14 52 $Line = mysql_fetch_array($Database->SQLCommand("SELECT * FROM banner WHERE Web = '$address'")); 15 if ( !$Line) {53 if ((!$Line) and $CanWrite) { 16 54 $Database->SQLCommand("INSERT INTO `banner` ( `Date` , `Web` ) VALUES ( NOW() , '$address');"); 17 55 } … … 21 59 // imagestring($img, 10, 10, 30, 'Pøispupujete z: '.$address, $Color3); 22 60 61 // Header('Content-Disposition: attachment; filename="img_468_60.jpg"'); 23 62 header('Content-Type: image/png'); 24 // Header('Content-Disposition: attachment; filename="img_468_60.jpg"');25 63 imagepng($img); 26 64 -
quests/includes/global.php
r295 r297 72 72 <a Title="Hlavní stránka" href="index.php">Domù</a><br /> 73 73 <a Title="Diskuze na téma pøeklárání" href="http://wow.zdechov.net/forum/viewforum.php?f=22">Forum projektu</a><br /> 74 <a Title=" Domácí server" href="http://wow.zdechov.net/">Web serveru</a><br />74 <a Title="Weby odkazující na tento projekt bennerem" href="banners.php">Odkazuje na nás</a><br /> 75 75 <a Title="Slovník wow výrazù" onclick="javascript:window.open(\'dictionary.php\',\'Slovník\',\'width=400,height=412\'); return false;" href="dictionary.php">Slovníèek</a><br /> 76 76 <a Title="Statistika pøekládání" href="statistic.php">Statistika</a><br /> -
quests/structure/banner.sql
r295 r297 1 - phpMyAdmin SQL Dump 2 -- version 2.9.1.1 3 -- http://www.phpmyadmin.net 4 -- 5 -- Host: localhost 6 -- Generation Time: Feb 08, 2008 at 11:09 PM 7 -- Server version: 5.0.27 8 -- PHP Version: 5.2.0 9 -- 10 -- Database: `quests` 11 -- 1 12 13 -- -------------------------------------------------------- 2 14 15 -- 16 -- Table structure for table `banner` 17 -- 3 18 4 19 CREATE TABLE `banner` ( 5 `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 6 `Date` DATETIME NOT NULL , 7 `Web` TEXT NOT NULL 8 ) ENGINE = MYISAM ; 20 `ID` int(11) NOT NULL auto_increment, 21 `Date` datetime NOT NULL, 22 `Web` text NOT NULL, 23 `Show` int(11) NOT NULL default '1', 24 `Description` text NOT NULL, 25 PRIMARY KEY (`ID`), 26 KEY `Show` (`Show`) 27 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=55 ; 28 29 /* 30 ALTER TABLE `banner` ADD `Show` INT NOT NULL DEFAULT '1', 31 ADD `Description` TEXT NOT NULL ; 32 33 ALTER TABLE `banner` ADD INDEX ( `Show` ) ; 34 */
Note:
See TracChangeset
for help on using the changeset viewer.