} updatecache_f(); updateadmin(); $errorname && ($errorname = implode(',', $errorname)); adminmsg($errorname ? 'user_not_exists' : 'operate_success'); } elseif ($action == 'delete') { InitGP(array('fid')); if (empty($_POST['step'])) { include PrintEot('setforum'); exit; } else { $count = $db->get_value("SELECT COUNT(*) AS count FROM pw_forums WHERE fup=" . pwEscape($fid) . " AND type<>'category'"); if ($count) { adminmsg('forum_havesub'); } delforum($fid); P_unlink(D_P . 'data/bbscache/c_cache.php'); updatecache_f(); adminmsg('operate_success'); } } elseif ($action == 'credit') { InitGP(array('fid')); $rt = $db->get_one("SELECT fid FROM pw_forums WHERE fid=" . pwEscape($fid) . " AND type!='category'"); if (!$rt) { $basename = "{$admin_file}?adminjob=setforum&action=credit&fid={$fid}"; adminmsg('forum_not_exists'); } if (empty($_POST['step'])) { require_once R_P . 'require/credit.php'; $creditset = $db->get_value("SELECT creditset FROM pw_forumsextra WHERE fid=" . pwEscape($fid)); $creditset = $creditset ? unserialize($creditset) : array();
function forumDispatch($op) { require_once _base_ . '/lib/lib.urlmanager.php'; $url_man =& UrlManager::getInstance('forum'); $url_man->setStdQuery('index.php?modname=forum&op=forum'); switch ($op) { case "forum": forum(); break; //-----------------------------------------------// //-----------------------------------------------// case "addforum": addforum(); break; case "insforum": insforum(); break; //-----------------------------------------------// //-----------------------------------------------// case "modforum": modforum(); break; case "upforum": upforum(); break; case "downforum": moveforum($_GET['idForum'], 'down'); break; case "moveupforum": moveforum($_GET['idForum'], 'up'); break; case "modstatus": changestatus(); break; case "export": export(); break; //-----------------------------------------------// //-----------------------------------------------// case "delforum": delforum(); break; //-----------------------------------------------// //-----------------------------------------------// case "modforumaccess": modforumaccess(); break; //-----------------------------------------------// //-----------------------------------------------// case "thread": thread(); break; //-----------------------------------------------// //-----------------------------------------------// case "addthread": addthread(); break; case "insthread": insthread(); break; //-----------------------------------------------// //-----------------------------------------------// case "modthread": modthread(); break; case "movethread": $id_thread = importVar('id_thread', true, 0); $id_forum = importVar('id_forum', true, 0); moveThread($id_thread, $id_forum); break; case "upthread": upthread(); break; //-----------------------------------------------// //-----------------------------------------------// case "delthread": delthread(); break; //-----------------------------------------------// //-----------------------------------------------// case "message": message(); break; case "moderatemessage": moderatemessage(); break; case "modstatusthread": modstatusthread(); break; case "changeerased": changeerase(); break; //-----------------------------------------------// //-----------------------------------------------// case "addmessage": addmessage(); break; case "insmessage": insmessage(); break; //-----------------------------------------------// //-----------------------------------------------// case "modmessage": modmessage(); break; case "upmessage": upmessage(); break; //-----------------------------------------------// //-----------------------------------------------// case "delmessage": delmessage(); break; //-----------------------------------------------// //-----------------------------------------------// case "viewprofile": viewprofile(); break; //-----------------------------------------------// //-----------------------------------------------// case "editsema": editsema(); break; case "savesema": savesema(); break; //-----------------------------------------------// //-----------------------------------------------// case "download": checkPerm('view'); require_once _base_ . '/lib/lib.download.php'; //find file list($title, $attach) = sql_fetch_row(sql_query("\r\n\t\t\tSELECT title, attach\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_forummessage\r\n\t\t\tWHERE idMessage='" . (int) $_GET['id'] . "'")); if (!$attach) { $GLOBALS['page']->add(getErrorUi('Sorry, such file does not exist!'), 'content'); return; } //recognize mime type $expFileName = explode('.', $attach); $totPart = count($expFileName) - 1; $path = '/appLms/' . Get::sett('pathforum'); //send file sendFile($path, $attach, $expFileName[$totPart]); break; //-----------------------------------------------// //-----------------------------------------------// case "search": forumsearch(); break; case "searchmessage": forumsearchmessage(); break; //-----------------------------------------------// } }