} $data['checked']['closed'] = empty($thread_edit['threads_close']) ? '' : 'checked="checked" '; $data['checked']['notclosed'] = !empty($thread_edit['threads_close']) ? '' : 'checked="checked" '; } //rename if (!empty($_POST['rename'])) { $data['if']['rename'] = TRUE; $data['val']['thread_headline'] = $thread_headline; } echo cs_subtemplate(__FILE__, $data, 'board', 'modpanel_q'); } else { cs_redirect($cs_lang['mark_all'], 'board', 'thread', 'where=' . $thread_id); } //Daten verarbeiten und in SQL Eintragen if (!empty($thread_cells) and !empty($thread_save)) { cs_sql_update(__FILE__, 'threads', $thread_cells, $thread_save, $thread_id); if (!empty($update_board)) { include_once 'mods/board/repair.php'; cs_board_last($board_id); } if (isset($board_new_id)) { //Update board entry to get correct threads and comments count include_once 'mods/board/repair.php'; cs_board_threads($board_id); cs_board_comments($board_id); cs_board_threads($board_new_id); cs_board_comments($board_new_id); cs_board_last($board_id); } cs_redirect($action_lang, 'board', 'thread', 'where=' . $thread_id); }
$query = "DELETE FROM {pre}_comments WHERE comments_mod='board' AND "; $query .= "comments_fid=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_abonements WHERE threads_id=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_boardfiles WHERE threads_id=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_boardvotes WHERE threads_id=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_voted WHERE voted_mod='board' AND "; $query .= "voted_fid=" . (int) $thread_id; cs_sql_query(__FILE__, $query); // Delete Ghostlinks $query = "DELETE FROM {pre}_threads WHERE threads_ghost_thread = " . (int) $thread_id; cs_sql_query(__FILE__, $query); # Update board entry to get correct threads and comments count include_once 'mods/board/repair.php'; cs_board_threads($cs_thread['board_id']); cs_board_comments($cs_thread['board_id']); # Remove attached boardreports if there are any cs_sql_delete(__FILE__, 'boardreport', $thread_id, 'threads_id'); cs_cache_delete('count_boardreport'); cs_redirect($cs_lang['del_true'], 'board', 'listcat', 'where=' . $cs_thread['board_id']); } if (isset($_POST['cancel'])) { cs_redirect($cs_lang['del_false'], 'board', 'thread', 'where=' . $thread_id); } else { $data['head']['body'] = sprintf($cs_lang['del_thread_rly'], cs_secure($cs_thread['threads_headline'])); $data['thread']['id'] = $thread_id; echo cs_subtemplate(__FILE__, $data, 'board', 'thread_remove'); }
} // $query = 'DELETE FROM {pre}_boardfiles WHERE threads_id= ' . $thread_id; // cs_sql_query(__FILE__,$query); cs_sql_delete(__FILE__, 'boardfiles', $thread_id, 'threads_id'); } } else { $cs_board_id = $cs_board['board_id']; // $query = "UPDATE {pre}_threads SET board_id='$cs_board_id' "; // $query .= "WHERE board_id = '$board_id'"; // cs_sql_query(__FILE__,$query); cs_sql_update(__FILE__, 'threads', array('board_id'), array($cs_board_id), 0, 'board_id = ' . $board_id); # Update board entry to get correct threads and comments count include_once 'mods/board/repair.php'; cs_board_threads($cs_board_id); cs_board_last($cs_board_id); cs_board_comments($cs_board_id); } cs_redirect($cs_lang['del_true'], 'board'); } if (isset($_POST['cancel'])) { $board_form = 0; cs_redirect($cs_lang['del_false'], 'board'); } if (!empty($board_form)) { $data['action']['form'] = cs_url('board', 'remove'); $data['lang']['body'] = sprintf($cs_lang['del_rly'], $board_id); if (!empty($threads_loop)) { $data['if']['threads_loop'] = true; $cs_board['change_threads'] = 0; if ($cs_board['change_threads'] == 0) { $data['remove']['checked'] = '';
for ($run = 0; $run < $run_loop_files; $run++) { $num = $run + 1; $files_cells = array('users_id', 'threads_id', 'comments_id', 'boardfiles_time', 'boardfiles_name'); $files_save = array($users_id, $fid, $idnow, cs_time(), $file_name[$num]); cs_sql_insert(__FILE__, 'boardfiles', $files_cells, $files_save); $files_select_new_id = cs_sql_insertid(__FILE__); $ext = substr($file_name[$num], strlen($file_name[$num]) + 1 - strlen(strrchr($file_name[$num], '.'))); $path = $cs_main['def_path'] . '/uploads/board/files/'; $target = $path . $file_upload_name[$num]; $target2 = $path . $files_select_new_id . '.' . $ext; $fileHand = fopen($target, 'r'); fclose($fileHand); rename($target, $target2); } include_once 'mods/board/repair.php'; cs_board_comments($data['thread']['board_id']); cs_threads_comments($data['thread']['threads_id']); if (!empty($close_now) and !empty($acc_close)) { $close_cells = array('threads_close'); $close_save = array($account['users_id']); cs_sql_update(__FILE__, 'threads', $close_cells, $close_save, $data['thread']['threads_id']); } // START Abo-Mail $from = "abonements abo LEFT JOIN {pre}_read red ON (abo.users_id = red.users_id AND abo.threads_id = red.threads_id)\n INNER JOIN {pre}_users usr ON abo.users_id = usr.users_id"; $where = 'abo.threads_id = ' . $data['thread']['threads_id'] . ' AND abo.users_id != ' . $account['users_id'] . ' AND usr.users_delete != 1 AND usr.users_abomail = 1'; $abo_users = cs_sql_select(__FILE__, $from, 'abo.abonements_id, usr.users_lang, usr.users_email', $where, 0, 0, 0); $abo['count'] = empty($abo_users) ? 0 : count($abo_users); $abo_lang[$account['users_lang']]['text'] = $cs_lang['abo_mail_text'];