2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2008-12-21 09:00:02 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2009-11-18 01:06:08 +00:00
|
|
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
2008-12-21 09:00:02 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
* Plugin supporting file - gsitemap
|
|
|
|
*
|
|
|
|
* $Source: /cvs_backup/e107_0.8/gsitemap.php,v $
|
2010-02-10 18:18:01 +00:00
|
|
|
* $Revision$
|
|
|
|
* $Date$
|
|
|
|
* $Author$
|
2008-12-21 09:00:02 +00:00
|
|
|
*
|
2006-12-02 04:36:16 +00:00
|
|
|
*/
|
|
|
|
require_once("class2.php");
|
2015-02-07 13:38:29 -08:00
|
|
|
if(!e107::isInstalled('gsitemap'))
|
2008-12-21 09:00:02 +00:00
|
|
|
{
|
2016-01-13 19:17:37 -08:00
|
|
|
e107::redirect();
|
2008-12-21 09:00:02 +00:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2015-02-05 11:58:56 -08:00
|
|
|
e107::lan('gsitemap');
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2016-02-28 09:26:21 -08:00
|
|
|
if(e_QUERY == "show" || !empty($_GET['show']))
|
2006-12-02 04:36:16 +00:00
|
|
|
{
|
|
|
|
require_once(HEADERF);
|
|
|
|
|
2015-02-05 11:58:56 -08:00
|
|
|
$nfArray = $sql ->retrieve("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order ",true);
|
2016-02-28 09:26:21 -08:00
|
|
|
|
|
|
|
if(deftrue('BOOTSTRAP'))
|
|
|
|
{
|
|
|
|
$bread = array(
|
2019-02-26 12:22:36 -08:00
|
|
|
0 => array('text' => $tp->toHTML(GSLAN_Name), 'url'=> null ) // e107::url('gsitemap','index')
|
2016-02-28 09:26:21 -08:00
|
|
|
);
|
|
|
|
$text = e107::getForm()->breadcrumb($bread);
|
2019-06-15 10:45:02 -07:00
|
|
|
e107::breadcrumb($bread);
|
2016-02-28 09:26:21 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$text = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$text .= "<div style='text-align:left'><ul>";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
foreach($nfArray as $nfa)
|
|
|
|
{
|
|
|
|
$url = (substr($nfa['gsitemap_url'],0,4)== "http")? $nfa['gsitemap_url'] : SITEURL.$tp->replaceConstants($nfa['gsitemap_url'],TRUE);
|
2007-12-24 16:21:16 +00:00
|
|
|
$text .= "<li>".$tp->toHTML($nfa['gsitemap_cat'],"","defs").": <a href='".$url."'>".$tp->toHTML($nfa['gsitemap_name'],"","defs")."</a></li>\n";
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
|
|
|
$text .= "</ul></div>";
|
|
|
|
|
2016-02-28 09:26:21 -08:00
|
|
|
$ns -> tablerender(GSLAN_Name."", $text);
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
require_once(FOOTERF);
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2015-02-05 11:58:56 -08:00
|
|
|
header('Content-type: application/xml', TRUE);
|
2006-12-02 04:36:16 +00:00
|
|
|
$xml = "<?xml version='1.0' encoding='UTF-8'?>
|
2020-05-12 16:41:41 -07:00
|
|
|
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
2015-02-05 11:58:56 -08:00
|
|
|
$smArray = $sql ->retrieve("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order ",true);
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
foreach($smArray as $sm)
|
|
|
|
{
|
2013-04-28 15:33:17 +03:00
|
|
|
if($sm['gsitemap_url'][0] == '/') $sm['gsitemap_url'] = ltrim($sm['gsitemap_url'], '/');
|
2006-12-02 04:36:16 +00:00
|
|
|
$loc = (substr($sm['gsitemap_url'],0,4)== "http")? $sm['gsitemap_url'] : SITEURL.$tp->replaceConstants($sm['gsitemap_url'],TRUE);
|
|
|
|
$xml .= "
|
|
|
|
<url>
|
|
|
|
<loc>".$loc."</loc>
|
|
|
|
<lastmod>".get_iso_8601_date($sm['gsitemap_lastmod'])."</lastmod>
|
|
|
|
<changefreq>".$sm['gsitemap_freq']."</changefreq>
|
|
|
|
<priority>".$sm['gsitemap_priority']."</priority>
|
|
|
|
</url>";
|
|
|
|
}
|
|
|
|
|
|
|
|
$xml .= "
|
|
|
|
</urlset>";
|
|
|
|
|
|
|
|
echo $xml;
|
|
|
|
|
|
|
|
/* ungu at terong dot com */
|
|
|
|
function get_iso_8601_date($int_date)
|
|
|
|
{
|
|
|
|
$date_mod = date('Y-m-d\TH:i:s', $int_date);
|
|
|
|
$pre_timezone = date('O', $int_date);
|
|
|
|
$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
|
|
|
|
$date_mod .= $time_zone;
|
|
|
|
return $date_mod;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-05-12 16:41:41 -07:00
|
|
|
|