示例#1
0
文件: map.php 项目: nitr0man/fiberms
function checkData()
{
    $res = PQuery('BEGIN WORK; LOCK "MapSettings";');
    if (isset($res['error'])) {
        return array('error' => $res['error']);
    }
    $query = 'SELECT * FROM "MapSettings"
                WHERE "LastChangedMap" >= "LastChangedTmpMap"';
    $res = PQuery($query);
    if (isset($res['error'])) {
        return array('error' => $res['error']);
    }
    if ($res['count'] == 1) {
        $res = dropTmpTables(true);
        $res = createTmpTables(true);
        setTmpMapLastEdit();
    } else {
        $res = createTmpTables(true);
    }
    $res = PQuery('COMMIT WORK');
    return array('error' => isset($res['error']) ? $res['error'] : false);
}
示例#2
0
    foreach ($tableSql['DROP'] as $sql) {
        $targetDb->query($sql);
    }
    foreach ($tableSql['CREATE'] as $sql) {
        $targetDb->query($sql);
    }
    foreach ($tableSql['UPDATE'] as $sql) {
        $targetDb->query($sql);
    }
    $targetDb->query("REPLACE INTO `pw_admin_role` (`id`, `name`, `auths`, `created_time`, `modified_time`) VALUES\n(1, '管理员', 'custom_set,config_site,config_nav,config_register,config_mobile,config_credit,config_editor,config_emotion,config_attachment,config_watermark,config_verifycode,config_seo,config_rewrite,config_domain,config_email,config_pay,config_area,config_school,u_groups,u_upgrade,u_manage,u_forbidden,u_check,bbs_article,contents_tag,contents_message,contents_report,bbs_contentcheck_forum,contentcheck_word,contents_user_tag,bbs_recycle,bbs_configbbs,bbs_setforum,bbs_setbbs,design_page,design_component,design_module,design_push,design_permissions,database_backup,cache_m,data_hook,cron_operations,log_manage,app_album,app_vote,app_medal,app_task,app_punch,app_link,app_message,app_announce,platform_server,platform_appList,platform_server_check,platform_index,platform_siteStyle,platform_upgrade', 1340275489, 1347092145)\n\t");
    //设置默认导航
    $targetDb->query("REPLACE INTO `pw_common_nav` (`navid`, `parentid`, `rootid`, `type`, `sign`, `name`, `style`, `link`, `alt`, `target`, `isshow`, `orderid`) VALUES\n(1, 0, 1, 'main', 'default|index|run|', '首页', '', 'index.php', '', 0, 0, 1),\n(2, 0, 2, 'main', 'bbs|index|run|', '论坛', '|||', 'index.php?m=bbs', '', 0, 1, 2),\n(3, 0, 3, 'main', 'like|like|run|', '喜欢', '|||', 'index.php?m=like&c=like', '', 0, 1, 3),\n(4, 0, 4, 'main', '', '云平台', '|||', 'http://open.phpwind.com', '', 1, 1, 6),\n(5, 0, 5, 'main', 'tag|index|run|', '话题', '|||', 'index.php?m=tag', '', 0, 1, 4),\n(6, 0, 6, 'main', 'appcenter|index|run|', '应用', '', 'index.php?m=appcenter', '', 0, 1, 5),\n(7, 0, 7, 'my', 'space', '我的空间', '', 'index.php?m=space', '', 0, 1, 1),\n(8, 0, 8, 'my', 'fresh', '我的关注', '', 'index.php?m=my&c=fresh', '', 0, 1, 2),\n(9, 0, 9, 'my', 'forum', '我的版块', '', 'index.php?m=bbs&c=forum&a=my', '', 0, 1, 3),\n(10, 0, 10, 'my', 'article', '我的帖子', '', 'index.php?m=my&c=article', '', 0, 1, 4),\n(11, 0, 11, 'my', 'vote', '我的投票', '', 'index.php?m=vote&c=my', '', 0, 1, 5),\n(12, 0, 12, 'my', 'task', '我的任务', '', 'index.php?m=task', '', 0, 1, 6),\n(13, 0, 13, 'my', 'medal', '我的勋章', '', 'index.php?m=medal', '', 0, 1, 7),\n(14, 0, 14, 'bottom', '', '关于phpwind', '', 'http://www.phpwind.com/index.php?m=aboutus&a=index&menuid=16', '', 0, 1, 1),\n(15, 0, 15, 'bottom', '', '联系我们', '|||', 'http://www.phpwind.com/index.php?m=aboutus&a=index&menuid=20', '', 0, 1, 2),\n(16, 0, 16, 'bottom', '', '程序建议', '', 'http://www.phpwind.net/thread-htm-fid-39.html', '', 0, 1, 3),\n(17, 0, 17, 'bottom', '', '问题反馈', '', 'http://www.phpwind.net/thread-htm-fid-54.html', '', 0, 1, 3),\n(18, 0, 18, 'main', 'bbs|forumlist|run|', '版块', '', 'index.php?m=bbs&c=forumlist', '', 0, 1, 2)");
    //设置默认首页导航
    $targetDb->query(sprintf("REPLACE INTO `pw_common_config` (`name`, `namespace`, `value`, `vtype`, `description`) VALUES \n('homeUrl', 'site', 'index.php', 'string', ''), \n('homeRouter', 'site', '%s', 'array', '')", 'a:3:{s:1:"m";s:3:"bbs";s:1:"c";s:5:"index";s:1:"a";s:3:"run";}'));
    //添加临时表
    createTmpTables($charset);
    refreshTo('credit', 'init');
} elseif ('init' == $step) {
    //初始化db配置数据、update操作
    if ('credit' == $action) {
        //[init-credit]
        $creditMap = array('money' => 1, 'rvrc' => 2, 'credit' => 3, 'currency' => 4);
        $_commonConfig = array();
        $creditConfig = array(1 => array('open' => 1, 'log' => 1), 2 => array('open' => 1, 'log' => 1), 3 => array('open' => 1, 'log' => 1), 4 => array('open' => 1, 'log' => 1));
        //1、收集87中默认的4个积分配置
        $sql = "SELECT * FROM pw_config WHERE db_name LIKE 'db_money%' OR db_name like 'db_rvrc%' OR db_name LIKE 'db_currency%' OR db_name LIKE 'db_credit%'";
        $_tmp = $srcDb->query($sql);
        while ($row = $srcDb->fetch_array($_tmp)) {
            $name = substr($row['db_name'], -4);
            $r = preg_match('/^db_(.*)(name|unit)$/', $row['db_name'], $matches);
            if (!$r) {