Exemple #1
0
     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;
     }
 }