Changeset 900 for trunk/Modules/Referrer
- Timestamp:
- Apr 10, 2024, 11:49:39 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Referrer/Referrer.php
r893 r900 93 93 $Output .= $BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />'; 94 94 95 if ($User->Licence(LICENCE_ADMIN)) {96 97 $MonthAge = 3;98 $YesNo = array('Ne', 'Ano');99 $Output .= '<br/><strong>'.T('Servers referring to us').':</strong> <br />100 <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 />';101 102 if (!$User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';103 else $Where = '';104 $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '.95 if ($User->Licence(LICENCE_ADMIN)) 96 { 97 $MonthAge = 3; 98 $YesNo = array('Ne', 'Ano'); 99 $Output .= '<br/><strong>'.T('Servers referring to us').':</strong> <br />'. 100 '<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 />'; 101 102 if (!$User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)'; 103 else $Where = ''; 104 $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '. 105 105 'FROM (SELECT *, '. 106 106 '(`Hits` + COALESCE((SELECT SUM(`Hits`) FROM '. … … 111 111 'WHERE (`T3`.`MaxDateLast` > (NOW() - INTERVAL '.$MonthAge.' MONTH))'; 112 112 113 114 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T'); 115 $DbRow = $DbResult->fetch_row(); 116 $PageList = GetPageList($DbRow[0]); 117 118 $Output .= $PageList['Output']. 119 '<table class="BaseTable">'; 120 121 $TableColumns = array( 113 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T'); 114 $DbRow = $DbResult->fetch_row(); 115 $PageList = GetPageList($DbRow[0]); 116 117 $Output .= $PageList['Output']. 118 '<table class="BaseTable">'; 119 120 $TableColumns = array( 122 121 array('Name' => 'Web', 'Title' => T('Address')), 123 122 array('Name' => 'MaxDateLast', 'Title' => T('Last visit')), 124 123 array('Name' => 'TotalHits', 'Title' => T('Hits')), 125 );126 if ($User->Licence(LICENCE_ADMIN))127 {128 $TableColumns[] = array('Name' => 'Visible', 'Title' => T('Visible'));129 $TableColumns[] = array('Name' => 'Parent', 'Title' => T('Parent'));130 $TableColumns[] = array('Name' => 'Description', 'Title' => T('Comment'));131 $TableColumns[] = array('Name' => 'LastIP', 'Title' => T('Last IP address'));132 $TableColumns[] = array('Name' => 'Action', 'Title' => T('Actions'));133 }134 $Order = GetOrderTableHeader($TableColumns, 'MaxDateLast', 1);135 $Output .= $Order['Output'];136 137 $Query .= $Order['SQL'].$PageList['SQLLimit'];138 139 $DbResult = $this->Database->query($Query);140 while ($Line = $DbResult->fetch_assoc())141 {142 $Output .= '<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'.124 ); 125 if ($User->Licence(LICENCE_ADMIN)) 126 { 127 $TableColumns[] = array('Name' => 'Visible', 'Title' => T('Visible')); 128 $TableColumns[] = array('Name' => 'Parent', 'Title' => T('Parent')); 129 $TableColumns[] = array('Name' => 'Description', 'Title' => T('Comment')); 130 $TableColumns[] = array('Name' => 'LastIP', 'Title' => T('Last IP address')); 131 $TableColumns[] = array('Name' => 'Action', 'Title' => T('Actions')); 132 } 133 $Order = GetOrderTableHeader($TableColumns, 'MaxDateLast', 1); 134 $Output .= $Order['Output']; 135 136 $Query .= $Order['SQL'].$PageList['SQLLimit']; 137 138 $DbResult = $this->Database->query($Query); 139 while ($Line = $DbResult->fetch_assoc()) 140 { 141 $Output .= '<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'. 143 142 '<td>'.HumanDate($Line['MaxDateLast']).'</td>'. 144 143 '<td>'.$Line['TotalHits'].'</td>'; 145 if ($User->Licence(LICENCE_ADMIN)) 146 { 147 $Output .= 148 '<td>'.$YesNo[$Line['Visible']].'</td>'. 149 '<td>'.$Line['ParentName'].'</td>'. 150 '<td>'.$Line['Description'].'</td>'. 151 '<td>'.$Line['LastIP'].'</td>'. 152 '<td><a href="?action=edit&id='.$Line['Id'].'">'.T('Modify').'</a> '. 153 '<a href="?action=spam&id='.$Line['Id'].'">'.T('Spam').'</a></td>'; 144 if ($User->Licence(LICENCE_ADMIN)) 145 { 146 $Output .= 147 '<td>'.$YesNo[$Line['Visible']].'</td>'. 148 '<td>'.$Line['ParentName'].'</td>'. 149 '<td>'.$Line['Description'].'</td>'. 150 '<td>'.$Line['LastIP'].'</td>'. 151 '<td><a href="?action=edit&id='.$Line['Id'].'">'.T('Modify').'</a> '. 152 '<a href="?action=spam&id='.$Line['Id'].'">'.T('Spam').'</a></td>'; 153 } 154 $Output .= '</tr>'; 154 155 } 155 $Output .= '</tr>'; 156 } 157 $Output .= '</table>'; 158 $Output .= $PageList['Output']; 159 156 $Output .= '</table>'; 157 $Output .= $PageList['Output']; 160 158 } 161 159 return $Output; … … 263 261 } 264 262 } 265
Note:
See TracChangeset
for help on using the changeset viewer.