Huhu,
sagtmal kann man die Foren Seitenauswahl auch umschreiben so wie hier?
externer Link
anstatt [1][2][3]
lg
Siggi
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
function db_make_sites ($page ,$where ,$limit ,$link ,$table, $anzahl = NULL) { $hvmax = 4; // hinten und vorne links nach page $maxpage = ''; if ( empty ($MPL) ) { $MPL = ''; } if ( is_null ( $anzahl ) ) { $resultID = db_query ( "SELECT COUNT(*) FROM prefix_".$table." ".$where ); $total = db_result($resultID,0); } else { $total = $anzahl; } if ($limit < $total) { $maxpage = $total / $limit; if (is_double($maxpage)) { $maxpage = ceil($maxpage); } $ibegin = $page - $hvmax; $iende = $page + $hvmax ; $vgl1 = $iende + $ibegin; $vgl2 = ($hvmax * 2) + 1; if ( $vgl1 <= $vgl2 ) { $iende = $vgl2; } $vgl3 = $maxpage - ($vgl2 -1); if ($vgl3 < $ibegin ) { $ibegin = $vgl3; } if ($ibegin < 1) { $ibegin = 1; } if ($iende > $maxpage) { $iende = $maxpage; } $vMPL = '<span class="mpl arrow">«</span>'; if ($ibegin > 1) { $vMPL = '<a class="mpl_link" class href="'.$link.'-p1">«</a> '; } $MPL = $vMPL.''; for($i=$ibegin; $i <= $iende; $i++) { if($i == $page) { $MPL .= '<span class="mpl">'.$i.'</span>'; } else { $MPL .= '<a class="mpl_link" href="'.$link.'-p'.$i.'">'.$i.'</a>'; } if ($i != $iende) { $MPL .= ''; } } $MPL .= ''; if ($iende < $maxpage) { $MPL .= '<a class="mpl_link" href="'.$link.'-p'.$maxpage.'">»</a>'; } else { $MPL .= '<span class="mpl arrow">»</span>'; } } return $MPL; }
.mpl { border:1px solid #8da4b7; margin:2px; padding:3px 5px 3px 5px; text-decoration:none; background:#d8e7f5; } .arrow { background:#ffffff; } a.mpl_link { border:1px solid #8da4b7; margin:2px; padding:3px 5px 3px 5px; text-decoration:none; } a.mpl_link:hover { background:#d8e7f5; }
<br /><center>{SITELINK}</center>
<br/>
Geschlossen | ||
![]() |
Zurück zu HTML, PHP, SQL,... |