Ejemplo n.º 1
0
$_SGLOBAL['tpl_blockvalue'] = array();
$_SGLOBAL['debug_query'] = array();
define('A_DIR', $_SCONFIG['attachmentdir']);
if (substr($_SCONFIG['attachmentdir'], 0, 2) == './' && empty($_SCONFIG['attachmenturl'])) {
    $_SCONFIG['attachmenturl'] = S_URL . substr($_SCONFIG['attachmentdir'], 1);
}
define('A_URL', $_SCONFIG['attachmenturl']);
$newsiteurl = S_URL;
if (strpos($newsiteurl, '://') === false) {
    $newsiteurl = 'http://' . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST']) . $newsiteurl;
}
define('S_URL_ALL', $newsiteurl);
if (empty($nolanguage)) {
    include_once S_ROOT . './language/main.lang.php';
}
if (file_exists(S_ROOT . './index.html')) {
    define('S_ISPHP', '1');
}
//链接数据库
dbconnect();
if (!defined('IN_SUPESITE_UPDATE')) {
    getcookie();
}
//获取频道信息
$channels = getchannels();
//计划任务
@(include_once S_ROOT . './data/system/cron.cache.php');
if (empty($_SGLOBAL['cronnextrun']) || $_SGLOBAL['cronnextrun'] <= $_SGLOBAL['timestamp']) {
    include_once S_ROOT . './function/cron.func.php';
    runcron();
}
Ejemplo n.º 2
0
function createhtml($setphp, $ele)
{
    global $lang, $alang, $_SGET, $_SCONFIG, $_SGLOBAL, $_SBLOCK, $_SHTML, $_DCACHE, $_SC;
    $channels = getchannels();
    obclean();
    @(include $setphp);
    $content = ob_get_contents();
    obclean();
    $dir = gethtmlurl($ele, 1);
    $file = substr($dir, strrpos($dir, '/') + 1);
    $file = empty($file) ? './index.html' : $file;
    $dir = substr($dir, 0, strrpos($dir, '/'));
    //权限验证
    if (file_exists($dir . '/' . $file)) {
        if (!checkfdperm($dir . '/' . $file, 1)) {
            return $file . $alang['iswrite_file_error'];
        }
    } else {
        if (!checkfdperm($dir)) {
            $dirarr = explode("/", $dir);
            $dirstr = '';
            foreach ($dirarr as $key) {
                if (!is_dir($dirstr . $key)) {
                    @mkdir($dirstr . $key, 0777);
                } elseif (!checkfdperm($dirstr . $key)) {
                    return $dirstr . $key . $alang['iswrite_error'];
                }
                $dirstr .= $key . '/';
            }
        }
    }
    writefile($dir . '/' . $file, $content);
    return true;
}