source: trunk/banners.php@ 484

Last change on this file since 484 was 484, checked in by george, 15 years ago
  • Opraveno: Zobrazení odkazů na weby odkud přišli a zobrazení počtu návštěv.
File size: 2.6 KB
Line 
1<?php
2
3include('includes/global.php');
4
5$MonthAge = 3;
6
7ShowPage();
8
9$Banner = '<a href="http://'.$System->Config['Web']['Host'].$System->Link('/').'"><img src="http://'.$System->Config['Web']['Host'].$System->Link('/banners/wowpreklad_big.jpg').'" '.
10 'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
11 'class="banner" height="60" width="468" /></a>';
12
13$BannerSmall = '<a href="http://'.$System->Config['Web']['Host'].$System->Link('/').'"><img src="http://'.$System->Config['Web']['Host'].$System->Link('/banners/wowpreklad_small.jpg').'" '.
14 'alt="wowpreklad" title="Otevřený projekt překládání celé hry World of Warcraft" '.
15 'class="banner" height="31" width="88" /></a>';
16
17echo('<strong>Bannery:</strong><br />');
18
19echo($Banner.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($Banner).'</textarea><br />');
20echo($BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />');
21
22echo('<br/><strong>Servery odkazující na nás:</strong> <br />
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` + COALESCE((SELECT SUM(`Hits`) FROM `Referrer` AS `T1` WHERE `T1`.`Parent` = `T2`.`Id`), 0)) 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
33echo($PageList['Output']);
34echo('<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);
42echo($Order['Output']);
43
44$Query .= $Order['SQL'].$PageList['SQLLimit'];
45
46$DbResult = $System->Database->query($Query);
47while($Line = $DbResult->fetch_assoc())
48{
49 echo('<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'.
50 '<td>'.HumanDate($Line['DateLast']).'</td>'.
51 '<td>'.$Line['TotalHits'].'</td></tr>');
52}
53echo('</table>');
54echo($PageList['Output']);
55
56while($Line = $DbResult->fetch_assoc())
57{
58 echo('<a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a> '.$Line['Description'].' <br />');
59}
60
61ShowFooter();
62
63?>
64
Note: See TracBrowser for help on using the repository browser.