if ($value == 'uc_key') { //echo $localuc;exit; if (strexists(UC_API, $_G['siteurl']) && $localuc == 1) { //local ucenter $newuc_mykey = UC_MYKEY; //更新到UCenter配置文件 $newuc_uckey = UC_KEY; //更新到UCenter配置文件 $newapp_authkey = generate_key(); //更新到 Discuz! UC配置文件 $newapp_appkey = authcode($newapp_authkey, 'ENCODE', $newuc_mykey); //更新到UCenter数据库 $newapp_appkey = daddslashes($newapp_appkey); //echo $newcu_mykey;exit; $ucdb = new db_mysql(); $ucdblink = $ucdb->_dbconnect(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBCHARSET, UC_DBNAME); $apptablename = UC_DBTABLEPRE . 'applications'; // $a = $ucdb->query("SELECT appid,authkey FROM $apptablename"); // $apparray = array(); // while($data = $ucdb->fetch_array($a)){ // $apparray[] = $data; // } //echo UC_DBTABLEPRE;exit; $uc_dbtablepre = UC_DBTABLEPRE; $ucconfig = array($newapp_authkey, UC_APPID, UC_DBHOST, UC_DBNAME, UC_DBUSER, UC_DBPW, UC_DBCHARSET, $uc_dbtablepre, UC_CHARSET, UC_API, UC_IP); $ucconfig = @implode('|', $ucconfig); save_uc_config($ucconfig, DISCUZ_ROOT . './config/config_ucenter.php'); $ucdb->query("UPDATE {$apptablename} SET authkey = '{$newapp_appkey}' WHERE appid = " . UC_APPID); //note } else { $cpmessage .= $toolslang['nlocaluc'];