Google Sitemap
Posted: Thu 29. Dec 2005, 11:25
Implemented in Version phpwcms 1.2.8
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
Can you post the link of the sitemap.xml file?Buletti wrote:Hi Folks,
if i use thise sitemap hack and i transer it to google, google says.
this format is not supported
Any ideas ?
As much I know rewritten urls works only for the structure. This scrpt is reading the content from phpwcms_article.. But I will have a closer look at that..Glovebox wrote:This doesnt support re-written urls?
Code: Select all
function generateSitemap()
{
Code: Select all
$strSitemap = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$strSitemap .= "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\">\n";
Code: Select all
$strSitemap = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$strSitemap .= "<?xml-stylesheet type=\"text/xsl\" href=\"gss.xsl\"?>\n";
$strSitemap .= "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">\n";
Code: Select all
WHERE article_public=1 AND article_aktiv=1 AND article_nositemap=1
Code: Select all
$sql = "SELECT article_id, article_cid, date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date FROM ".DB_PREPEND."phpwcms_article WHERE article_public=1 AND article_aktiv=1 AND article_nositemap=1;";
Thanks, please let us know.markoehl wrote:As much I know rewritten urls works only for the structure. This scrpt is reading the content from phpwcms_article.. But I will have a closer look at that..Glovebox wrote:This doesnt support re-written urls?
Code: Select all
Fatal error: URL http://localhost:8888/phpwcms/ not valid. Must be http[s]://[some.]domain.ext/ in C:\xampplite\htdocs\phpwcms\include\inc_lib\googleSitemap.inc.php on line 24
To test with a local installation you have do replace codesquidi wrote:hi,
problem with a local installation ( xampplite - XJ! )
squidiCode: Select all
Fatal error: URL http://localhost:8888/phpwcms/ not valid. Must be http[s]://[some.]domain.ext/ in C:\xampplite\htdocs\phpwcms\include\inc_lib\googleSitemap.inc.php on line 24
if (!preg_match("/^https?:\/\/[a-z]([a-z0-9-.]+)+?.[a-z]+\/$/i", $strBaseURL))
{
trigger_error("URL {$strBaseURL} not valid. Must be http://[some.]domain.ext/", E_USER_ERROR);
}
else
{
$this->strBaseURL = $strBaseURL;
}
$this->strBaseURL = $strBaseURL;
Code: Select all
AND article_deleted=0
Thanx. I modified the script too....volkman wrote:@arkon
I addedin article.editcontent.inc.php on line 33 to avoid listing deleted articles in the sitemapCode: Select all
AND article_deleted=0
volkman
Code: Select all
$sql = "SELECT acat_id, acat_alias, article_cid, date_format(article_tstamp, '%Y-%m-%d %H:%i:%s') AS article_date ";
$sql .= "FROM ".DB_PREPEND."phpwcms_articlecat, phpwcms_article WHERE (acat_id = article_cid) AND article_public=1 AND article_aktiv=1 AND article_nositemap=1 AND article_deleted=0;";
if($result = mysql_query($sql, $db)) {
while($row = mysql_fetch_row($result)) {
$oSitemap->addEntry(
array('loc' => 'index.php?'.$row[1].'',
'lastmod' => $row[3],
'changefreq' => 'monthly',
'priority' => '0.8'));
}
mysql_free_result($result);
}
Code: Select all
<loc>http://www.yourdomain.de/index.php?sitemap</loc>
<lastmod>2006-03-05T18:15:30+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://www.yourdomain.de/index.php?kompetenznetz</loc>
<lastmod>2006-03-14T10:07:21+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>http://www.yourdomain.de/index.php?patient</loc>
<lastmod>2006-03-05T16:33:36+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>