[ Index ] |
|
Code source de Plume CMS 1.2.2 |
1 <?php 2 /* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 3 /* 4 # ***** BEGIN LICENSE BLOCK ***** 5 # This file is part of Plume CMS, a website management application. 6 # Copyright (C) 2001-2005 Loic d'Anterroches and contributors. 7 # 8 # Plume CMS is free software; you can redistribute it and/or modify 9 # it under the terms of the GNU General Public License as published by 10 # the Free Software Foundation; either version 2 of the License, or 11 # (at your option) any later version. 12 # 13 # Plume CMS is distributed in the hope that it will be useful, 14 # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 # GNU General Public License for more details. 17 # 18 # You should have received a copy of the GNU General Public License 19 # along with this program; if not, write to the Free Software 20 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 # 22 # ***** END LICENSE BLOCK ***** */ 23 24 25 class Sitemap 26 { 27 /** 28 * Action to display the Sitemap. 29 * 30 * @param string Server query string 31 * @return int Success code 32 */ 33 function action($query) 34 { 35 Hook::register('onInitTemplate', 'Sitemap', 'hookOnInitTemplate'); 36 config::setVar('category_page', 1); 37 $category_id = ''; 38 //$path = Sitemap::parseQueryString($query); 39 //if ($path != '/') { 40 $sql = SQL::getCategoryByPath('/', config::f('website_id')); 41 $con =& pxDBConnect(); 42 if (($cat = $con->select($sql, 'Category')) !== false) { 43 if (!$cat->isEmpty()) { 44 $category_id = $cat->f('category_id'); 45 } 46 } 47 //} 48 $GLOBALS['_PX_render']['last'] = ''; 49 $last =& $GLOBALS['_PX_render']['last']; 50 $GLOBALS['_PX_render']['website'] = ''; 51 $website =& $GLOBALS['_PX_render']['website']; 52 53 $cache = new Cache(urlencode('sitemap')); 54 $cache->setCacheDirectory(config::getCacheDir()); 55 $cache->debug = config::f('debug'); 56 57 //$GLOBALS['_PX_render']['website'] = FrontEnd::getWebsite(); 58 59 header(FrontEnd::getHeader('sitemap.php')); 60 // Load the template 61 include config::f('manager_path').'/templates/' 62 .config::f('theme_id').'/sitemap.php'; 63 return 200; 64 65 } 66 67 /** 68 * Hook on the initialization of the templates. 69 * 70 * @param array Default parameters (not used) 71 * @return bool Success 72 */ 73 function hookOnInitTemplate($param) 74 { 75 if (config::f('action') == 'Sitemap') { 76 $GLOBALS['_PX_render']['website'] = FrontEnd::getWebsite(); 77 } 78 return true; 79 } 80 81 /** 82 * Parse query string. 83 * 84 * @param string Query string 85 * @return string Category path 86 */ 87 function parseQueryString($query) 88 { 89 $category = ''; 90 if (preg_match('#^/sitemap.php(.*/)$#i', $query, $match)) { 91 $category = $match[1]; 92 } else { 93 $category = '/'; 94 } 95 return $category; 96 } 97 98 } 99 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 11:57:01 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |