Exemplo n.º 1
0
 /**
  *  Save forum config
  * 
  * @since Version 2.5.8
  */
 function do_config_forum()
 {
     global $wgRequest, $wgOut, $awc, $table_1, $awcs_forum_config;
     if (UserPerm != 10) {
         die("Nope - Admin");
     }
     $dbr = wfGetDB(DB_SLAVE);
     $dbw = wfGetDB(DB_MASTER);
     #$yes_wikiedit = true;
     # use this to see is WIki's User Table has the user_editcount feild
     $table_1 = $dbr->tableName('user');
     $dBaseCLS = new awcforum_cls_dBase();
     $yes_wikiedit = $dBaseCLS->colCheck($table_1, 'user_editcount');
     foreach ($awcs_forum_config as $q => $a) {
         $a = $wgRequest->getVal($q);
         if ($q != 'cf_forumversion' && $q != 'cf_forumlang') {
             if ($wgRequest->getVal($q) != '') {
                 if ($q == 'cf_css_default') {
                     $css = explode('|', $a);
                     $a = serialize(array('Default' => $css[0]));
                 }
                 if ($q == 'cf__forumsubtitle' || $q == 'cf__forumname') {
                     $a = awcsforum_funcs::awc_htmlentities($a);
                 }
                 $dbw->update('awc_f_config', array('a' => $a), array('q' => $q), '');
             }
         }
     }
     // check what wiki ver this aplies to... might be older, if so elete.
     # no user_editcount feild, so reste Forum Config for the "Show Wiki Edits"
     if ($yes_wikiedit == false) {
         $dbw->update('awc_f_config', array('a' => 'no'), array('q' => 'wikieits'), '');
     }
     $wgOut->redirect(awc_url . "admin");
 }