//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>系统将自动把将您设为站点管理员! \t</td></tr> \t<tr><td>您的用户名</td><td><input type="text" name="username" value="" size="30"></td></tr> \t<tr><td>您的密码</td><td><input type="password" name="password" value="" size="30"></td></tr> \t<tr><td></td><td><input type="submit" name="opensubmit" value="设置管理员"></td></tr>
function cronnextrun($cronids) { global $_SGLOBAL, $_SCONFIG; if (!is_array($cronids) || !$cronids) { return false; } $timestamp = $_SGLOBAL['timestamp']; $minutenow = gmdate('i', $timestamp + $_SCONFIG['timeoffset'] * 3600); $hournow = gmdate('H', $timestamp + $_SCONFIG['timeoffset'] * 3600); $daynow = gmdate('d', $timestamp + $_SCONFIG['timeoffset'] * 3600); $monthnow = gmdate('m', $timestamp + $_SCONFIG['timeoffset'] * 3600); $yearnow = gmdate('Y', $timestamp + $_SCONFIG['timeoffset'] * 3600); $weekdaynow = gmdate('w', $timestamp + $_SCONFIG['timeoffset'] * 3600); foreach ($cronids as $cronid) { if (!($cron = $_SGLOBAL['crons'][$cronid])) { continue; } if ($cron['weekday'] == -1) { if ($cron['day'] == -1) { $firstday = $daynow; $secondday = $daynow + 1; } else { $firstday = $cron['day']; $secondday = $cron['day'] + gmdate('t', $timestamp + $_SCONFIG['timeoffset'] * 3600); } } else { $firstday = $daynow + ($cron['weekday'] - $weekdaynow); $secondday = $firstday + 7; } if ($firstday < $daynow) { $firstday = $secondday; } if ($firstday == $daynow) { $todaytime = crontodaynextrun($cron); if ($todaytime['hour'] == -1 && $todaytime['minute'] == -1) { $cron['day'] = $secondday; $nexttime = crontodaynextrun($cron, 0, -1); $cron['hour'] = $nexttime['hour']; $cron['minute'] = $nexttime['minute']; } else { $cron['day'] = $firstday; $cron['hour'] = $todaytime['hour']; $cron['minute'] = $todaytime['minute']; } } else { $cron['day'] = $firstday; $nexttime = crontodaynextrun($cron, 0, -1); $cron['hour'] = $nexttime['hour']; $cron['minute'] = $nexttime['minute']; } $nextrun = gmmktime($cron['hour'], $cron['minute'], 0, $monthnow, $cron['day'], $yearnow) - $_SCONFIG['timeoffset'] * 3600; $_SGLOBAL['db']->query("UPDATE " . tname('crons') . " SET lastrun='{$timestamp}', nextrun='{$nextrun}' WHERE cronid='{$cronid}'"); } include_once S_ROOT . './function/cache.func.php'; updatecronscache(); updatecroncache(); }