'0', 'wechat_qrtype' => '3', 'wechat_token' => random(16), 'wechat_allowregister' => '1', 'wechat_allowfastregister' => '1', 'wechat_disableregrule' => '1', 'wechat_float_qrcode' => '1', 'wechat_confirmtype' => '0', 'wechat_newusergroupid' => $_G['setting']['newusergroupid'], 'wsq_wapdefault' => 1, 'wsq_global_banner' => 1, ); require_once DISCUZ_ROOT.'./source/plugin/wechat/install/update.func.php'; runquery($sql); updatetable($sql); foreach($settingdefault as $_key => $_default) { if(!isset($setting[$_key])) { $setting[$_key] = $_default; } } $setting['RELEASE'] = PLUGIN_RELEASE; $settings = array('mobilewechat' => serialize($setting)); C::t('common_setting')->update_batch($settings); C::t('common_plugin')->delete_by_identifier('mobileoem'); require_once DISCUZ_ROOT.'./source/plugin/wechat/wechat.lib.class.php'; $hook = WeChatHook::getAPIHook('wechat'); if(!$hook) { WeChatHook::updateAPIHook(array( array('forumdisplay_variables' => array('plugin' => 'wechat', 'include' => 'wsqapi.class.php', 'class' => 'WSQAPI', 'method' => 'forumdisplay_variables')), array('viewthread_variables' => array('plugin' => 'wechat', 'include' => 'wsqapi.class.php', 'class' => 'WSQAPI', 'method' => 'viewthread_variables')), )); } elseif($hook['wsqindex']) { WeChatHook::updateAPIHook(array( array('wsqindex_variables' => array('plugin' => 'wechat')), )); } DB::query("ALTER TABLE ".DB::table('forum_debatepost')." ADD INDEX `voters` (`tid`,`voters`)", 'SILENT'); $pluginupdated = true; } ?>