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

walker2238’s picture

Sorry delete this post as I figured out it has nothing to do with the guestbook module.

sun’s picture

Status: Active » Closed (fixed)