/** * 地图 */ public function init() { $siteconfigs = $this->siteconfigs; $seo_title = $siteconfigs['sitename']; $seo_keywords = $siteconfigs['seo_keywords']; $seo_description = $siteconfigs['seo_description']; $categorys = get_cache('category', 'content'); $hotcity = hotcity(0); $category_result = $this->db->get_list('category', array('modelid' => 3), '*', 0, 1000); $city = substr(rtrim($_SERVER["REQUEST_URI"], '/'), 5); if ($city == '') { $city = 'beijing'; } foreach ($categorys as $cid => $rs) { if ($rs['catdir'] == $city) { $cityid = $cid; set_cookie('cityname', $rs['name'], SYS_TIME + 86400 * 7); set_cookie('cityid', $cityid, SYS_TIME + 86400 * 7); $cityname = $rs['name']; break; } } $page = max(intval($GLOBALS['page']), 1); $urlrule = 'javascript:change_pagemap({$page});'; include T('content', 'map', TPLID); }
/** * 首页 */ public function index() { $siteconfigs = $this->siteconfigs; $seo_title = $siteconfigs['sitename']; $seo_keywords = $siteconfigs['seo_keywords']; $seo_description = $siteconfigs['seo_description']; $categorys = get_cache('category', 'content'); $city = substr(rtrim($_SERVER["REQUEST_URI"], '/'), 6); $hotcity = hotcity(0); if (empty($city)) { $cityid = get_cookie('cityid'); $city = $categorys[$cityid]['catdir']; //$table, $where = '', $field = '*', $startid = 0, $pagesize $category_result = $this->db->get_list('category', array('modelid' => 3), '*', 0, 1000); include T('city', 'index', TPLID); } else { foreach ($categorys as $cid => $rs) { if ($rs['catdir'] == $city) { $cityid = $cid; set_cookie('cityname', $rs['name'], SYS_TIME + 86400 * 7); set_cookie('cityid', $cityid, SYS_TIME + 86400 * 7); $cityname = $rs['name']; break; } } //header("Location:http://www.h1jk.cn/list-69/"); include T('content', 'index-city', TPLID); } }
?> </tbody> </table> </div><!-- tab-pane --> <input name="cardid" id="cardid" type="hidden" value="0"> <input name="mecid" id="mecid" type="hidden" value="0"> <div class="tab-pane" id="tab3-2"> <table class="table table-striped table-advance"> <tbody> <tr> <td><div class="form-groupinfo"><label class="col-sm-3 control-label text-right">所在城市:</label><div class="col-sm-2"> <?php $hotcity = hotcity(0); ?> <select name="lcity" class="form-control" onchange="getmeclist(this)"> <option value="0">请选择</option> <?php $n = 1; if (is_array($hotcity)) { foreach ($hotcity as $r) { ?> <option value="<?php echo $r['cid']; ?> "><?php echo $r['name']; ?> </option>