Example #1
0
 public static function page_start()
 {
     $setting = self::setting();
     if ($setting['cache']) {
         $etag_expires = getCacheExpire();
         header("Pragma: public");
         header("Cache-Control: private, max-age=" . $etag_expires);
         header("Last-Modified: " . gmdate('D, d M Y H:i:s') . " GMT");
         header("Expires: " . gmdate('D, d M Y H:i:s', time() + $etag_expires) . " GMT");
         $etag = md5($_SERVER["REQUEST_URI"] . implode(",", $GLOBALS['ms_version']) . $GLOBALS['setting']['gen']['etag']);
         if ($_SERVER['HTTP_IF_NONE_MATCH'] == $etag) {
             header('Etag:' . $etag, true, 304);
             exit;
         } else {
             header('Etag:' . $etag);
         }
     } else {
         if (!isset($GLOBALS['etag_expires'])) {
             header("Expires: -1");
             header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0");
             header("Cache-Control: private", false);
             header("Pragma: no-cache");
         }
     }
 }
Example #2
0
<?php

require "inc.php";
$module = $req->getGet("m");
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => md5($_SERVER["QUERY_STRING"]), 'path' => $cache_path . "/" . $module . "/", 'expire' => getCacheExpire());
} else {
    $cache_info = false;
}
$mystep->module($module);
$mystep->pageEnd($setting['gen']['show_info']);
Example #3
0
if ($page_count == 1) {
    $page = 1;
}
if (!is_numeric($page)) {
    $page = "all";
    $page_count = 1;
} else {
    if ($page < 1) {
        $page = 1;
    }
    if ($page > $page_count) {
        $page = $page_count;
    }
}
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => $page == 1 ? $news_id : "{$news_id}_{$page}", 'path' => $cache_path . "/" . date("Y/md/", $add_date), 'expire' => getCacheExpire());
} else {
    $cache_info = false;
}
if ($view_lvl > $setting['info']['user']['type']['view_lvl']) {
    $tpl = $mystep->getInstance("MyTpl", $tpl_info, false);
    $tpl_info['idx'] = "login";
    $tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
    $ms_info = $req->getCookie("ms_info");
    if (empty($ms_info)) {
        $ms_info = $req->getSession("usertype") == 1 ? $setting['language']['login_login'] : $setting['language']['login_nopower'];
    }
    $tpl_tmp->Set_Variable('info', $ms_info);
    $tpl->Set_Variable('main', $tpl_tmp->Get_Content());
    unset($tpl_tmp);
    $mystep->show($tpl);
Example #4
0
<?php

require "inc.php";
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => 'index', 'path' => $cache_path, 'expire' => getCacheExpire());
} else {
    $cache_info = false;
}
$tpl = $mystep->getInstance("MyTpl", $tpl_info, $cache_info);
$web_id = $setting['info']['web']['web_id'];
if ($tpl->Is_Cached()) {
    echo $tpl->Get_Content();
    $mystep->pageEnd($setting['gen']['show_info']);
}
$tpl_info['idx'] = "index";
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
$tpl->Set_Variable('main', $tpl_tmp->Get_Content('$db, $setting'));
unset($tpl_temp);
$mystep->show($tpl);
$mystep->pageEnd($setting['gen']['show_info']);
Example #5
0
<?php

