How to get an aggregate of latest guestbook entries
on the site guestbook page ?
For example, various users post gbook messages on various other users' gbook.
The site book automatically displays x number of those latest entries.
In the guestbook module ( for 4.7x ), where there is
// Insert new message
if (_guestbook_access('post', $uid) == 'allowed') {
if ($user->uid == 0) {
// anonymous user
$entryid = db_next_id('{guestbook}_id');
$result = db_query("INSERT INTO {guestbook} (id, anonname, anonemail, anonwebsite, author, recipient, message, created)
VALUES('%d', '%s', '%s', '%s', '%d', '%d', '%s', '%d')", $entryid, $edit['anonname'], $edit['anonemail'], $edit['anonwebsite'], $user->uid, $uid, $message, time());
}
else if ($user->uid > 0) {
// registered user
$entryid = db_next_id('{guestbook}_id');
$result = db_query("INSERT INTO {guestbook} (id,author,recipient,message,created)
VALUES('%d', '%d', '%d', '%s', '%d')", $entryid, $user->uid, $uid, $message, time());
If I add the following
// adding the following lines
$entryid = db_next_id('{guestbook}_id');
$result = db_query("INSERT INTO {guestbook} (id,author,recipient,message,created)
VALUES('%d', '%d', '0', '%s', '%d')", $entryid, $user->uid, $message, $message, time());