Thanks to mihai from PatchLog for providing XML Sitemap for Pligg update 0.6. I installed it for my pligg 9.9.0 powered site at http://pligg.topsites.sg running on php 4.
However when submitting the sitemap to Google, the date was an invalid format. The sitemap lastmod date was showing <lastmod>2008-04-16SGT10:23:16</lastmod>
According to Google Sitemap FAQ, Google Sitemap requires the ISO-8601 encoding which has two variations:
- 2005-02-21
- 2005-02-21T18:00:15+00:00
After some research, i found the solution. Thanks to Guides - Dynamic ATOM Feed
Open xml_sitemaps_main.php
Before
function xml_sitemaps_show_sitemap(){,
Add
function get_iso_8601_date($int_date) {
//$int_date: current date in UNIX timestamp
$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;
}
Find
echo “<lastmod>”.date(’Y-m-dTH:i:s’,strtotime($r[0])).”</lastmod>”;
Replace with
// echo “<lastmod>”.date(’Y-m-dTH:i:s’,strtotime($r[0])).”</lastmod>”;
echo “<lastmod>”.get_iso_8601_date(strtotime($r[0])).”</lastmod>”;
Find
echo “<lastmod>”.date(’Y-m-dTH:i:s’, $link->modified).”</lastmod>\n”;
Replace with
// echo “<lastmod>”.date(’Y-m-dTH:i:s’, $link->modified).”</lastmod>\n”;
echo “<lastmod>”.get_iso_8601_date($link->modified).”</lastmod>”;
Find
echo “<lastmod>”.date(’Y-m-dTH:i:s’, $m_time).”</lastmod>\n”;
Replace with
// echo “<lastmod>”.date(’Y-m-dTH:i:s’, $m_time).”</lastmod>\n”;
echo “<lastmod>”.get_iso_8601_date($m_time).”</lastmod>”;
That’s all you need. Submit it to Google and it should accept your Sitemap.
Popularity: 4% [?]
You Should Also Check Out This Post:
- Richard Palace is Back to Make Money Online!
- Obama - Winner of the 2008 US Presidential Election
- Google Released Google Chrome
- PS3 Update 2.42
- Sony PSP-3000 Announced
More Active Posts:
- Just Jean and Simply Jean are the Same Jean? (34)
- Google SiteMap For WordPress MU Plugin 1.513101 (25)
- PS3 Update 2.35 (24)
- Disney Channel Camp Rock at Disney.com/CampRock (15)
- Google Released Google Chrome (10)
- Who Will Win The US Presidential Election? Barack Obama or John McCain? (9)
- PS3 Update 2.36 (8)
- Randy Pausch Death Update (6)
- Dawn Yang - Singapore Hottest Blogger (6)
- Deven Trabosh - Marry a Princess Lost in America (6)
































Thanks very much for this solution! I didn’t expect to find it so quick on the Pligg forum
I’ll let you know if I get stuck.
-Jamie