public function seo_items($item) { $weburl = IUrl::getHost() . IUrl::creatUrl(""); switch ($item) { case 'goods': $query = new IQuery('goods'); $url = '/site/products/id/'; $query->fields = "concat('{$url}',id) as loc,DATE_FORMAT(create_time,'%Y-%m-%d') as lastmod"; $items = $query->find(); //对url进行处理 foreach ($items as $key => $val) { $items[$key]['loc'] = IUrl::getHost() . IUrl::creatUrl($val['loc']); } SiteMaps::create_map($items, 'sitemap_goods.xml', $weburl . 'sitemaps.xsl'); break; case 'article': $query = new IQuery('article'); $url = '/site/article_detail/id/'; $query->fields = "concat('{$url}',id) as loc,DATE_FORMAT(create_time,'%Y-%m-%d') as lastmod"; $items = $query->find(); //对url进行处理 foreach ($items as $key => $val) { $items[$key]['loc'] = IUrl::getHost() . IUrl::creatUrl($val['loc']); } SiteMaps::create_map($items, 'sitemap_article.xml', $weburl . 'sitemaps.xsl'); } }
public function seo_items($item) { $weburl = IUrl::getHost() . IUrl::creatUrl(""); switch ($item) { case 'blist': $query = new IQuery('brand'); $query->fields = "id"; $items = $query->find(); $lastmod = date('Y-m-d'); //对url进行处理 foreach ($items as $key => $val) { $items[$key]['loc'] = IUrl::getHost() . '/blist/' . $val['id'] . '.html'; $items[$key]['lastmod'] = $lastmod; } SiteMaps::create_map($items, 'sitemap_blist.xml', $weburl . 'sitemaps.xsl'); case 'glist': $lastmod = date('Y-m-d'); // 获取二级类 $categoryObj = new IModel('category'); // 获取前四个分类 $sql = "SELECT id,name,parent_id FROM {$this->tablePre}category WHERE parent_id IN (SELECT id FROM {$this->tablePre}category WHERE parent_id=-1 ) "; $items = $categoryObj->query_sql($sql); //对url进行处理 foreach ($items as $key => $val) { $items[$key]['loc'] = IUrl::getHost() . '/glist/' . $val['parent_id'] . '_' . $val['id'] . '.html'; $items[$key]['lastmod'] = $lastmod; } SiteMaps::create_map($items, 'sitemap_glist.xml', $weburl . 'sitemaps.xsl'); case 'article': $lastmod = date('Y-m-d'); // 获取二级类 $categoryObj = new IModel('category'); // 获取前四个分类 $sql = "SELECT id FROM {$this->tablePre}article WHERE 1 "; $items = $categoryObj->query_sql($sql); //对url进行处理 foreach ($items as $key => $val) { $items[$key]['loc'] = IUrl::getHost() . '/article/' . $val['id'] . '.html'; $items[$key]['lastmod'] = $lastmod; } SiteMaps::create_map($items, 'sitemap_article.xml', $weburl . 'sitemaps.xsl'); } }
<?php /** * Google Maps Draw Module * @package drawonmaps * * File: map_edit.php * Description: Edit map page */ $map = $vars['map']; $map_markers_exists = false; $map_polylines_exists = false; $map_polygons_exists = false; $map_rectangles_exists = false; $map_circles_exists = false; $map_objects = new SiteMaps(); ?> <script> $(document).ready(function() { var objectsBounds = new google.maps.LatLngBounds(); <?php foreach ($map_objects->getMapsObjects() as $obj) { ?> var tmp_coords = []; var coords = "<?php echo $obj->coords; ?> "; <?php if ($obj->object_id == 1) {
$vars['sitemaps'] = SiteMaps::getMaps(); break; case "map_view": if (isset($_GET['map_id'])) { $map_id = intval($_GET['map_id']); } if ($map_id > 0) { $vars_tmp = load_map(intval($map_id)); } else { $vars['error_msg'] .= 'Not valid map id'; } $vars['html_title'] = $lang_msg['MAP_VIEW_TITLE']; $vars['page_title'] = $lang_msg['MAP_VIEW_PAGE_TITLE']; break; case "map_global": $vars['map_objects'] = SiteMaps::getMapsObjects(); $vars['html_title'] = $lang_msg['MAP_GLOBAL_TITLE']; $vars['page_title'] = $lang_msg['MAP_GLOBAL_PAGE_TITLE']; // redirect the page to map view $page = 'map_view'; break; case "map_create": $vars['html_title'] = $lang_msg['MAP_CREATE_TITLE']; $vars['page_title'] = $lang_msg['MAP_CREATE_PAGE_TITLE']; break; case "map_edit": if (isset($_POST['map_id'])) { $map_id = intval($_POST['map_id']); } if ($map_id > 0) { $vars_tmp = load_map(intval($map_id));
<?php $post = new posts(); $footer_map = $post->get_single_post_by('contact'); $lat = '44.5403'; $lang = '-78.5463'; if ($footer_map != NULL) { $footer_map = explode('&', $footer_map->post_content); if (is_array($footer_map)) { $lat = $footer_map[1]; $lang = $footer_map[0]; } } /* * Get all map location * */ $map_obj = new SiteMaps(); $map_objects = $map_obj->getMapsObjects(); // get availble map objects for using $available_objects = SiteConf::$MAP_OBJECTS_AVAILABLE; ?> <script> $(document).ready(function(){ var objectsBounds = new google.maps.LatLngBounds(); <?php foreach ($map_objects as $obj) { ?> var tmp_coords = []; var coords = "<?php echo $obj->coords; ?> ";