You are here

function guestbook_delete_entry_confirm in Guestbook 5.2

Same name and namespace in other branches
  1. 5 guestbook.module \guestbook_delete_entry_confirm()
  2. 6.2 guestbook.module \guestbook_delete_entry_confirm()
  3. 6 guestbook.module \guestbook_delete_entry_confirm()
  4. 7.2 guestbook.module \guestbook_delete_entry_confirm()
1 string reference to 'guestbook_delete_entry_confirm'
guestbook_delete_entry_confirm_page in ./guestbook.module

File

./guestbook.module, line 658

Code

function guestbook_delete_entry_confirm($uid, $entry_id) {
  $entry = db_fetch_array(db_query("SELECT g.*, u1.name, u1.data, u1.picture, u2.name as commentby \n    FROM {guestbook} g \n    LEFT JOIN {users} u1 ON g.author = u1.uid \n    LEFT JOIN {users} u2 ON g.commentauthor = u2.uid \n    WHERE g.id = %d", $entry_id));
  $form = array();
  $form['entry_id'] = array(
    '#type' => 'value',
    '#value' => $entry_id,
  );
  $form['uid'] = array(
    '#type' => 'value',
    '#value' => $uid,
  );
  $form['#redirect'] = !empty($_GET['destination']) ? $_GET['destination'] : 'guestbook/' . $uid;
  return confirm_form($form, t('Are you sure you want to delete this guestbook entry?'), !empty($_GET['destination']) ? $_GET['destination'] : referer_uri(), theme('guestbook_entry', $uid, $entry, NULL, NULL, TRUE), t('Delete'), t('Cancel'));
}