Example #1
0
    `res_finish_at` int(10),
    PRIMARY KEY (`id`)
) ENGINE=InnoDB;

EOF;
    if (!defined('DISCUZ_VERSION')) {
        require './source/discuz_version.php';
    }
    $settingdefault = array('wechat_mtype' => '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;
}
Example #2
0
File: install.php Project: cwcw/cms
  `uid` mediumint(8) unsigned NOT NULL,
  `openid` char(32) NOT NULL default '',
  `status` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`uid`)
) ENGINE=MYISAM;

CREATE TABLE IF NOT EXISTS pre_mobile_wsq_threadlist (
  `skey` int(10) unsigned NOT NULL,
  `svalue` text NOT NULL,
  PRIMARY KEY (`skey`)
) ENGINE=MyISAM;

EOF;
if (!defined('DISCUZ_VERSION')) {
    require './source/discuz_version.php';
}
$settingdefault = array('wechat_mtype' => '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' => DISCUZ_VERSION == 'X2.5' ? 1 : 0);
runquery($sql);
$setting = $_G['setting']['mobilewechat'] ? (array) unserialize($_G['setting']['mobilewechat']) : array();
foreach ($settingdefault as $_key => $_default) {
    if (!isset($setting[$_key])) {
        $setting[$_key] = $_default;
    }
}
$settings = array('mobilewechat' => serialize($setting));
C::t('common_setting')->update_batch($settings);
require_once DISCUZ_ROOT . './source/plugin/wechat/wechat.lib.class.php';
if (!WeChatHook::getAPIHook('wechat')) {
    WeChatHook::updateAPIHook(array(array('wsqindex_variables' => array('plugin' => 'wechat', 'include' => 'wsqapi.class.php', 'class' => 'WSQAPI', 'method' => 'forumdisplay_variables')), 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'))));
}
$finish = TRUE;
Example #3
0
        foreach ($hooks as $hook => $rows) {
            foreach ($rows as $plugin => $row) {
                if (isset($_GET['order'][$page][$hook][$plugin])) {
                    $apihook[$page][$hook][$plugin]['order'] = $_GET['order'][$page][$hook][$plugin];
                }
                $apihook[$page][$hook][$plugin]['allow'] = !empty($_GET['allow'][$page][$hook][$plugin]) ? 1 : 0;
            }
            uasort($apihook[$page][$hook], 'pluginapicmp');
        }
    }
    $settings = array('mobileapihook' => serialize($apihook));
    C::t('common_setting')->update_batch($settings);
    updatecache('setting');
}
showtips(lang('plugin/wechat', 'wechatapi_tips'));
$apihook = WeChatHook::getAPIHook();
$plugins = DB::fetch_all('SELECT identifier, name FROM %t', array('common_plugin'), 'identifier');
showformheader('plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=api_setting');
showtableheader(lang('plugin/wechat', 'api_wsq'));
echo '<tr class="header"><th>' . lang('plugin/wechat', 'api_hook') . '</th><th>' . cplang('plugins_name') . '</th><th>' . cplang('enable') . '/' . cplang('display_order') . '</th><th>' . lang('plugin/wechat', 'api_method') . '</th></tr>';
foreach ($apihook as $page => $hooks) {
    foreach ($hooks as $hook => $rows) {
        $i = 0;
        foreach ($rows as $plugin => $row) {
            if (!$plugins[$plugin]) {
                $deleteplugins[] = $plugin;
            }
            $row['plugin'] = $plugin;
            echo '<tr class="hover"><td>' . (!$i ? $page . '_' . $hook : '') . '</td>' . '<td>' . $plugins[$plugin]['name'] . '</td>' . '<td><input class="checkbox" type="checkbox" name="allow[' . $page . '][' . $hook . '][' . $plugin . ']" value="1"' . ($row['allow'] ? ' checked' : '') . '>' . ($hook != 'variables' ? '<input class="txt num" type="text" name="order[' . $page . '][' . $hook . '][' . $plugin . ']" value="' . $row['order'] . '"></td>' : '</td>') . '<td>' . formathook($row) . '</td></tr>';
            $i++;
        }