if (isset($_POST['save_cat'])) {
$cat_name = trim(stripinput($_POST['cat_name']));
if ($cat_name != "") {
if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "cat")) {
$result = dbquery("UPDATE ".DB_FORUMS." SET forum_name='$cat_name' WHERE forum_id='".$_GET['forum_id']."'");
redirect(FUSION_SELF.$aidlink."&status=savecu");
} else {
$cat_order = isnum($_POST['cat_order']) ? $_POST['cat_order'] : "";
if(!$cat_order) $cat_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".DB_FORUMS." WHERE forum_cat='0'"),0)+1;
$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_cat='0' AND forum_order>='$cat_order'");
$result = dbquery("INSERT INTO ".DB_FORUMS." (forum_cat, forum_name, preferred, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_poll, forum_vote, forum_attach, forum_lastpost, forum_lastuser) VALUES ('0', '$cat_name', '','$cat_order', '', '', '0', '0', '0', '0', '0', '0', '0', '0')");
redirect(FUSION_SELF.$aidlink."&status=savecn");
}
} else {
redirect(FUSION_SELF.$aidlink."&status=savect");
}
} elseif (isset($_POST['save_forum'])) {
$forum_name = trim(stripinput($_POST['forum_name']));
$forum_description = trim(stripinput($_POST['forum_description']));
$forum_cat = isnum($_POST['forum_cat']) ? $_POST['forum_cat'] : 0;
if ($forum_name != "") {
if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "forum")) {
$forum_mods = $_POST['forum_mods'];
$forum_access = isnum($_POST['forum_access']) ? $_POST['forum_access'] : 0;
$forum_post = isnum($_POST['forum_post']) ? $_POST['forum_post'] : 0;
$forum_reply = isnum($_POST['forum_reply']) ? $_POST['forum_reply'] : 0;
$forum_attach = isnum($_POST['forum_attach']) ? $_POST['forum_attach'] : 0;
$forum_attach_download = isnum($_POST['forum_attach_download']) ? $_POST['forum_attach_download'] : 0;
$forum_poll = isnum($_POST['forum_poll']) ? $_POST['forum_poll'] : 0;
$forum_vote = isnum($_POST['forum_vote']) ? $_POST['forum_vote'] : 0;
$forum_merge = (isset($_POST['forum_merge']) && isnum($_POST['forum_merge']) ? $_POST['forum_merge'] : 0);
$result = dbquery("UPDATE ".DB_FORUMS." SET forum_name='".$forum_name."', forum_cat='".$forum_cat."', forum_description='".$forum_description."', forum_moderators='".$forum_mods."', forum_access='".$forum_access."', forum_post='".$forum_post."', forum_reply='".$forum_reply."', forum_attach='".$forum_attach."', forum_attach_download='".$forum_attach_download."', forum_poll='".$forum_poll."', forum_vote='".$forum_vote."', forum_merge='".$forum_merge."' WHERE forum_id='".$_GET['forum_id']."'");
redirect(FUSION_SELF.$aidlink."&status=savefu");
} else {
$uniqueCheck = dbcount("(forum_id)", DB_FORUMS, "forum_cat='".$forum_cat."' AND forum_name='".$forum_name."'");
if ($uniqueCheck != 0) { redirect(FUSION_SELF.$aidlink."&status=saveft"); }
$forum_order = isnum($_POST['forum_order']) ? $_POST['forum_order'] : "";
if(!$forum_order) $forum_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".DB_FORUMS." WHERE forum_cat='$forum_cat'"),0)+1;
$result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'");
$result = dbquery("INSERT INTO ".DB_FORUMS." (forum_cat, forum_name, preferred, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_attach, forum_attach_download, forum_poll, forum_vote, forum_lastpost, forum_lastuser, forum_merge) VALUES ('".$forum_cat."', '".$forum_name."', '0','".$forum_order."', '".$forum_description."', '103', '101', '101', '101', '0', '0', '0', '0', '0', '0', '0')");
redirect(FUSION_SELF.$aidlink."&status=savefn");
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
1 participant
Notifications
You are not receiving notifications from this thread.
Related Questions