Changeset 67 for trunk/userlist.php
- Timestamp:
- Feb 5, 2009, 11:12:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/userlist.php
r57 r67 3 3 include('includes/global.php'); 4 4 5 $ItemsPerPage = 50; 6 7 function WritePages($Address, $Table, $Where, $ItemsPerPage, $CurrentPage) 8 { 9 global $Database; 10 11 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM '.$Table.' '.$Where)); 12 $ItemCount = floor($Line[0] / $ItemsPerPage); 13 14 echo('Počet položek: <strong>'.$Line[0].'</strong> Zobrazit stránku: '); 15 16 if($CurrentPage > $ItemCount) $CurrentPage = ($ItemCount / $ItemsPerPage) - 1; 17 for($Page = 1; $Page <= $ItemCount; $Page++) 18 { 19 if($CurrentPage == $Page) echo('<strong>'.$Page.'</strong> '); 20 else echo('<a href="'.$Address.$Page.'">'.$Page.'</a> '); 21 } 22 } 5 ShowPage(); 23 6 24 7 echo('<strong>Seznam uživatelů:</strong><br />'); … … 29 12 if(array_key_exists('Desc', $_GET)) $_SESSION['Desc'] = $_GET['Desc']; 30 13 else if(!array_key_exists('Desc', $_SESSION)) $_SESSION['Desc'] = ''; 31 WritePages('?Page=', 'user', '', $ItemsPerPage, $_SESSION['Page']);14 ListPaging('?Page=', 'user', '', $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 32 15 33 16 echo('<table class="BaseTable">'); … … 63 46 if($Group['TablePrefix'] != '') 64 47 $Query .= '(SELECT count(Vote) AS Vote FROM `'.$Group['TablePrefix'].'` WHERE (User = user.ID) AND (Complete = 1) AND (Language <> 0)) + '; 65 $Query .= '0) AS Vote FROM `user` ORDER BY '.$order.' '.$desc.' LIMIT '.($_SESSION['Page'] - 1) * $ ItemsPerPage.','.$ItemsPerPage;48 $Query .= '0) AS Vote FROM `user` ORDER BY '.$order.' '.$desc.' LIMIT '.($_SESSION['Page'] - 1) * $Config['Web']['ItemsPerPage'].','.$Config['Web']['ItemsPerPage']; 66 49 $ID = $Database->SQLCommand($Query); 67 50 while($Line = mysql_fetch_array($ID)) … … 78 61 } 79 62 echo('</table>'); 80 WritePages('?Page=', 'user', '', $ItemsPerPage, $_SESSION['Page']);63 ListPaging('?Page=', 'user', '', $Config['Web']['ItemsPerPage'], $_SESSION['Page']); 81 64 82 65 ShowFooter();
Note:
See TracChangeset
for help on using the changeset viewer.