Esempio n. 1
0
         $smarty->assign('category', $category);
         $smarty->assign('posting_mode', 1);
     } else {
         $smarty->assign('no_authorisation', 'no_authorisation_delete');
     }
     $smarty->assign('name_repl_subnav', htmlspecialchars(stripslashes($field['name'])));
     $backlink = 'entry';
     $subnav_link = array('mode' => $back, 'id' => intval($_REQUEST['delete_posting']), 'title' => 'back_to_entry_link_title', 'name' => 'back_to_entry_link');
     $smarty->assign("subnav_link", $subnav_link);
     $smarty->assign('subtemplate', 'posting_delete.tpl.inc');
     break;
 case 'delete_posting_confirmed':
     $delete_check_result = mysql_query("SELECT pid, name, subject, user_id, UNIX_TIMESTAMP(time) AS time, UNIX_TIMESTAMP(time + INTERVAL " . $time_difference . " MINUTE) AS disp_time, locked, edit_key FROM " . $db_settings['forum_table'] . " WHERE id = " . intval($_REQUEST['delete_posting']), $connid) or raise_error('database_error', mysql_error());
     $field = mysql_fetch_array($delete_check_result);
     mysql_free_result($delete_check_result);
     $authorization = get_edit_authorization(intval($_REQUEST['delete_posting']), $field['user_id'], $field['edit_key'], $field['time'], $field['locked']);
     if ($authorization['delete'] == true) {
         if (isset($_REQUEST['back'])) {
             $result = @mysql_query("SELECT pid FROM " . $db_settings['forum_table'] . " WHERE id=" . intval($_REQUEST['delete_posting']) . " LIMIT 1", $connid) or raise_error('database_error', mysql_error());
             if (mysql_num_rows($result) == 1) {
                 $data = mysql_fetch_array($result);
                 if ($data['pid'] != 0) {
                     $pid = $data['pid'];
                 }
             }
         }
         delete_posting_recursive($_REQUEST['delete_posting']);
         if (isset($_REQUEST['back']) && $_REQUEST['back'] == 'entry' && isset($pid)) {
             header('Location: index.php?id=' . $pid);
         } elseif (isset($_REQUEST['back']) && $_REQUEST['back'] == 'thread' && isset($pid)) {
             header('Location: index.php?mode=thread&id=' . $pid);
Esempio n. 2
0
     if (isset($tags_array)) {
         $data['tags'] = $tags_array;
     }
 }
 $data['formated_time'] = format_time($lang['time_format_full'], $data['disp_time']);
 if ($data['user_id'] > 0) {
     if (!$data['user_name']) {
         $data['name'] = $lang['unknown_user'];
     } else {
         $data['name'] = htmlspecialchars(stripslashes($data['user_name']));
     }
 } else {
     $data['name'] = htmlspecialchars(stripslashes($data['name']));
 }
 $data['subject'] = htmlspecialchars(stripslashes($data['subject']));
 $authorization = get_edit_authorization($data['id'], $data['user_id'], $data['edit_key'], $data['time'], $data['locked']);
 if ($authorization['edit'] == true) {
     $data['edit_authorization'] = true;
 }
 if ($authorization['delete'] == true) {
     $data['delete_authorization'] = true;
 }
 if ($data['user_id'] > 0) {
     $data['email'] = $data['user_email'];
     $data['location'] = $data['user_location'];
     $data['hp'] = $data['user_hp'];
     if ($settings['avatars'] == 2) {
         if (file_exists('images/avatars/' . $data['user_id'] . '.jpg')) {
             $avatar['image'] = 'images/avatars/' . $data['user_id'] . '.jpg';
         } elseif (file_exists('images/avatars/' . $data['user_id'] . '.png')) {
             $avatar['image'] = 'images/avatars/' . $data['user_id'] . '.png';
Esempio n. 3
0
$smarty->assign('subject', htmlspecialchars(stripslashes($entrydata['subject'])));
if ($entrydata['user_id'] > 0) {
    if (!$entrydata['user_name']) {
        $name = $lang['unknown_user'];
    } else {
        $name = htmlspecialchars(stripslashes($entrydata['user_name']));
    }
} else {
    $name = htmlspecialchars(stripslashes($entrydata['name']));
}
$smarty->assign('name', $name);
$smarty->assign('user_type', $entrydata['user_type']);
$smarty->assign('disp_time', $entrydata['disp_time']);
$smarty->assign('formated_time', $entrydata['formated_time']);
$smarty->assign('locked', $entrydata['locked']);
$authorization = get_edit_authorization($id, $entrydata['user_id'], $entrydata['edit_key'], $entrydata['time'], $entrydata['locked']);
if ($authorization['edit'] == true) {
    $smarty->assign('edit_authorization', true);
}
if ($authorization['delete'] == true) {
    $smarty->assign('delete_authorization', true);
}
if (isset($direct_replies)) {
    $smarty->assign('direct_replies', $direct_replies);
}
if ($settings['count_views'] == 1) {
    $views = $entrydata['views'] - 1;
    // this subtracts the first view by the author after posting
    if ($views < 0) {
        $views = 0;
    }