| Server IP : 172.67.201.108 / Your IP : 216.73.216.11 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/tgnewprod/mod/ |
Upload File : |
<?php include('_mod_security.php'); ?>
<?php
ob_clean();
header( "Content-Type: text/xml; charset=utf-8", true );
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\r\n\r\n";
echo "<!-- Sitemap dynamically generated by ThoughtGallery.org on ".date('D, d M Y H:i:s e'). " -->\r\n";
/*
*/
echo '<?xml-stylesheet type="text/xsl" href="'.APP_BASE_USER_SITE_SECURE.'sitemap.xsl"?>' . "\r\n";
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\r\n";
//**** Extract pages marked for sitemap
foreach ($ar_pagecontrol as $key => $value) :
if (isset($value['sitemap']) && $value['sitemap'] === true) :
if (!empty($value['slug'])) :
$page = $value['slug'];
else :
$page = 'index.php?IX='.$key.'.php';
endif;
echo "\t<url>\r\n";
echo "\t\t<loc>".APP_BASE_SECURE.urlencode($page)."</loc>\r\n";
$lastmod = date('Y-m-d').'T12:00:00Z';
echo "\t\t<lastmod>".$lastmod."</lastmod>\r\n";
echo "\t\t<changefreq>weekly</changefreq>\r\n";
echo "\t\t<priority>0.7</priority>\r\n";
echo "\t</url>\r\n";
endif;
endforeach;
//*** Extract individual articles
$sql = "SELECT * FROM articles WHERE post_status = 1 ORDER BY post_date DESC";
$result = $db->query($sql) or die('Database Error!');
while ($row = $result->fetch(PDO::FETCH_OBJ)) :
echo "\t<url>\r\n";
echo "\t\t<loc>".APP_BASE_USER_SITE_SECURE.urlencode($row->slug)."/</loc>\r\n";
if (sitemap_validate_date($row->update_date)) :
$lastmod = str_replace(' ', 'T', $row->update_timestamp).'Z';
else :
$lastmod = date('Y-m-d').'T12:00:00Z';
endif;
echo "\t\t<lastmod>".$lastmod."</lastmod>\r\n";
echo "\t\t<changefreq>weekly</changefreq>\r\n";
echo "\t\t<priority>0.6</priority>\r\n";
echo "\t</url>\r\n";
endwhile;
//*** Extract individual events
$sql = "SELECT * FROM events WHERE status = 1 ORDER BY start_time_local DESC";
$result = $db->query($sql) or die('Database Error!');
while ($row = $result->fetch(PDO::FETCH_OBJ)) :
echo "\t<url>\r\n";
echo "\t\t<loc>".APP_BASE_USER_SITE_SECURE.urlencode($row->slug)."/</loc>\r\n";
if (sitemap_validate_date($row->update_date)) :
$lastmod = str_replace(' ', 'T', $row->update_timestamp).'Z';
else :
$lastmod = date('Y-m-d').'T12:00:00Z';
endif;
echo "\t\t<lastmod>".$lastmod."</lastmod>\r\n";
echo "\t\t<changefreq>weekly</changefreq>\r\n";
echo "\t\t<priority>0.6</priority>\r\n";
echo "\t</url>\r\n";
endwhile;
echo '</urlset>';
die;
function sitemap_validate_date($date, $format = 'Y-m-d H:i:s')
{
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}