1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26: | function makeSites ( $page , $limit, $tabelle ) {
$maxpage = '';
$resultID = @mysql_query("SELECT COUNT(ID) FROM `".$tabelle."`");
$total = @mysql_result($resultID,0);
if ($limit < $total) {
$maxpage = $total / $limit;
if (is_double($maxpage)) {
$maxpage = ceil($maxpage);
}
$MPL = '[ ';
for($i=1; $i <= $maxpage; $i++) {
if($i == $page) {
$MPL .= $i;
} else {
$MPL .= '<a href="'.$PHP_SELF.'?page='.$i.'">'.$i.'</a>';
}
if ($i != $maxpage) {
$MPL .= ' | ';
}
}
$MPL .= ' ]';
}
return $MPL;
} |