예제 #1
0
파일: install.php 프로젝트: v998/dsu
) ENGINE=MyISAM;

CREATE TABLE `pre_dsu_vip_codes` (
   `code` char(32),
   `money` int(5),
   `only_once` tinyint(1) unsigned default '1',
   `exptime` int(10),
   UNIQUE KEY (`code`),
   KEY `exptime` (`exptime`)
) ENGINE=MyISAM;
INSERT INTO `pre_common_cron` SET available=1, type='system', name='[DSU] VIP', filename='cron_dsu_kkvip.php', weekday='-1', day='-1', hour=0, minute=0;
EOF;
switch ($_GET['step']) {
    default:
    case 'validator':
        $checkdata['key'][$_G['gp_dir']] = pluginvalidator($_G['gp_dir']);
        $check_result = pluginupgradecheck($checkdata);
        $result = $check_result[$_G['gp_dir']]['result'];
        $newver = $check_result[$_G['gp_dir']]['newver'];
        $param = array('id' => $_G['gp_dir'], 'newver' => $newver ? $newver : '', 'link' => "http://addons.discuz.com/?id={$_G[gp_dir]}");
        if ($result == '1') {
            cpmsg($installlang['step1_ok'], "{$request_url}&step=sql", 'loading');
        } elseif ($result == '2') {
            cpmsg($installlang['validator_new'], "{$request_url}&step=sql", 'form', $param);
        } else {
            cpmsg($installlang['validator_error'], "{$request_url}&step=sql", 'form', $param);
        }
        break;
    case 'sql':
        runquery($sql);
        require_once libfile('function/cache');
예제 #2
0
                cpmsg('plugins_edit_vars_invalid', '', 'error');
            }
        }
        DB::query("UPDATE " . DB::table('common_pluginvar') . " SET title='{$titlenew}', description='{$descriptionnew}', type='{$_G['gp_typenew']}', variable='{$variablenew}', extra='{$extranew}' WHERE pluginid='{$pluginid}' AND pluginvarid='{$pluginvarid}'");
        updatecache(array('plugin', 'setting', 'styles'));
        cpmsg('plugins_edit_vars_succeed', "action=plugins&operation=edit&pluginid={$pluginid}&anchor=vars", 'succeed');
    }
} elseif ($operation == 'validator') {
    $where = !empty($_G['gp_identifier']) ? "identifier='{$_G['gp_identifier']}'" : "1";
    $query = DB::query("SELECT pluginid, identifier, name, version, directory, modules FROM " . DB::table('common_plugin') . " WHERE {$where}");
    $plugins = $errarray = $newarray = $nowarray = array();
    if (!DB::num_rows($query)) {
        cpmsg('plugin_not_found', '', 'error');
    } else {
        while ($row = DB::fetch($query)) {
            if (ispluginkey($row['identifier']) && ($key = pluginvalidator($row['identifier']))) {
                $checkdata['key'][$row['identifier']] = $key;
            }
            $plugins[$row['identifier']] = $row['name'] . ' ' . $row['version'];
            $modules = unserialize($row['modules']);
            $file = DISCUZ_ROOT . './source/plugin/' . $row['identifier'] . '/discuz_plugin_' . $row['identifier'] . ($modules['extra']['installtype'] ? '_' . $modules['extra']['installtype'] : '') . '.xml';
            $upgrade = false;
            if (file_exists($file)) {
                $importtxt = @implode('', file($file));
                $pluginarray = getimportdata('Discuz! Plugin');
                $newver = !empty($pluginarray['plugin']['version']) ? $pluginarray['plugin']['version'] : 0;
                if ($newver > $row['version']) {
                    $upgrade = true;
                    $nowarray[] = '<a href="' . ADMINSCRIPT . '?action=plugins&operation=upgrade&pluginid=' . $row['pluginid'] . '">' . $plugins[$row['identifier']] . ' -> ' . $newver . '</a>';
                }
            }