function cs_board_threads($board_id) { settype($board_id, 'integer'); $threads = cs_sql_count(__FILE__, 'threads', "board_id = '" . $board_id . "'"); $cells = array('board_threads'); $content = array($threads); cs_sql_update(__FILE__, 'board', $cells, $content, $board_id, 0, 0); cs_board_last($board_id); return $threads; }
} $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); }
$where .= " AND comments_mod = 'board'"; $before = cs_sql_count(__FILE__, 'comments', $where); $start = floor($before / $account['users_limit']) * $account['users_limit']; cs_sql_delete(__FILE__, 'comments', $comments_id); $update_last = cs_sql_select(__FILE__, 'comments', '*', "comments_fid = '" . $com_fid . "'", 'comments_time DESC', 0, 1); $cells = array('threads_last_time', 'threads_last_user'); if (empty($update_last['comments_time'])) { $saves = array((int) $cs_thread['threads_time'], (int) $cs_thread['users_id']); } else { $saves = array((int) $update_last['comments_time'], (int) $update_last['users_id']); } cs_sql_update(__FILE__, 'threads', $cells, $saves, $com_fid); # Update board entry to get correct threads and comments count include_once 'mods/board/repair.php'; cs_board_comments($cs_thread['board_id']); cs_board_last($cs_thread['board_id']); cs_threads_comments($com_fid); # Remove attached boardreport if there is one cs_sql_delete(__FILE__, 'boardreport', $comments_id, 'comments_id'); cs_cache_delete('count_boardreport'); $more = 'where=' . $com_fid . '&start=' . $start; cs_redirect($cs_lang['del_true'], 'board', 'thread', $more); } if (isset($_POST['cancel'])) { $options_board = cs_sql_option(__FILE__, 'board'); $where = "comments_fid = \"" . $com_fid . "\" AND comments_mod = 'board' AND comments_id <= \"" . $comments_id . "\""; $comnr = cs_sql_count(__FILE__, 'comments', $where); if ($options_board['sort'] == 'ASC') { $start = $comnr - $comnr % $account['users_limit']; } else { $where = "comments_fid = \"" . $com_fid . "\" AND comments_mod = 'board' AND comments_id > \"" . $comments_id . "\"";
if (empty($check_pw)) { $icon = 'password'; } else { $icon = 'board_read_'; } if (!empty($check_pw)) { if (isset($unread_array['' . $board['board_id'] . ''])) { $icon = 'board_unread_'; } } $board['icon'] = cs_html_img('symbols/board/' . $icon . '.png'); $board['board_text'] = cs_secure($board['board_text'], 1); # new - set board_last_* content if empty if (empty($board['board_last_threadid']) and !empty($board['board_threads'])) { include_once 'mods/board/repair.php'; $new = cs_board_last($board['board_id']); $board = is_array($new) ? array_merge($board, $new) : $board; } if (!empty($board['board_last_threadid']) and !empty($check_pw)) { $board['last_name'] = cs_secure($board['board_last_thread']); $board['board_last_id'] = $board['board_last_threadid']; if (empty($board['board_last_time'])) { $board['last_time'] = ''; } else { $board['last_time'] = cs_date('unix', $board['board_last_time'], 1); } if (empty($board['board_last_userid'])) { $board['last_usernick'] = empty($board['board_last_user']) ? '-' : cs_secure($board['board_last_user']); } else { $board['last_usernick'] = cs_user($board['board_last_userid'], $board['board_last_user']); }