I have the guestbook mod and i have made a counter for the number of guestbook entries:
//-----------------------------------------------------
//--- Guestbook Signatures-----------------------------
//-----------------------------------------------------
$sql = "SELECT SUM(comment_id) AS sum
FROM ".GUESTBOOK_TABLE;
$row = $site_db->query_firstrow($sql);
$sum = (isset($row['sum'])) ? $row['sum'] : 0;
$total_signatures = "".$lang['total_signatures']."<B> ".$row['sum']."</B>\n";
$site_template->register_vars("total_signatures", $total_signatures);
unset($total_signatures);
With the corresponding language and calls etc. However, when it counts it counts deleted posts as there. I know because I made an entry, deleted it, made another entry. It now says there are 2 instead of 1. Is there a better variable to count than the "comment_id"?