$v) { ${$k} = $v; } switch (trim($mode)) { case 'editforum': $myts =& MyTextSanitizer::getInstance(); if ( isset($HTTP_POST_VARS['save']) && $HTTP_POST_VARS['save'] != "" ) { if ( !$HTTP_POST_VARS['delete'] ) { $name = $myts->makeTboxData4Save($HTTP_POST_VARS['name']); $desc = $myts->makeTareaData4Save($HTTP_POST_VARS['desc']); $sql = sprintf("UPDATE %s SET forum_name = '%s', forum_desc = '%s', forum_type = '%s', cat_id = %u, forum_access = %u, allow_html = '%s', allow_sig = '%s', posts_per_page = %u, hot_threshold = %u, topics_per_page = %u WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $name, $desc, $type, $cat, $forum_access, $html, $sig, $ppp, $hot, $tpp, $forum); if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } $count = 0; if ( isset($HTTP_POST_VARS["mods"]) ) { while ( list($null, $mod) = each($HTTP_POST_VARS["mods"]) ) { $mod_data = new XoopsUser($mod); if ( $mod_data->isActive() ) { $sql = sprintf("INSERT INTO %s (forum_id, user_id) VALUES (%u, %u)", $xoopsDB->prefix("bb_forum_mods"), $forum, $mod); if ( !$xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } } } } if ( !isset($mods) ) { $current_mods = "SELECT count(*) AS total FROM ".$xoopsDB->prefix("bb_forum_mods")." WHERE forum_id = $forum"; $r = $xoopsDB->query($current_mods); list($total) = $xoopsDB->fetchRow($r); } else { $total = count($mods) + 1; } if ( isset($rem_mods) && $total > 1 ) { while ( list($null, $mod) = each($HTTP_POST_VARS["rem_mods"]) ) { $sql = sprintf("DELETE FROM %s WHERE forum_id = %u AND user_id = %u", $xoopsDB->prefix("bb_forum_mods"), $forum, $mod); if ( !$xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } } } else { if ( isset($rem_mods) ) { $mod_not_removed = 1; } } if ( $mod_not_removed ) { redirect_header("./index.php", 1, _MD_A_FORUMUPDATED."
"._MD_A_HTSMHNBRBITHBTWNLBAMOTF); }else{ redirect_header("./index.php", 1, _MD_A_FORUMUPDATED); } } else { $sql = "SELECT post_id FROM ".$xoopsDB->prefix("bb_posts")." WHERE forum_id = $forum"; if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } if ( $xoopsDB->getRowsNum($r) > 0 ) { $sql = "DELETE FROM ".$xoopsDB->prefix("bb_posts_text")." WHERE "; $looped = false; while ( $ids = $xoopsDB->fetchArray($r) ) { if ( $looped == true ) { $sql .= " OR "; } $sql .= "post_id = ".$ids["post_id"]." "; $looped = true; } if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_posts"), $forum); if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } } // RMV-NOTIFY xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'forum', $forum); // Get list of all topics in forum, to delete them too $sql = sprintf("SELECT topic_id FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_topics"), $forum); if ($r = $xoopsDB->query($sql)) { while ($row = $xoopsDB->fetchArray($r)) { xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'thread', $row['topic_id']); } } $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_topics"), $forum); if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_forums"), $forum); if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } $sql = sprintf("DELETE FROM %s WHERE forum_id = %u", $xoopsDB->prefix("bb_forum_mods"), $forum); if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } redirect_header("./index.php", 1, _MD_A_FORUMREMOVED); } } if ( isset($HTTP_POST_VARS['submit']) && !isset($HTTP_POST_VARS['save']) ) { $sql = "SELECT * FROM ".$xoopsDB->prefix("bb_forums")." WHERE forum_id = $forum"; if ( !$result = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } if ( !$myrow = $xoopsDB->fetchArray($result) ) { redirect_header("./index.php", 1, _MD_A_NOSUCHFORUM); } $name = $myts->makeTboxData4Edit($myrow['forum_name']); $desc = $myts->makeTareaData4Edit($myrow['forum_desc']); xoops_cp_header(); echo"" ."
"; echo "

"._MD_A_FORUMCONF."

