[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/gsitemap.php,v $ 14 | $Revision: 1.10 $ 15 | $Date: 2006/11/07 14:59:18 $ 16 | $Author: lisa_ $ 17 +----------------------------------------------------------------------------+ 18 */ 19 require_once ("class2.php"); 20 include_lan(e_PLUGIN."gsitemap/languages/gsitemap_".e_LANGUAGE.".php"); 21 22 if(e_QUERY == "show") 23 { 24 require_once(HEADERF); 25 26 $sql -> db_Select("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order "); 27 $nfArray = $sql -> db_getList(); 28 $text = "<div style='text-align:left'><ul>"; 29 30 foreach($nfArray as $nfa) 31 { 32 $url = (substr($nfa['gsitemap_url'],0,4)== "http")? $nfa['gsitemap_url'] : SITEURL.$tp->replaceConstants($nfa['gsitemap_url'],TRUE); 33 $text .= "<li>".$tp->toHTML($nfa['gsitemap_cat'],"","defs").": <a href='".$url."'>".$tp->toHTML($nfa['gsitemap_name'],"","defs")."</a><br />\n"; 34 } 35 $text .= "</ul></div>"; 36 37 $ns -> tablerender(SITENAME." : ".GSLAN_Name."", $text); 38 39 require_once(FOOTERF); 40 exit; 41 } 42 43 44 $xml = "<?xml version='1.0' encoding='UTF-8'?> 45 <urlset xmlns='http://www.google.com/schemas/sitemap/0.84' 46 xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84 47 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>"; 48 49 $sql -> db_Select("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order "); 50 $smArray = $sql -> db_getList(); 51 foreach($smArray as $sm) 52 { 53 $loc = (substr($sm['gsitemap_url'],0,4)== "http")? $sm['gsitemap_url'] : SITEURL.$tp->replaceConstants($sm['gsitemap_url'],TRUE); 54 $xml .= " 55 <url> 56 <loc>".$loc."</loc> 57 <lastmod>".get_iso_8601_date($sm['gsitemap_lastmod'])."</lastmod> 58 <changefreq>".$sm['gsitemap_freq']."</changefreq> 59 <priority>".$sm['gsitemap_priority']."</priority> 60 </url>"; 61 } 62 63 $xml .= " 64 </urlset>"; 65 66 echo $xml; 67 68 /* ungu at terong dot com */ 69 function get_iso_8601_date($int_date) 70 { 71 $date_mod = date('Y-m-d\TH:i:s', $int_date); 72 $pre_timezone = date('O', $int_date); 73 $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); 74 $date_mod .= $time_zone; 75 return $date_mod; 76 } 77 78 79 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |