Example #1
0
    $articlelist = $articledata->TakeArticleList($category->cid, $skip, $take);
    $tempinfo->assign("articlelist", $articlelist);
} else {
    if ($category->type == "product") {
        $productdata = new Product();
        $productcount = $productdata->GetProductList($category->cid);
        $total = count($productcount);
        $take = $category->takenumber;
        $skip = ($curpage - 1) * $take;
        $totalpage = (int) ($total % $take == 0 ? $total / $take : $total / $take + 1);
        $productlist = $productdata->TakeProductList($category->cid, $skip, $take);
        $tempinfo->assign("productlist", $productlist);
    } else {
        header("HTTP/1.1 404 Not Found");
        header("Status: 404 Not Found");
        exit;
    }
}
if ($curpage > 1) {
    $category->seotitle = $category->seotitle . ' 第' . $curpage . '页';
}
$tempinfo->assign("category", $category);
$tempinfo->assign("subcategory", $categorydata->GetSubCategory($category->cid, $category->type));
$tempinfo->assign("take", $take);
$tempinfo->assign("total", $total);
$tempinfo->assign("totalpage", $totalpage);
$tempinfo->assign("curpage", $curpage);
if (!$tempinfo->template_exists($category->templets)) {
    exit("没有找到合适的模板,请与管理员联系!");
}
$tempinfo->display($category->templets);
Example #2
0
$templets = $tempinfo->GetDefaultTemplets();
if ($templets == null) {
    $templets->directory = "default";
}
$tempinfo->template_dir = YIQIROOT . '/templets/' . $templets->directory . '/';
$tempinfo->assign("templets", $templets);
$tempinfo->compile_dir = YIQIROOT . '/cache/compile/';
$sql = "select * from yiqi_settings";
$settinglist = $yiqi_db->get_results(CheckSql($sql));
if (count($settinglist) > 0) {
    foreach ($settinglist as $settinginfo) {
        $tempinfo->assign($settinginfo->varname, $settinginfo->value);
    }
}
$categorydata = new Category();
$categorylist = $categorydata->GetSubCategory(0, "product");
$tempinfo->assign("categorylist", $categorylist);
$tempinfo->register_function("formaturl", "formaturl");
$tempinfo->register_function("readrss", "readrss");
//定义区域
$citys = array("zhengzhou" => "郑州", "taiyuan" => "太原", "xian" => "西安", "xinxiang" => "新乡", "xuchang" => "许昌", "jiaozuo" => "焦作", "anyang" => "安阳", "xinyang" => "信阳", "puyang" => "濮阳", "datong" => "大同");
$cv = $_GET['city'];
$city = $cv ? $citys[$cv] : "";
$tempinfo->assign('city', $city);
//定义区域
$articledata = new Article();
$productdata = new Product();
$categorydata = new Category();
$linkdata = new Link();
$navdata = new Navigate();
$cachedata = new Cache();