예제 #1
0
        if ($v['enable']) {
            $setting['oauth'] = 1;
        }
        update_setting('oauth-' . $k, $v);
    }
    update_setting($moduleid, $setting);
    cache_module($moduleid);
    $ext_oauth = $setting['oauth'];
    if ($oauth['sina']['enable'] && $oauth['sina']['sync']) {
        $ext_oauth .= ',sina';
    }
    if ($oauth['qq']['enable'] && $oauth['qq']['sync']) {
        $ext_oauth .= ',qq';
    }
    $db->query("UPDATE {$DT_PRE}setting SET item_value='{$ext_oauth}' WHERE item_key='oauth' AND item='3'");
    cache_module(3);
    dmsg('更新成功', '?moduleid=' . $moduleid . '&file=' . $file . '&tab=' . $tab);
} else {
    extract(dhtmlspecialchars($MOD));
    cache_pay();
    $P = cache_read('pay.php');
    extract($P);
    cache_oauth();
    $O = cache_read('oauth.php');
    extract($O);
    $tenpay['keycode'] = pass_encode($tenpay['keycode']);
    $weixin['keycode'] = pass_encode($weixin['keycode']);
    $alipay['keycode'] = pass_encode($alipay['keycode']);
    $chinabank['keycode'] = pass_encode($chinabank['keycode']);
    $yeepay['keycode'] = pass_encode($yeepay['keycode']);
    $paypal['keycode'] = pass_encode($paypal['keycode']);
예제 #2
0
/*
	[Destoon B2B System] Copyright (c) 2008-2013 Destoon.COM
	This is NOT a freeware, use is subject to license.txt
*/
defined('IN_DESTOON') or exit('Access Denied');
$menus = array(array('系统首页', '?action=main'), array('修改密码', '?action=password'), array('信息统计', '?file=count'), array('商务中心', $MODULE[2]['linkurl'], 'target="_blank"'), array('网站首页', DT_PATH, 'target="_blank"'), array('安全退出', '?file=logout', 'target="_top" onclick="return confirm(\'确定要退出管理吗?\');"'));
if ($_admin > 1) {
    unset($menus[1]);
}
switch ($action) {
    case 'cache':
        isset($step) or $step = 0;
        if ($step == 1) {
            cache_clear('module');
            cache_module();
            msg('系统设置更新成功', '?action=' . $action . '&step=' . ($step + 1));
        } else {
            if ($step == 2) {
                cache_clear_tag(1);
                msg('标签调用缓存更新成功', '?action=' . $action . '&step=' . ($step + 1));
            } else {
                if ($step == 3) {
                    cache_clear('php', 'dir', 'tpl');
                    msg('模板缓存更新成功', '?action=' . $action . '&step=' . ($step + 1));
                } else {
                    if ($step == 4) {
                        cache_clear('cat');
                        cache_category();
                        msg('分类缓存更新成功', '?action=' . $action . '&step=' . ($step + 1));
                    } else {
예제 #3
0
$all = isset($all) ? intval($all) : 0;
if ($submit) {
    if ($setting['split']) {
        $setting['fulltext'] = 0;
        cache_write($moduleid . '.part', $moduleid);
    } else {
        cache_delete($moduleid . '.part');
    }
    foreach ($setting as $k => $v) {
        if (strpos($k, 'seo_') === false) {
            continue;
        }
        seo_check($v) or msg('SEO信息包含非法字符');
    }
    update_setting($moduleid, $setting);
    cache_module($moduleid);
    if ($setting['php_list_urlid'] != $MOD['php_list_urlid'] || $setting['htm_list_urlid'] != $MOD['htm_list_urlid'] || $setting['htm_list_prefix'] != $MOD['htm_list_prefix'] || $setting['list_html'] != $MOD['list_html']) {
        $_MOD = $MOD;
        $MOD = $setting;
        $result = $db->query("SELECT * FROM {$DT_PRE}category WHERE moduleid={$moduleid}");
        while ($r = $db->fetch_array($result)) {
            update_category($r);
        }
        cache_category($moduleid);
        $MOD = $_MOD;
    }
    if ($setting['php_item_urlid'] != $MOD['php_item_urlid'] || $setting['htm_item_urlid'] != $MOD['htm_item_urlid'] || $setting['htm_item_prefix'] != $MOD['htm_item_prefix'] || $setting['show_html'] != $MOD['show_html']) {
        msg('设置保存成功,开始更新地址', '?moduleid=' . $moduleid . '&file=html&action=show&update=1&num=1000');
    }
    dmsg('更新成功', '?moduleid=' . $moduleid . '&file=' . $file . '&tab=' . $tab);
} else {
예제 #4
0
function cache_module($moduleid = 0)
{
    global $db;
    if ($moduleid) {
        $r = $db->get_one("SELECT * FROM {$db->pre}module WHERE disabled=0 AND moduleid='{$moduleid}'");
        $setting = array();
        $setting = get_setting($moduleid);
        if (isset($setting['seo_title_index'])) {
            $setting['title_index'] = seo_title($setting['seo_title_index']);
        }
        if (isset($setting['seo_title_list'])) {
            $setting['title_list'] = seo_title($setting['seo_title_list']);
        }
        if (isset($setting['seo_title_show'])) {
            $setting['title_show'] = seo_title($setting['seo_title_show']);
        }
        if (isset($setting['seo_keywords_index'])) {
            $setting['keywords_index'] = seo_title($setting['seo_keywords_index']);
        }
        if (isset($setting['seo_keywords_list'])) {
            $setting['keywords_list'] = seo_title($setting['seo_keywords_list']);
        }
        if (isset($setting['seo_keywords_show'])) {
            $setting['keywords_show'] = seo_title($setting['seo_keywords_show']);
        }
        if (isset($setting['seo_description_index'])) {
            $setting['description_index'] = seo_title($setting['seo_description_index']);
        }
        if (isset($setting['seo_description_list'])) {
            $setting['description_list'] = seo_title($setting['seo_description_list']);
        }
        if (isset($setting['seo_description_show'])) {
            $setting['description_show'] = seo_title($setting['seo_description_show']);
        }
        //cache_write('setting/module-'.$moduleid.'.php', $setting);
        $setting['moduleid'] = $moduleid;
        $setting['name'] = $r['name'];
        $setting['moduledir'] = $r['moduledir'];
        $setting['module'] = $r['module'];
        $setting['ismenu'] = $r['ismenu'];
        $setting['domain'] = $r['domain'];
        $setting['linkurl'] = $r['linkurl'];
        if ($moduleid == 3) {
            foreach ($setting as $k => $v) {
                if (strpos($k, '_domain') !== false) {
                    $e = str_replace('_domain', '', $k);
                    $key = $e . '_url';
                    $setting[$key] = $v ? $v : DT_PATH . $e . '/';
                }
            }
        }
        cache_write('module-' . $moduleid . '.php', $setting);
        if (isset($setting['split'])) {
            if ($setting['split']) {
                cache_write($moduleid . '.part', $moduleid);
            } else {
                cache_delete($moduleid . '.part');
            }
        }
        return true;
    } else {
        $result = $db->query("SELECT moduleid,module,name,moduledir,domain,linkurl,style,listorder,islink,ismenu,isblank,logo FROM {$db->pre}module WHERE disabled=0 ORDER by listorder asc,moduleid desc");
        $CACHE = array();
        $modules = array();
        while ($r = $db->fetch_array($result)) {
            if (!$r['islink']) {
                $linkurl = $r['domain'] ? $r['domain'] : linkurl($r['moduledir'] . '/');
                if ($r['moduleid'] == 1) {
                    $linkurl = DT_PATH;
                }
                if ($linkurl != $r['linkurl']) {
                    $r['linkurl'] = $linkurl;
                    $db->query("UPDATE {$db->pre}module SET linkurl='{$linkurl}' WHERE moduleid='{$r['moduleid']}' ");
                }
                cache_module($r['moduleid']);
            }
            $modules[$r['moduleid']] = $r;
        }
        $CACHE['module'] = $modules;
        $CACHE['dt'] = cache_read('module-1.php');
        cache_write('module.php', $CACHE);
    }
}