function regenerateSiteMap() { global $mysql, $config; /* * XML文件 */ $fh = fopen($config['root_path'] . 'sitemap.xml', 'w') or die('ERROR WITH FILE OPEN'); $file = '<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; foreach ($this->langs as $language) { $file .= ' <url> <loc>http://' . $config['domain'] . '/' . $language . '/</loc> <lastmod>' . date('Y-m-d') . 'T00:00:00+00:00</lastmod> <changefreq>monthly</changefreq> <priority>1.0</priority> </url> <url> <loc>http://' . $config['domain'] . '/' . $language . '/sitemap/</loc> <lastmod>' . date('Y-m-d') . 'T00:00:00+00:00</lastmod> <changefreq>monthly</changefreq> <priority>0.5</priority> </url> <url> <loc>http://' . $config['domain'] . '/' . $language . '/contacts/</loc> <lastmod>' . date('Y-m-d') . 'T00:00:00+00:00</lastmod> <changefreq>monthly</changefreq> <priority>0.9</priority> </url> '; } /* * 匹配语言 */ foreach ($this->langs as $language) { /* * 页面类 */ require_once ROOT_PATH . '/apps/pages/models/pages.class.php'; $pagesClass = new pages(); $all = $pagesClass->getAll(0, 0, " AND `visible` = 'true' "); if (is_array($all)) { foreach ($all as $k => $v) { $file .= ' <url> <loc>http://' . $config['domain'] . '/' . $language . '/pages/' . $v['key'] . '.html' . '</loc> <lastmod>' . date('Y-m-d') . 'T00:00:00+00:00</lastmod> <changefreq>monthly</changefreq> <priority>0.9</priority> </url> '; } } /* * */ require_once ROOT_PATH . '/apps/news/models/news.class.php'; $newsClass = new news(); $all = $newsClass->getAll(0, 0, " AND `visible` = 'true' "); if (is_array($all)) { foreach ($all as $k => $v) { $file .= ' <url> <loc>http://' . $config['domain'] . '/' . $language . '/news/view/' . $v['id'] . '/' . url(htmlspecialchars($v['name'])) . '.html' . '</loc> <lastmod>' . date('Y-m-d') . 'T00:00:00+00:00</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> '; } } } /* * XML文件End */ $file .= '</urlset>'; fwrite($fh, $file); fclose($fh); return $file; }
if ($s === true) { refresh('', $langArray['complete_add_to_newsletter'], 'complete'); } elseif ($s == 'already') { refresh('', $langArray['already_in_newsletter'], 'info'); } else { refresh('', $langArray['error_newsletter'], 'error'); } } #保存推荐人至session if (isset($_GET['ref'])) { $_SESSION['temp']['referal'] = $_GET['ref']; } #加载页面至菜单 require_once ROOT_PATH . '/apps/pages/models/pages.class.php'; $pagesClass = new pages(); $menuPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `menu` = 'true' ", true); abr('menuPages', $menuPages); $footerPages = $pagesClass->getAll(0, 0, " `visible` = 'true' AND `footer` = 'true' ", true); abr('footerPages', $footerPages); #加载主分类 require_once ROOT_PATH . '/apps/categories/models/categories.class.php'; $categoriesClass = new categories(); $mainCategories = $categoriesClass->getAll(0, 0, " `visible` = 'true' AND `sub_of` = '0' "); $allCats = $categoriesClass->getAllWithChilds(0, '`visible` = \'true\''); abr('mainCategories', $allCats[0]); unset($allCats[0]); abr('allCats', $allCats); //abr('mainCategories', $mainCategories); #加载计数器 require_once ROOT_PATH . '/apps/items/models/items.class.php'; $itemsClass = new items();
// | Copyright (c) 2015 http://demila.org All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Email author@demila.org // +---------------------------------------------------------------------- _setView(__FILE__); _setTitle($langArray['list']); $cms = new pages(); if (!isset($_GET['sub_of']) || !is_numeric($_GET['sub_of'])) { $_GET['sub_of'] = 0; } if (isset($_GET['up']) || isset($_GET['down'])) { $cms->tableName = 'pages'; $cms->idColumn = 'id'; $cms->orderWhere = " AND `sub_of` = '" . intval($_GET['sub_of']) . "' "; if (isset($_GET['up']) && is_numeric($_GET['up'])) { $cms->moveUp($_GET['up']); } elseif (isset($_GET['down']) && is_numeric($_GET['down'])) { $cms->moveDown($_GET['down']); } } $data = $cms->getAll(START, LIMIT, " `sub_of` = '" . intval($_GET['sub_of']) . "' "); abr('data', $data); $p = paging("?m=" . $_GET['m'] . "&c=list&sub_of=" . $_GET['sub_of'] . "&p=", "", PAGE, LIMIT, $cms->foundRows); abr('paging', $p); if ($_GET['sub_of'] != 0) { $pdata = $cms->get($_GET['sub_of']); abr('pdata', $pdata); } require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';