Changeset 6 for branches/2/index.php
- Timestamp:
- May 8, 2008, 8:48:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2/index.php
r5 r6 50 50 return($out); 51 51 } 52 53 function PagesList($URL, $Page, $TotalCount, $CountPerPage) 54 { 55 $Count = ceil($TotalCount / $CountPerPage); 56 $Around = 10; 57 $Result = ''; 58 if($Count > 1) 59 { 60 if($Page > 0) 61 { 62 $Result .= '<a href="'.$URL.'0"><<</a> '; 63 $Result .= '<a href="'.$URL.($Page - 1).'"><</a> '; 64 } 65 $PagesMax = $Count - 1; 66 $PagesMin = 0; 67 if($PagesMax > ($Page + $Around)) $PagesMax = $Page + $Around; 68 if($PagesMin < ($Page - $Around)) 69 { 70 $Result .= ' .. '; 71 $PagesMin = $Page - $Around; 72 } 73 for($i = $PagesMin; $i <= $PagesMax; $i++) 74 { 75 if($i == $Page) $Result .= '<strong>'; 76 $Result .= '<a href="'.$URL.$i.'">'.($i + 1).'</a> '; 77 if($i == $Page) $Result .= '</strong>'; 78 } 79 if($PagesMax < ($Count - 1)) $Result .= ' .. '; 80 if($Page < ($Count - 1)) 81 { 82 $Result .= '<a href="'.$URL.($Page + 1).'">></a> '; 83 $Result .= '<a href="'.$URL.($Count - 1).'">>></a>'; 84 } 85 } 86 return($Result); 87 } 52 88 } 53 89
Note:
See TracChangeset
for help on using the changeset viewer.