| [ Index ] |
PHP Cross Reference of e107 v1 |
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | Copyright (C) 2001-2002 Steve Dunstan (jalist@e107.org) 7 | Copyright (C) 2008-2010 e107 Inc (e107.org) 8 | 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $URL: https://e107.svn.sourceforge.net/svnroot/e107/trunk/e107_0.7/gsitemap.php $ 14 | $Revision: 11678 $ 15 | $Id: gsitemap.php 11678 2010-08-22 00:43:45Z e107coders $ 16 | $Author: e107coders $ 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></li>\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 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Mar 12 16:28:38 2012 | Cross Reference PHPXref |