$ms_sign = 1;
require "inc.php";
$cat_idx = strtolower($req->getGet("cat"));
if ($cat_info = getParaInfo("news_cat", "cat_idx", $cat_idx)) {
    $web_info = getSubSetting($cat_info['web_id']);
} else {
    $cat_idx = "";
    $web_info = getSubSetting($setting['info']['web']['web_id']);
}
$tpl_info['idx'] = "rss";
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => "rss_" . $web_info["info"]["web_id"] . (empty($cat_idx) ? "" : "_{$cat_info[cat_id]}"), 'path' => $cache_path . "/rss/", 'expire' => getCacheExpire());
} else {
    $cache_info = false;
}
$tpl = $mystep->getInstance("MyTpl", $tpl_info, $cache_info);
if ($tpl->Is_Cached()) {
    echo $tpl->Get_Content();
    $mystep->pageEnd(false);
}
if (empty($cat_idx)) {
    $cat_txt = $setting['language']['page_all_news'];
} else {
    $cat_txt = $cat_info['cat_name'];
    $setting['web']['description'] .= ", " . $cat_info['cat_comment'];
}
$cat_txt .= sprintf($setting['language']['page_update_lastest'], $setting['list']['rss']);
$charset_tag = '<?xml version="1.0" encoding="' . $setting['gen']['charset'] . '"?>' . "\n";
$tpl->Set_Variable('charset_tag', $charset_tag);
Example #6
0
        $cat_idx = "";
    }
} else {
    $cat_idx = getString($cat_idx);
}
$cat_info = getParaInfo("news_cat_sub", "cat_idx", $cat_idx);
if ($cat_info === false && !empty($cat_idx)) {
    $goto_url = "/";
    $mystep->pageEnd();
}
if (!empty($cat_info['cat_link'])) {
    $goto_url = $cat_info['cat_link'];
    $mystep->pageEnd();
}
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => "index", 'path' => $cache_path . "/" . (empty($cat_idx) ? "all" : $cat_idx) . "/", 'expire' => getCacheExpire());
    if (!empty($prefix)) {
        $cache_info['idx'] .= "_" . $prefix;
    }
    if ($page > 1) {
        $cache_info['idx'] .= "_" . $page;
    }
} else {
    $cache_info = false;
}
$tpl = $mystep->getInstance("MyTpl", $tpl_info, $cache_info);
if ($tpl->Is_Cached()) {
    echo $tpl->Get_Content();
    $mystep->pageEnd($setting['gen']['show_info']);
}
$cat_id = 0;
Example #7
0
<?php

$ms_sign = 1;
require "inc.php";
set_time_limit(300);
$tpl_info['idx'] = "sitemap";
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => "sitemap", 'path' => $cache_path . "/", 'expire' => getCacheExpire());
} else {
    $cache_info = false;
}
$tpl = $mystep->getInstance("MyTpl", $tpl_info, $cache_info);
if ($tpl->Is_Cached()) {
    header('Content-Type: application/xml; charset=' . $setting['gen']['charset']);
    echo $tpl->Get_Content();
    $mystep->pageEnd(false);
}
$charset_tag = '<?xml version="1.0" encoding="' . $setting['gen']['charset'] . '"?>' . "\n";
$tpl->Set_Variable('charset_tag', $charset_tag);
$tpl->Set_Variable('now', date("r"));
$from = array("&", "'", '"', ">", "<");
$to = array("&amp;", "&apos;", "&quot;", "&gt;", "&lt;");
$record = array();
$record['url'] = $setting['web']['url'];
$record['date'] = date("Y-m-d");
$record['priority'] = "1";
$tpl->Set_Loop("record", $record);
$sql = $db->buildSel($setting['db']['pre_sub'] . "news_show", "count(*) as news_count", array("web_id", "n=", $setting['info']['web']['web_id']), array("group" => "cat_id", "order" => "news_count desc", "limit" => "1"));
$news_count_max = getData($sql, "result", 86400);
for ($i = 0, $m = count($news_cat); $i < $m; $i++) {
    if ($news_cat[$i]['web_id'] != $setting['info']['web']['web_id']) {
Example #8
0
$tag = $req->getGet("tag");
if ($tag == "index") {
    $tag = "";
}
$tag = getString($tag);
$tag = mysql_real_escape_string($tag);
if (get_magic_quotes_gpc()) {
    $tag = addslashes($tag);
}
$page = $req->getGet("page");
if (!is_numeric($page) || $page < 1) {
    $page = 1;
}
$page_size = $setting['list']['txt'];
if ($setting['gen']['cache']) {
    $cache_info = array('idx' => "tag_" . ($page == 1 ? $tag : "{$tag}_{$page}"), 'path' => $cache_path . "/tag/", 'expire' => getCacheExpire());
} else {
    $cache_info = false;
}
$tpl = $mystep->getInstance("MyTpl", $tpl_info, $cache_info);
if ($tpl->Is_Cached()) {
    echo $tpl->Get_Content();
    $mystep->pageEnd($setting['gen']['show_info']);
}
$tpl_info['idx'] = "tag";
$tpl_tmp = $mystep->getInstance("MyTpl", $tpl_info);
$db->Query("update " . $setting['db']['pre_sub'] . "news_tag set click=click+1 where tag = '{$tag}'");
$cur_tag = "";
if (!empty($tag)) {
    $cur_tag = " - " . $tag;
}