Changeset 6 for trunk/www/global.php
- Timestamp:
- Jun 10, 2009, 4:57:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/global.php
r3 r6 17 17 include('module.php'); 18 18 include('page.php'); 19 include('log.php'); 19 20 include('forms.php'); 20 21 include('server.php'); 22 include('emulator.php'); 21 23 include('mangos_configuration_file.php'); 22 24 … … 177 179 $System->Config = $Config; 178 180 $System->Database = &$Database; 181 include_once('log.php'); 182 $System->AddModule(new Log()); 179 183 include_once('user.php'); 180 184 $System->AddModule(new User()); … … 251 255 252 256 // Zobrazení číselný seznamu stránek 253 function PagesList($URL,$Page,$TotalCount,$CountPerPage) 254 { 255 $Count = ceil($TotalCount/$CountPerPage); 256 $Around = 10; 257 function PagesList($URL, $Page, $TotalCount, $CountPerPage, $Around = 10) 258 { 259 $Count = ceil($TotalCount / $CountPerPage); 257 260 $Result = ''; 258 if($Count >1)259 { 260 if($Page >0)261 { 262 $Result .= '<a href="'.$URL.'0"><<</a> ';263 $Result .= '<a href="'.$URL.($Page-1).'"><</a> ';264 } 265 $PagesMax = $Count -1;261 if($Count > 1) 262 { 263 if($Page > 0) 264 { 265 $Result .= '<a href="'.$URL.'0"><<</a> '; 266 $Result .= '<a href="'.$URL.($Page - 1).'"><</a> '; 267 } 268 $PagesMax = $Count - 1; 266 269 $PagesMin = 0; 267 if($PagesMax >($Page+$Around)) $PagesMax = $Page+$Around;268 if($PagesMin <($Page-$Around))270 if($PagesMax > ($Page + $Around)) $PagesMax = $Page + $Around; 271 if($PagesMin < ($Page - $Around)) 269 272 { 270 273 $Result.= ' .. '; 271 $PagesMin = $Page -$Around;272 } 273 for($i =$PagesMin;$i<=$PagesMax;$i++)274 { 275 if($i ==$Page) $Result.= '<strong>';276 $Result .= '<a href="'.$URL.$i.'">'.($i+1).'</a> ';277 if($i ==$Page) $Result.= '</strong>';278 } 279 if($PagesMax <($Count-1)) $Result .= ' .. ';280 if($Page <($Count-1))281 { 282 $Result .= '<a href="'.$URL.($Page+1).'">></a> ';283 $Result .= '<a href="'.$URL.($Count-1).'">>></a>';274 $PagesMin = $Page - $Around; 275 } 276 for($i = $PagesMin; $i <= $PagesMax; $i++) 277 { 278 if($i == $Page) $Result .= '<strong>'; 279 $Result .= '<a href="'.$URL.$i.'">'.($i + 1).'</a> '; 280 if($i == $Page) $Result .= '</strong>'; 281 } 282 if($PagesMax < ($Count - 1)) $Result .= ' .. '; 283 if($Page < ($Count - 1)) 284 { 285 $Result .= '<a href="'.$URL.($Page + 1).'">></a> '; 286 $Result .= '<a href="'.$URL.($Count - 1).'">>></a>'; 284 287 } 285 288 } 286 289 return($Result); 287 } 290 } 288 291 289 292 function GetRemoteAddress()
Note:
See TracChangeset
for help on using the changeset viewer.