Пример #1
0
Файл: index.php Проект: cwcw/cms
    //styles
    $datas = array("'系统分类名称列表', '显示数据: 系统分类名\r\n显示方式: 以 <li>名称</li> 的方式循环显示', 'category', 'name_li'", "'资讯标题列表', '显示数据: 资讯标题\r\n显示方式: 以 <li>标题</li> 的方式循环显示', 'spacenews', 'subject_li'", "'模型文章标题列表', '显示数据: 模型标题\r\n显示方式: 以 <li>标题</li> 的方式循环显示', 'model', 'subject_li'", "'投票表单', '显示数据: 投票表单\r\n显示方式: 以 <form>投票具体选项</form> 的方式循环显示', 'poll', 'poll_form'", "'TAG名列表', '显示数据: TAG名\r\n显示方式: 以 <li>TAG名</li> 的方式循环显示', 'tag', 'tagname_li'", "'文章标题列表', '显示数据: 信息标题、作者\r\n显示方式: 以 <li>标题(作者)</li> 的方式循环显示', 'spacetag', 'subject_username_li'", "'回复内容列表', '显示数据: 标题、内容\r\n显示方式: 以 <li><p>标题</p><p>内容</p></li> 的方式循环显示', 'spacecomment', 'subject_message_li'", "'公告标题列表', '显示数据: 标题\r\n显示方式: 以 <li>标题</li> 的方式循环显示', 'announcement', 'subject_li'", "'友情链接名列表', '显示数据: 标题\r\n显示方式: 以 <li>标题</li> 的方式循环显示', 'friendlink', 'name_li'", "'主题列表', '显示数据: 标题\r\n显示方式: 以 <li>标题</li> 的方式循环显示', 'bbsthread', 'subject_li'", "'论坛公告列表', '显示数据: 标题\r\n显示方式: 以 <li>标题</li> 的方式循环显示', 'bbsannouncement', 'subject_li'", "'论坛版块名列表', '显示数据: 版块名\r\n显示方式: 以 <li>版块名</li> 的方式循环显示', 'bbsforum', 'name_li'", "'友情链接名列表', '显示数据: 链接名\r\n显示方式: 以 <li>链接名</li> 的方式循环显示', 'bbslink', 'name_li'", "'会员名列表', '显示数据: 会员名\r\n显示方式: 以 <li>会员名</li> 的方式循环显示', 'bbsmember', 'username_li'", "'附件名列表', '显示数据: 附件名\r\n显示方式: 以 <li>附件名</li> 的方式循环显示', 'bbsattachment', 'filename_li'", "'帖子内容列表', '显示数据: 标题、内容(包含附件)\r\n显示方式: 以 <li><p>标题</p><p>内容</p></li> 的方式循环显示', 'bbspost', 'post_subject_message_li'");
    $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('styles'));
    $_SGLOBAL['db']->query("INSERT INTO " . tname('styles') . " (tplname, tplnote, tpltype, tplfilepath) VALUES (" . implode('),(', $datas) . ")");
    //usergroups
    $datas = array("'1', '管理员', '0', '1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '0', '1', '1'", "'2', '普通用户组', '0', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '1', '0', '0'");
    $_SGLOBAL['db']->query("TRUNCATE TABLE " . tname('usergroups'));
    $_SGLOBAL['db']->query("INSERT INTO " . tname('usergroups') . " (groupid, grouptitle, system, managespacenews, needcheck, managerobots, managerobotmessages, managecategories, managesettings, manageusergroups, manageannouncements, managead, manageblocks, managebbs, managebbsforums, managethreads, manageuchome, managemodels, managechannel, managemember, managedelmembers, managehtml, managecache, managewords, manageattachmenttypes, managedatabase, managetpl, managecrons, managecheck, managecss, managefriendlinks, manageprefields, managesitemap, manageitems, managecomments, manageattachments, managetags, managereports, managepolls, managecustomfields, managestyles, managestyletpl, managemodelmanages, managemodelfolders, managemodelcategories, allowundelete, modelneedcheck, allowmodelundelete, closeignore) " . " VALUES (" . implode('),(', $datas) . ")");
    show_msg('系统默认数据添加完毕,进入下一步操作', $step + 1, 1);
} elseif ($step == 5) {
    //更新缓存
    dbconnect();
    include_once S_ROOT . './function/cache.func.php';
    updatesettingcache();
    //用户组缓存
    updategroupcache();
    //广告缓存
    updateadcache();
    //crons列表
    updatecronscache();
    //计划任务
    updatecroncache();
    //分类
    updatecategorycache();
    //缓存语言屏蔽
    updatecensorcache();
    $msg = <<<EOF
\t<form method="post" action="{$theurl}">
\t<table>
\t<tr><td colspan="2">程序数据安装完成!<br><br>
\t最后,请输入您在用户中心UCenter的用户名和密码<br>系统将自动把将您设为站点管理员!
Пример #2
0
function getgroupid($experience, $gid = 0)
{
    global $_SGLOBAL;
    if (!@(include_once S_ROOT . './data/system/group.cache.php')) {
        include_once S_ROOT . './function/cache.func.php';
        updategroupcache();
    }
    $needfind = false;
    if ($gid && !empty($_SGLOBAL['grouparr'][$gid])) {
        $group = $_SGLOBAL['grouparr'][$gid];
        if ($gid == 2) {
            $needfind = true;
        } elseif ($group['system'] == 0) {
            if ($group['exphigher'] < $experience || $group['explower'] > $experience) {
                $needfind = true;
            }
        }
    } else {
        $needfind = true;
    }
    if ($needfind) {
        $query = $_SGLOBAL['db']->query("SELECT groupid FROM " . tname('usergroups') . " WHERE explower<='{$experience}' AND system='0' ORDER BY explower DESC LIMIT 1");
        $gid = $_SGLOBAL['db']->result($query, 0);
    }
    return $gid;
}