Changeset 483
- Timestamp:
- Jun 18, 2010, 7:10:56 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/banners.php
r465 r483 2 2 3 3 include('includes/global.php'); 4 5 $MonthAge = 3; 4 6 5 7 ShowPage(); … … 18 20 echo($BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />'); 19 21 20 $DbResult = $System->Database->query('SELECT * FROM `Referrer` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH) ORDER BY `DateLast` DESC');21 22 22 echo('<br/><strong>Servery odkazující na nás:</strong> <br /> 23 23 <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců řazený sestupně dle nejnovějších.</div><br />'); 24 25 26 $Query = 'SELECT *, (`Hits` + (SELECT SUM(`Hits`) FROM `Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`)) AS `TotalHits` FROM `Referrer` AS `T2` WHERE (`Show`=1) AND (`Parent`=0) AND (`DateLast` > (NOW() - INTERVAL '.$MonthAge.' MONTH))'; 27 28 29 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T'); 30 $DbRow = $DbResult->fetch_row(); 31 $PageList = GetPageList($DbRow[0]); 32 33 echo($PageList['Output']); 34 echo('<table class="BaseTable">'); 35 36 $TableColumns = array( 37 array('Name' => 'Web', 'Title' => 'Adresa'), 38 array('Name' => 'DateLast', 'Title' => 'Naposledy'), 39 array('Name' => 'TotalHits', 'Title' => 'Příchodů'), 40 ); 41 $Order = GetOrderTableHeader($TableColumns, 'DateLast', 1); 42 echo($Order['Output']); 43 44 $Query .= $Order['SQL'].$PageList['SQLLimit']; 45 46 $DbResult = $System->Database->query($Query); 47 while($Line = $DbResult->fetch_assoc()) 48 { 49 echo('<tr><td>'.$Line['Web'].'</td>'. 50 '<td>'.HumanDate($Line['DateLast']).'</td>'. 51 '<td>'.$Line['TotalHits'].'</td></tr>'); 52 } 53 echo('</table>'); 54 echo($PageList['Output']); 55 24 56 while($Line = $DbResult->fetch_assoc()) 25 57 { -
trunk/includes/global_function.php
r466 r483 551 551 { 552 552 $DbRow = $DbResult->fetch_assoc(); 553 $System->Database->query('UPDATE `Referrer` SET ` DateLast` = NOW(), `LastURL` = "'.addslashes($Referrer).'" WHERE `Id` = '.$DbRow['Id']);553 $System->Database->query('UPDATE `Referrer` SET `Hits` = `Hits` + 1, `DateLast` = NOW(), `LastURL` = "'.addslashes($Referrer).'" WHERE `Id` = '.$DbRow['Id']); 554 554 } else $System->Database->query('INSERT INTO `Referrer` (`Web`, `DateFirst`, `DateLast`, `LastURL`) VALUES ("'.$HostName.'", NOW(), NOW( ), "'.addslashes($Referrer).'")'); 555 555 }
Note:
See TracChangeset
for help on using the changeset viewer.