Closed (fixed)
Project:
Guestbook
Version:
5.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2008 at 04:55 UTC
Updated:
31 Jul 2008 at 15:36 UTC
I added the guestbook to be displayed in the users profile via the page-user.tpl in ored to have it as a side bar item. the problem is when I click the delete entry link (with or without deleting the guestbook message) the profile fields get deleted. I'm sure if this a direct problem with the guestbook module or because of the fact I placed the guestbook in a page.tpl file. anyways heres the code in my .tpl file for reference.
$uid= arg(1);
if (_guestbook_access('administer', $uid) && is_numeric($op_id)) {
switch ($op) {
case "delete":
$y = guestbook_delete_entry_confirm($uid, $op_id);
case 'comment':
$comment_entry = $op_id;
break;
}
}
// Fetch guestbook entries
$userid4 = arg(1);
$limit = variable_get('guestbook_entries_per_page', 20);
$results = pager_query(
"SELECT g.*, u1.name, u1.data, u1.picture, u2.name as commentby
FROM {guestbook} g
LEFT JOIN {users} u1 ON g.author = u1.uid
LEFT JOIN {users} u2 ON g.commentauthor = u2.uid
WHERE g.recipient = $userid4
ORDER BY g.created DESC",
$limit, 0, ("SELECT COUNT(*) FROM {guestbook} WHERE recipient = %d"), $userid4, 2);
$entries = array();
while ($entry = db_fetch_array($results)) {
$entries[] = $entry;
}
$output = theme('guestbook', $userid4, $entries, $comment_entry, $limit, 2);
print $output;
Comments
Comment #1
walker2238 commentedSorry delete this post as I figured out it has nothing to do with the guestbook module.
Comment #2
sun