aahhhh! ich werd noch wahnsinnig! der entry count gehört doch sicher hier irgendwo hinein! komm aber nicht drauf!
bin schon total bubu!
schaff es nicht das mit den verschiedenen pages abzuchecken!

bin schon total bubu!
schaff es nicht das mit den verschiedenen pages abzuchecken!
PHP:
# Calculate Page-Numbers
#################################################################################################
if (empty($perpage)) $perpage = 1;
if (empty($pperpage)) $pperpage = 9; //!!! ONLY 5,7,9,11,13 !!!!
if (empty($sort)) $sort = "desc";
if (empty($offset)) $offset = 0;
if (empty($poffset)) $poffset = 0;
$amount = mysql_db_query($database, "SELECT count(*) FROM guestbook");
$amount_array = mysql_fetch_array($amount);
$pages = ceil($amount_array["0"] / $perpage);
$actpage = ($offset+$perpage)/$perpage;
$maxoffset = ($pages-1)*$perpage;
$maxpoffset = $pages-$pperpage;
$middlepage=($pperpage-1)/2;
if ($maxpoffset<0) {$maxpoffset=0;}
echo "<td><div class=\"mainpages\">\n";
if ($pages) { // print only when pages > 0
echo "$ad_pages\n";
if ($offset) {
$noffset=$offset-$perpage;
$npoffset = $noffset/$perpage-$middlepage;
if ($npoffset<0) {$npoffset=0;}
if ($npoffset>$maxpoffset) {$npoffset = $maxpoffset;}
echo "[<a href=\"$PHP_SELF?offset=0&poffset=0$adminlink\"><<</a>] ";
echo "[<a href=\"$PHP_SELF?offset=$noffset&poffset=$npoffset$adminlink\"><</a>] ";
}
for($i = $poffset; $i< $poffset+$pperpage && $i < $pages; $i++) {
$noffset = $i * $perpage;
$npoffset = $noffset/$perpage-$middlepage;
if ($npoffset<0) {$npoffset = 0;}
if ($npoffset>$maxpoffset) {$npoffset = $maxpoffset;}
$actual = $i + 1;
if ($actual==$actpage) {
echo "(<b>$actual</b>) ";
} else {
echo "[<a href=\"$PHP_SELF?offset=$noffset&poffset=$npoffset$adminlink\">$actual</a>] ";
}
}
if ($offset+$perpage<$amount_array["0"]) {
$noffset=$offset+$perpage;
$npoffset = $noffset/$perpage-$middlepage;
if ($npoffset<0) {$npoffset=0;}
if ($npoffset>$maxpoffset) {$npoffset = $maxpoffset;}
echo "[<a href=\"$PHP_SELF?offset=$noffset&poffset=$npoffset$adminlink\">></a>] ";
echo "[<a href=\"$PHP_SELF?offset=$maxoffset&poffset=$maxpoffset$adminlink\">>></a>] ";
}
}
echo "</div></td></tr>\n";
echo "</table>\n";
# Start the Page
#################################################################################################
echo "<table align=\"center\" cellspacing=\"1\" cellpadding=\"3\" width=\"100%\" border=\"0\">\n";
echo " <tr>\n";
echo " <td class=\"gbheader\">$gb_name</td>\n";
echo " <td class=\"gbheader\">$gb_comments</td>\n";
echo " </tr>\n";
# Get actions for current page
#################################################################################################
$result = mysql_db_query($database, "SELECT * FROM guestbook ORDER by id $sort LIMIT $offset, $perpage");
while ($db = mysql_fetch_array($result)) {
if ($dateformat=="eu")
{ // European Date & Timeformat
$when = strftime("%d.%m.%Y %H:%M", $db["timestamp"]);
} else { // US Date & Timeformat
$when = strftime("%m/%d/%Y %I:%M %p", $db["timestamp"]);
}
if ($db[email] != "none") {
$email = "<a href=\"mailto:".$db[email]."\"><img src=\"$image_dir/icons/email.gif\" alt=\"$send_email\" border=\"0\" align=\"right\"></a>";
} else {
$email = "";
}
if ($db[icq] != 0) {
$icq = "<a href=\"http://wwp.icq.com/scripts/contact.dll?msgto=$db[icq]\"><img src=\"http://wwp.icq.com/scripts/online.dll?icq=" . $db[icq] . "&img=5\" alt=\"$icq_message\" border=\"0\" align=\"right\" height=\"17\"></a>";
} else {
$icq = "";
}
//und so weiter und so weiter...