cpmsg('albumcategory_catgory_not_found', '', 'error'); } if (!submitcheck('deletesubmit')) { $a_count = DB::result_first('SELECT COUNT(*) FROM ' . DB::table('home_album') . " WHERE catid = '{$_GET['catid']}'"); if (!$a_count && empty($category[$_GET[catid]]['children'])) { DB::query('DELETE FROM ' . DB::table('home_album_category') . " WHERE catid = '{$_GET['catid']}'"); cpmsg('albumcategory_delete_succeed', 'action=albumcategory', 'succeed'); } shownav('album', 'albumcategory'); showsubmenu('albumcategory', array(array('list', 'albumcategory', 0), array('delete', 'albumcategory&operation=delete&catid=' . $_GET['catid'], 1))); showformheader('albumcategory&operation=delete&catid=' . $_GET['catid']); showtableheader(); if ($category[$_GET[catid]]['children']) { showsetting('albumcategory_subcategory_moveto', '', '', '<input type="radio" name="subcat_op" value="trash" id="subcat_op_trash" checked="checked" />' . '<label for="subcat_op_trash" />' . cplang('albumcategory_subcategory_moveto_trash') . '</label>' . '<input type="radio" name="subcat_op" value="parent" id="subcat_op_parent" checked="checked" />' . '<label for="subcat_op_parent" />' . cplang('albumcategory_subcategory_moveto_parent') . '</label>'); } showsetting('albumcategory_article_moveto', '', '', showmovetocategoryselect('tocatid', $category[$_GET['catid']]['upid'])); showsubmit('deletesubmit'); showtablefooter(); showformfooter(); } else { if ($_POST['tocatid'] == $_GET['catid']) { cpmsg('albumcategory_move_category_failed', 'action=albumcategory', 'error'); } $delids = array($_GET['catid']); if ($category[$_GET['catid']]['children']) { if ($_POST['subcat_op'] == 'parent') { $upid = intval($category[$_GET['catid']]['upid']); DB::query('UPDATE ' . DB::table('home_album_category') . " SET upid = '{$upid}' WHERE catid IN (" . dimplode($category[$_GET['catid']]['children']) . ')'); } else { $delids = array_merge($delids, $category[$_GET['catid']]['children']); foreach ($category[$_GET['catid']]['children'] as $id) {
cpmsg('blogcategory_catgory_not_found', '', 'error'); } if (!submitcheck('deletesubmit')) { $blog_count = DB::result_first('SELECT COUNT(*) FROM ' . DB::table('home_blog') . " WHERE catid = '{$_GET['catid']}'"); if (!$blog_count && empty($category[$_GET[catid]]['children'])) { DB::query('DELETE FROM ' . DB::table('home_blog_category') . " WHERE catid = '{$_GET['catid']}'"); cpmsg('blogcategory_delete_succeed', 'action=blogcategory', 'succeed'); } shownav('blog', 'blogcategory'); showsubmenu('blogcategory', array(array('list', 'blogcategory', 0), array('delete', 'blogcategory&operation=delete&catid=' . $_GET['catid'], 1))); showformheader('blogcategory&operation=delete&catid=' . $_GET['catid']); showtableheader(); if ($category[$_GET[catid]]['children']) { showsetting('blogcategory_subcategory_moveto', '', '', '<input type="radio" name="subcat_op" value="trash" id="subcat_op_trash" checked="checked" />' . '<label for="subcat_op_trash" />' . cplang('blogcategory_subcategory_moveto_trash') . '</label>' . '<input type="radio" name="subcat_op" value="parent" id="subcat_op_parent" checked="checked" />' . '<label for="subcat_op_parent" />' . cplang('blogcategory_subcategory_moveto_parent') . '</label>'); } showsetting('blogcategory_blog_moveto', '', '', showmovetocategoryselect('tocatid', $category[$_GET['catid']]['upid'])); showsubmit('deletesubmit'); showtablefooter(); showformfooter(); } else { if ($_POST['tocatid'] == $_GET['catid']) { cpmsg('blogcategory_move_category_failed', 'action=blogcategory', 'error'); } $delids = array($_GET['catid']); if ($category[$_GET['catid']]['children']) { if ($_POST['subcat_op'] == 'parent') { $upid = intval($category[$_GET['catid']]['upid']); DB::query('UPDATE ' . DB::table('home_blog_category') . " SET upid = '{$upid}' WHERE catid IN (" . dimplode($category[$_GET['catid']]['children']) . ')'); } else { $delids = array_merge($delids, $category[$_GET['catid']]['children']); foreach ($category[$_GET['catid']]['children'] as $id) {