"; ?>
Current:
prefix("users")." u, ".$xoopsDB->prefix("bb_forum_mods")." f WHERE f.forum_id = $forum AND u.uid = f.user_id"; if ( !$r = $xoopsDB->query($sql) ) { echo"
"; xoops_cp_footer(); exit(); } if ( $row = $xoopsDB->fetchArray($r) ) { do { echo $row['uname']." ( "._MD_A_REMOVE.")
"; $current_mods[] = $row['uid']; } while ( $row = $xoopsDB->fetchArray($r) ); echo "
"; } else { echo _MD_A_NOMODERATORASSIGNED."

\n"; } ?> Add:
"; xoops_cp_footer(); exit(); } if ( $row = $xoopsDB->fetchArray($r) ) { do { $s = ""; if ( $row['uid'] == $myrow['forum_moderator'] ) { $s = "SELECTED"; } echo "\n"; } while ( $row = $xoopsDB->fetchArray($r) ); } else { echo "\n"; } ?>
"; xoops_cp_footer(); exit(); } if ( $row = $xoopsDB->fetchArray($r) ) { do { $s = ""; if ( $row['cat_id'] == $myrow['cat_id'] ) { $s = "SELECTED"; } echo "\n"; } while ( $row = $xoopsDB->fetchArray($r) ); } else { echo "\n"; } ?> Access Level: ". _MD_A_ALLOWHTML ." "._MD_A_YES.""._MD_A_NO ." ". _MD_A_ALLOWSIGNATURES ." ". _MD_A_YES ."". _MD_A_NO ." ". _MD_A_HOTTOPICTHRESHOLD ." ". _MD_A_POSTPERPAGE ."
". _MD_A_TITNOPPTTWBDPPOT ." ". _MD_A_TOPICPERFORUM ."
". _MD_A_TITNOTPFTWBDPPOAF .""; echo "  "; echo ""; } if ( !isset($HTTP_POST_VARS['submit']) && !isset($HTTP_POST_VARS['save']) ) { xoops_cp_header(); echo"" ."
"; echo "

"._MD_A_FORUMCONF."

"; ?>
  
makeTboxData4Save($HTTP_POST_VARS['new_title']); $sql = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_title = '$new_title' WHERE cat_id = $cat_id"; if ( !$result = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } else { redirect_header("./index.php", 1, _MD_A_CATEGORYUPDATED); } } else if(isset($HTTP_POST_VARS['submit']) && $HTTP_POST_VARS['submit'] != "") { $sql = "SELECT cat_title FROM ".$xoopsDB->prefix("bb_categories")." WHERE cat_id = '$cat'"; if ( !$result = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } xoops_cp_header(); echo"" ."
"; echo "

"._MD_A_FORUMCONF."

"; $cat_data = $xoopsDB->fetchArray($result); $cat_title = $myts->makeTboxData4Edit($cat_data["cat_title"]); ?>
prefix("bb_categories")." ORDER BY cat_order"; if ( !$result = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } xoops_cp_header(); echo"" .""; ?>
"; echo "

"._MD_A_FORUMCONF."

"; ?>
  
prefix("bb_categories"), $cat); if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } redirect_header("./index.php", 1, _MD_A_CATEGORYDELETED); } else { xoops_cp_header(); echo"" ."
"; echo "

"._MD_A_FORUMCONF."

"; ?>
"; xoops_cp_footer(); exit(); } while ( $m = $xoopsDB->fetchArray($r) ) { echo "\n"; } ?>
genId($xoopsDB->prefix("bb_categories")."_cat_id_seq"); $sql = "SELECT max(cat_order) AS highest FROM ".$xoopsDB->prefix("bb_categories").""; if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } list($highest) = $xoopsDB->fetchRow($r); $highest++; $title = $myts->makeTboxData4Save($title); $sql = "INSERT INTO ".$xoopsDB->prefix("bb_categories")." (cat_id, cat_title, cat_order) VALUES ($nextid, '$title', '$highest')"; if ( !$result = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } redirect_header("./index.php", 1, _MD_A_CATEGORYCREATED); } else { xoops_cp_header(); echo"" ."
"; echo "

"._MD_A_FORUMCONF."

"; ?>
  
" ."
"; echo "

"._MD_A_FORUMCONF."

"; echo _MD_A_YDNFOATPOTFDYAA; echo"
"; xoops_cp_footer(); exit(); } $desc = $myts->makeTareaData4Save($HTTP_POST_VARS['desc']); $name = $myts->makeTboxData4Save($HTTP_POST_VARS['name']); $html = intval($HTTP_POST_VARS['html']); $sig = intval($HTTP_POST_VARS['sig']); $ppp = intval($HTTP_POST_VARS['ppp']); $hot = intval($HTTP_POST_VARS['hot']); $tpp = intval($HTTP_POST_VARS['tpp']); $nextid = $xoopsDB->genId($xoopsDB->prefix("bb_forums")."_forum_id_seq"); $sql = "INSERT INTO ".$xoopsDB->prefix("bb_forums")." (forum_id, forum_name, forum_desc, forum_access, cat_id, forum_type, allow_html, allow_sig,posts_per_page,hot_threshold,topics_per_page) VALUES ($nextid, '$name', '$desc', $forum_access, $cat, $type, '$html', '$sig', $ppp, $hot, $tpp)"; if ( !$result = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } if ( $nextid == 0 ) { $nextid = $xoopsDB->getInsertId(); } // RMV-NOTIFY $tags = array(); $tags['FORUM_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $nextid; $tags['FORUM_NAME'] = $name; $tags['FORUM_DESCRIPTION'] = $desc; $notification_handler =& xoops_gethandler('notification'); $notification_handler->triggerEvents('global', 0, 'new_forum', $tags); $count = 0; while ( list($mod_number, $mod) = each($HTTP_POST_VARS["mods"]) ) { $mod_data = new XoopsUser($mod); if ( $mod_data->isActive() && $mod_data->level() < 2 ) { if ( !isset($user_query) ) { $user_query = "UPDATE ".$xoopsDB->prefix("users")." SET level = 2 WHERE "; } if ( $count > 0 ) { $user_query .= "OR "; } $user_query .= "uid = $mod "; $count++; } $mod_query = "INSERT INTO ".$xoopsDB->prefix("bb_forum_mods")." (forum_id, user_id) VALUES ($nextid, $mod)"; if ( !$xoopsDB->query($mod_query) ) { redirect_header("./index.php", 1); exit(); } } if ( isset($user_query) ) { if ( !$xoopsDB->query($user_query) ) { redirect_header("./index.php", 1); exit(); } } redirect_header("./index.php", 1, _MD_A_FORUMCREATED); } else { $sql = "SELECT count(*) AS total FROM ".$xoopsDB->prefix("bb_categories").""; if ( !$r = $xoopsDB->query($sql) ) { redirect_header("./index.php", 1); exit(); } xoops_cp_header(); echo"" ."
"; echo "

"._MD_A_FORUMCONF."

"; list($total) = $xoopsDB->fetchRow($r); if ( $total < 1 || !isset($total) ) { echo _MD_A_EYMAACBYAF; echo"
"; xoops_cp_footer(); exit(); } ?>
"; xoops_cp_footer(); exit(); } if ( $myrow = $xoopsDB->fetchArray($result) ) { do { echo "\n"; } while ( $myrow = $xoopsDB->fetchArray($result) ); } else { echo "\n"; } ?>
"; xoops_cp_footer(); exit(); } if ( $myrow = $xoopsDB->fetchArray($result) ) { do { echo "\n"; } while ( $myrow = $xoopsDB->fetchArray($result) ); } else { echo "\n"; } ?>
". _MD_A_ALLOWHTML ." "._MD_A_YES.""._MD_A_NO ."
". _MD_A_ALLOWSIGNATURES ." ". _MD_A_YES ."". _MD_A_NO ."
". _MD_A_HOTTOPICTHRESHOLD ."
". _MD_A_POSTPERPAGE ."
". _MD_A_TITNOPPTTWBDPPOT ."
". _MD_A_TOPICPERFORUM ."
". _MD_A_TITNOTPFTWBDPPOAF ."
  
" ."
"; echo "

"._MD_A_FORUMCONF."

"; // update catagories set cat_order = cat_order + 1 WHERE cat_order >= 2; update catagories set cat_order = cat_order - 2 where cat_id = 3; if ( isset($up) && $up != "" ) { if ( $current_order > 1 ) { $order = $current_order - 1; $sql1 = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $order WHERE cat_id = $cat_id"; if ( !$r = $xoopsDB->query($sql1) ) { echo"
"; xoops_cp_footer(); exit(); } $sql2 = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $current_order WHERE cat_id = $last_id"; if ( !$r = $xoopsDB->query($sql2) ) { echo""; xoops_cp_footer(); exit(); } echo "
"._MD_A_CATEGORYMOVEUP."

"; } else { echo "
"._MD_A_TCIATHU."

"; } } else if ( isset($down) && $down != "" ) { $sql = "SELECT cat_order FROM ".$xoopsDB->prefix("bb_categories")." ORDER BY cat_order DESC"; if ( !$r = $xoopsDB->query($sql,1,0) ) { echo""; xoops_cp_footer(); exit(); } list($last_number) = $xoopsDB->fetchRow($r); if ( $last_number != $current_order ) { $order = $current_order + 1; $sql = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $current_order WHERE cat_order = $order"; if ( !$r = $xoopsDB->query($sql) ) { echo""; xoops_cp_footer(); exit(); } $sql = "UPDATE ".$xoopsDB->prefix("bb_categories")." SET cat_order = $order where cat_id = $cat_id"; if ( !$r = $xoopsDB->query($sql) ) { echo""; xoops_cp_footer(); exit(); } echo "
"._MD_A_CATEGORYMOVEDOWN."

"; } else { echo "
"._MD_A_TCIATLD."

"; } } ?>
prefix("bb_categories")." ORDER BY cat_order"; if ( !$r = $xoopsDB->query($sql) ) { exit(); } while ( $m = $xoopsDB->fetchArray($r) ) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n\n"; $last_id = $m['cat_id']; } ?>


".$myts->makeTboxData4Show($m['cat_title'])."\n"; echo "\n"; echo "\n"; echo "
" .""; echo "

"._MD_A_FORUMCONF."

"; ?>
"; xoops_cp_footer(); ?>