if (isset($_REQUEST['item_id'])) { $item_id = (int) $_REQUEST['item_id']; //DELETE POSTS WITH ALL DATA $sql = "SELECT p.*, f.icon as f_icon\r\n\t\t\t\t\tFROM cms_forum_posts p, cms_forum_threads t, cms_forums f\r\n\t\t\t\t\tWHERE p.thread_id = t.id AND t.forum_id = f.id AND f.id = '{$item_id}'"; $rs = dbQuery($sql); if (mysql_num_rows($rs)) { while ($post = mysql_fetch_assoc($rs)) { uploadDeletePost(0, $post['id']); $inCore->deleteUploadImages($post['id'], 'forum'); } } $f_icon = $inDB->get_field('cms_forums', "id = '{$item_id}'", 'icon'); //DELETE THREADS dbQuery("DELETE FROM cms_forum_threads WHERE forum_id = '{$item_id}'"); //DELETE FORUM dbDeleteNS('cms_forums', $item_id); if (file_exists(PATH . '/upload/forum/cat_icons/' . $f_icon)) { @chmod(PATH . '/upload/forum/cat_icons/' . $f_icon, 0777); @unlink(PATH . '/upload/forum/cat_icons/' . $f_icon); } } $inCore->redirect('?view=components&do=config&id=' . $id . '&opt=list_forums'); } if ($opt == 'config') { require '../includes/jwtabs.php'; $GLOBALS['cp_page_head'][] = jwHeader(); ?> <form action="index.php?view=components&do=config&id=<?php echo $id; ?> " method="post" name="addform" target="_self" id="form1" style="margin-top:10px">
header('location:?view=components&do=config&id=' . (int) $_REQUEST['id'] . '&opt=list_cats'); } if ($opt == 'delete_cat') { if (isset($_REQUEST['item_id'])) { $id = (int) $_REQUEST['item_id']; $sql = "SELECT id, file FROM cms_board_items WHERE category_id = {$id}"; $result = dbQuery($sql); //DELETE ALL PHOTOS IN ALBUM if (mysql_num_rows($result)) { while ($photo = mysql_fetch_assoc($result)) { $model->deleteRecord($photo['id']); } } $f_icon = $inDB->get_field('cms_board_cats', "id = '{$id}'", 'icon'); //DELETE ALBUM dbDeleteNS('cms_board_cats', $id); if (file_exists(PATH . '/upload/board/cat_icons/' . $f_icon)) { @chmod(PATH . '/upload/board/cat_icons/' . $f_icon, 0777); @unlink(PATH . '/upload/board/cat_icons/' . $f_icon); } } header('location:?view=components&do=config&id=' . (int) $_REQUEST['id'] . '&opt=list_cats'); } if ($opt == 'update_cat') { if (isset($_REQUEST['item_id'])) { $id = (int) $_REQUEST['item_id']; $sql = "SELECT * FROM cms_board_cats WHERE id = '{$id}' LIMIT 1"; $result = dbQuery($sql); if (mysql_num_rows($result)) { $mod = mysql_fetch_assoc($result); $mod['icon'] = $mod['icon'] == 'folder_grey.png' ? '' : $mod['icon'];