private function cate() { require APP_ROOT_PATH . 'app/Lib/page.php'; $cate_id = 6; $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . "cate" . $cate_id . intval($_REQUEST['p'])); if (!$GLOBALS['tmpl']->is_cached('page/usagetip_index.html', $cache_id)) { $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = {$cate_id} and is_effect = 1 and is_delete = 0"); if ($cate_id > 0 && !$cate_item) { app_redirect(APP_ROOT . "/"); } $cate_tree = get_acate_tree(); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_article_list($limit, $cate_id, '', ''); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); //使用技巧 $use_tech_list = get_article_list(6, 6); $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list); $GLOBALS['tmpl']->assign("page_title", $cate_item['title']); $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ","); $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ","); } $GLOBALS['tmpl']->display("page/usagetip_index.html", $cache_id); }
public function detail() { $id = intval($_REQUEST['id']); $aid = intval($_REQUEST['aid']); if ($id == 0) { app_redirect(url("index", "guarantee")); } $article_cate = get_acate_tree(12); $info = null; foreach ($article_cate as $k => $v) { if ($id == $v['id']) { $info = $v; } $article_cate[$k]['article'] = get_article_list(100, $v['id'], "", "", true); } $GLOBALS['tmpl']->assign("article_cate", $article_cate); $GLOBALS['tmpl']->assign("id", $id); $GLOBALS['tmpl']->assign("aid", $aid); $seo_title = $info['seo_title'] != '' ? $info['seo_title'] : $info['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title . " - 安全保障"); $seo_keyword = $info['seo_keyword'] != '' ? $info['seo_keyword'] : $info['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",安全保障,"); $seo_description = $info['seo_description'] != '' ? $info['seo_description'] : $info['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ",安全保障,"); $GLOBALS['tmpl']->display("page/guarantee_detail.html"); }
public function list_notice() { $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . "list_notice" . trim($_REQUEST['id']) . intval($_REQUEST['p']) . $GLOBALS['deal_city']['id']); if (!$GLOBALS['tmpl']->is_cached('page/notice_list.html', $cache_id)) { $cate_list = get_acate_tree(); $GLOBALS['tmpl']->assign('cate_list', $cate_list); //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_article_list($limit, 0, 'ac.type_id = 3', '', true); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); //开始输出当前的site_nav $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/"); $site_nav[] = array('name' => $GLOBALS['lang']['SHOP_SYSTEM'], 'url' => url("shop", "sys#list")); $GLOBALS['tmpl']->assign("site_nav", $site_nav); //输出当前的site_nav $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . intval($result['list'][0]['cate_id'])); $GLOBALS['tmpl']->assign('cate', $cate); $GLOBALS['tmpl']->assign('page_title', $GLOBALS['lang']['SHOP_SYSTEM']); $GLOBALS['tmpl']->assign('page_keyword', $GLOBALS['lang']['SHOP_SYSTEM']); $GLOBALS['tmpl']->assign('page_description', $GLOBALS['lang']['SHOP_SYSTEM']); } $GLOBALS['tmpl']->display("page/notice_list.html", $cache_id); }
public function index() { global_run(); init_app_page(); $GLOBALS['tmpl']->assign("no_nav", true); //无分类下拉 $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act'])); if (!$GLOBALS['tmpl']->is_cached('notice_list.html', $cache_id)) { $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index")); $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news")); $GLOBALS['tmpl']->assign("site_nav", $site_nav); $id = intval($_REQUEST['act']); $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $id . " and is_effect = 1 and is_delete = 0"); if ($id > 0 && !$cate_item) { app_redirect(APP_ROOT . "/"); } elseif ($cate_item && $cate_item['type_id'] != 2) { if ($cate_item['type_id'] == 1) { app_redirect(url("index", "help")); } if ($cate_item['type_id'] == 0) { app_redirect(url("index", "acate")); } if ($cate_item['type_id'] == 3) { app_redirect(APP_ROOT . "/"); } } $cate_id = intval($cate_item['id']); $cate_tree = get_acate_tree('', 2, "news"); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //分页 $page = intval($_REQUEST['p']); if ($page <= 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_article_list($limit, $cate_id, 'ac.type_id = 2', '', false); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("cur_id", $cate_id); $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']); $GLOBALS['tmpl']->assign("page_title", $cate_item['title']); $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ","); $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ","); } $GLOBALS['tmpl']->display("notice_list.html", $cache_id); }
public function index() { $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME); if (!$GLOBALS['tmpl']->is_cached('page/helpcenter.html', $cache_id)) { $article_cate = get_acate_tree(13); $info = null; foreach ($article_cate as $k => $v) { $article_cate[$k]['article'] = get_article_list(100, $v['id'], "", "", true); } $GLOBALS['tmpl']->assign("article_cate", $article_cate); $GLOBALS['tmpl']->assign("page_title", "帮助中心"); $GLOBALS['tmpl']->assign("page_keyword", "帮助中心"); $GLOBALS['tmpl']->assign("page_description", "帮助中心"); } $GLOBALS['tmpl']->display("page/helpcenter.html", $cache_id); }
public function index() { global_run(); init_app_page(); $GLOBALS['tmpl']->assign("no_nav", true); //无分类下拉 $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act'])); if (!$GLOBALS['tmpl']->is_cached('notice_index.html', $cache_id)) { $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index")); $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news")); $GLOBALS['tmpl']->assign("site_nav", $site_nav); $id = intval($_REQUEST['act']); if ($id == 0) { app_redirect(url("index", "news")); } $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.id = " . $id . " and a.is_effect = 1 and a.is_delete = 0"); $cate_tree = get_acate_tree('', 2, "news"); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); if (!$article || $article['type_id'] != 2) { app_redirect(APP_ROOT . "/"); } else { if ($article['rel_url'] != '') { if (!preg_match("/http:\\/\\//i", $article['rel_url'])) { if (substr($article['rel_url'], 0, 2) == 'u:') { app_redirect(parse_url_tag($article['rel_url'])); } else { app_redirect(APP_ROOT . "/" . $article['rel_url']); } } else { app_redirect($article['rel_url']); } } } $GLOBALS['tmpl']->assign("article", $article); $GLOBALS['tmpl']->assign("cur_id", $article['cate_id']); $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']); $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title); $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ","); $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ","); } $GLOBALS['tmpl']->display("notice_index.html", $cache_id); }
public function index() { $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . intval($_REQUEST['p']) . $GLOBALS['deal_city']['id']); if (!$GLOBALS['tmpl']->is_cached('acate_index.html', $cache_id)) { $id = intval($_REQUEST['id']); $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $id . " and is_effect = 1 and is_delete = 0"); if ($id > 0 && !$cate_item) { app_redirect(APP_ROOT . "/"); } elseif ($cate_item['type_id'] != 0) { if ($cate_item['type_id'] == 1) { app_redirect(url("shop", "help#index")); } if ($cate_item['type_id'] == 2) { app_redirect(url("shop", "notice#list")); } if ($cate_item['type_id'] == 3) { app_redirect(url("shop", "sys#list")); } } $cate_id = intval($cate_item['id']); $cate_tree = get_acate_tree(); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //分页 $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE"); $result = get_article_list($limit, $cate_id, 'ac.type_id = 0', '', false); $GLOBALS['tmpl']->assign("list", $result['list']); $page = new Page($result['count'], app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); //开始输出当前的site_nav $cates = array(); $cate = $cate_item; do { $cates[] = $cate; $pid = intval($cate['pid']); $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where is_effect =1 and is_delete =0 and id = " . $pid); } while ($pid != 0); foreach ($cates as $cate_row) { $page_title .= $cate_row['title'] . " - "; $page_kd .= $cate_row['title'] . ","; } $page_title = substr($page_title, 0, -3); krsort($cates); $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/"); if ($cate_item) { foreach ($cates as $cate_row) { $site_nav[] = array('name' => $cate_row['title'], 'url' => url("shop", "acate#index", array("id" => $cate_row['id']))); } } else { $site_nav[] = array('name' => $GLOBALS['lang']['ARTICLE_CATE'], 'url' => url("shop", "acate#index")); } $GLOBALS['tmpl']->assign("site_nav", $site_nav); //输出当前的site_nav $GLOBALS['tmpl']->assign("page_title", $cate_item['title']); $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ","); $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ","); } $GLOBALS['tmpl']->display("acate_index.html", $cache_id); }
public function index() { $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']); if (!$GLOBALS['tmpl']->is_cached('article_index.html', $cache_id)) { $cate_tree = get_acate_tree(); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //获取当前页的团购商品 $id = intval($_REQUEST['id']); $uname = addslashes(trim($_REQUEST['id'])); if ($id == 0 && $uname == '') { app_redirect(APP_ROOT . "/"); } elseif ($id == 0 && $uname != '') { $id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "article where is_delete = 0 and is_effect = 1 and uname = '" . $uname . "'"); } $article = get_article($id); if (!$article || $article['type_id'] != 0) { app_redirect(APP_ROOT . "/"); } else { if ($article['rel_url'] != '') { if (!preg_match("/http:\\/\\//i", $article['rel_url'])) { if (substr($article['rel_url'], 0, 2) == 'u:') { app_redirect(parse_url_tag($article['rel_url'])); } else { app_redirect(APP_ROOT . "/" . $article['rel_url']); } } else { app_redirect($article['rel_url']); } } } //开始输出当前的site_nav $cates = array(); $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $article['cate_id']); do { $cates[] = $cate; $pid = intval($cate['pid']); $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where is_effect =1 and is_delete =0 and id = " . $pid); } while ($pid != 0); $page_title = substr($page_title, 0, -3); krsort($cates); $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/"); if ($cates) { foreach ($cates as $cate_row) { $site_nav[] = array('name' => $cate_row['title'], 'url' => url("shop", "acate#index", array("id" => $cate_row['id']))); } } if ($article['uname'] != '') { $aurl = url("shop", "article#index", array("id" => $article['uname'])); } else { $aurl = url("shop", "article#index", array("id" => $article['id'])); } $site_nav[] = array('name' => $article['title'], 'url' => $aurl); $GLOBALS['tmpl']->assign("site_nav", $site_nav); //输出当前的site_nav $article = get_article($id); $GLOBALS['tmpl']->assign("article", $article); $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title); $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ","); $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ","); } $GLOBALS['tmpl']->display("article_index.html", $cache_id); }