NAVIGATION
This shows you the differences between two versions of the page.
english:other-enhancements:sitemap-xml [2010/06/15 08:22] Knut Heermann (flip-flop) |
english:other-enhancements:sitemap-xml [2018/06/03 18:09] (current) |
||
---|---|---|---|
Line 4: | Line 4: | ||
====== Sitemap-XML (Google) ====== | ====== Sitemap-XML (Google) ====== | ||
- | ===== Multidomain sitemap.php ===== | ||
- | Enhanced version for using a start-Id in tree against a domain. | + | ===== Category link instead of article link ===== |
- | <file> | + | Using Category links instead of Article Links. Only one category link entry with the most recent Article Date is used. |
- | // Your strukture ID -> where would you like to start your sitemap? | + | |
- | $my_start_id = 22; //default if no domain name is given | + | |
- | // All Cat-IDs which have to be excluded permanently e.g. '4,7,34,9' | + | |
- | $_DISABLE_ID = '4,7,34,9'; // Test | + | |
- | + | ||
- | // Add the respective START ID corresponding with your domain: remove comment slashes and enter them | + | |
- | $_DOMAIN_ID = array( | + | |
- | + | ||
- | // 'domain1.de' => array( 'ID' => 1 ), | + | |
- | // 'domain2.com' => array( 'ID' => 3 ), | + | |
- | // 'domain3.ch' => array( 'ID' => 11 ), | + | |
- | + | ||
- | ); | + | |
- | </file> | + | |
- | + | ||
- | + | ||
- | <note tip>**Available for persons those who write useful contributions, translations or video clips into the wiki.** // | + | |
- | (Alternatively make an donation).//</note> | + | |
+ | Setting in "CUSTMOM VAR": [true|false] [Category-Link | Article-link] | ||
+ | **Update V1.1: 15.07.2010 KH** \\ | ||
+ | - Small correction in row 102, if "mod_rewrite = 0" the URL was lost in the output. | ||
+ | <code php>$_link = PHPWCMS_URL.'index.php?'.($cat_link)?$_CAT['acat_alias']:setGetArticleAid( $data ); // +KH</code> | ||
+ | replaced by | ||
+ | <code php>$_link = PHPWCMS_URL.'index.php?'.(($cat_link)?$_CAT['acat_alias']:setGetArticleAid( $data )); // +KH</code> | ||
\\ | \\ | ||
- | |||
- | ===== Category link instead of article link ===== | ||
- | |||
- | Using Category links instead of Article Links. Only one category link entry with the most recent Article Date is used. | ||
- | |||
- | Setting in "CUSTMOM VAR": [true|false] [Category-Link | Article-link] | ||
<code php|h sitemap.php |h> | <code php|h sitemap.php |h> | ||
Line 64: | Line 45: | ||
/* | /* | ||
-------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ||
- | +KH 15.06.2010 K.Heermann http://planmatrix.de | + | +KH 15.06.2010 K.Heermann http://planmatrix.de Update V1.1 15.07.2010 |
Using Category links instead of Article Links | Using Category links instead of Article Links | ||
Switch in CUSTMOM VAR [true|false] [Category-Link | Article-link] | Switch in CUSTMOM VAR [true|false] [Category-Link | Article-link] | ||
Line 142: | Line 123: | ||
if(empty($phpwcms['rewrite_url']) || empty($data['article_alias'])) { | if(empty($phpwcms['rewrite_url']) || empty($data['article_alias'])) { | ||
// $_link = PHPWCMS_URL.'index.php?'.setGetArticleAid( $data ); | // $_link = PHPWCMS_URL.'index.php?'.setGetArticleAid( $data ); | ||
- | $_link = PHPWCMS_URL.'index.php?'.($cat_link)?$_CAT['acat_alias']:setGetArticleAid( $data ); // +KH | + | $_link = PHPWCMS_URL.'index.php?'.(($cat_link)?$_CAT['acat_alias']:setGetArticleAid( $data )); // +KH |
} else { | } else { | ||
// $_link = PHPWCMS_URL.rawurlencode($data['article_alias']).'.phtml'; | // $_link = PHPWCMS_URL.rawurlencode($data['article_alias']).'.phtml'; | ||
Line 148: | Line 129: | ||
} | } | ||
echo ' <url>'.LF; | echo ' <url>'.LF; | ||
- | echo ' <loc>'.$_link.'</loc>'.LF; | + | echo ' <loc>'.$_link.'</loc>'.LF; |
echo ' <lastmod>'.$data["article_tstamp"].'</lastmod>'.LF; | echo ' <lastmod>'.$data["article_tstamp"].'</lastmod>'.LF; | ||
echo ' </url>'.LF; | echo ' </url>'.LF; | ||
Line 177: | Line 158: | ||
} | } | ||
echo ' <url>'.LF; | echo ' <url>'.LF; | ||
- | echo ' <loc>'.$_link.'</loc>'.LF; | + | echo ' <loc>'.$_link.'</loc>'.LF; |
echo ' <lastmod>'.$_lastmod.'</lastmod>'.LF; | echo ' <lastmod>'.$_lastmod.'</lastmod>'.LF; | ||
echo ' </url>'.LF; | echo ' </url>'.LF; | ||
Line 190: | Line 171: | ||
// just return the main URL | // just return the main URL | ||
echo ' <url>'.LF; | echo ' <url>'.LF; | ||
- | echo ' <loc>'.PHPWCMS_URL.'</loc>'.LF; | + | echo ' <loc>'.PHPWCMS_URL.'</loc>'.LF; |
echo ' <lastmod>'.date('Y-m-d').'</lastmod>'.LF; | echo ' <lastmod>'.date('Y-m-d').'</lastmod>'.LF; | ||
echo ' </url>'.LF; | echo ' </url>'.LF; | ||
Line 205: | Line 186: | ||
===== Change index.php?alias to alias.phtml ===== | ===== Change index.php?alias to alias.phtml ===== | ||
+ | <note> | ||
+ | **Since r398 implemented in core :!:** | ||
+ | </note> | ||
Forum: [[http://forum.phpwcms.org/viewtopic.php?p=112317#p112317]] | Forum: [[http://forum.phpwcms.org/viewtopic.php?p=112317#p112317]] | ||
- | Rewriting sitemap output with ##/sitemap.php## for sitemap.xml file. (index.php?alias -> /alias.phtml) | + | Rewriting sitemap output of ##/sitemap.php## for sitemap.xml file. (index.php?alias -> /alias.phtml) |
- | Normaly the rewrite to alias.phtml is a htaccess funktion via apache. | + | Normally the rewriting to alias.phtml is an htaccess funktion via apache. |
Patch for sitemap.php: (But only if you are using a standard .htaccess and rewrite to alias.phtml) | Patch for sitemap.php: (But only if you are using a standard .htaccess and rewrite to alias.phtml) | ||
Line 238: | Line 222: | ||
// ---------------------------------------- | // ---------------------------------------- | ||
</code> | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== Multidomain sitemap.php ===== | ||
+ | |||
+ | |||
+ | Enhanced version for using a start-Id in tree against a domain. | ||
+ | |||
+ | <file> | ||
+ | // Your strukture ID -> where would you like to start your sitemap? | ||
+ | $my_start_id = 22; //default if no domain name is given | ||
+ | // All Cat-IDs which have to be excluded permanently e.g. '4,7,34,9' | ||
+ | $_DISABLE_ID = '4,7,34,9'; // Test | ||
+ | |||
+ | // Add the respective START ID corresponding with your domain: remove comment slashes and enter them | ||
+ | $_DOMAIN_ID = array( | ||
+ | |||
+ | // 'domain1.de' => array( 'ID' => 1 ), | ||
+ | // 'domain2.com' => array( 'ID' => 3 ), | ||
+ | // 'domain3.ch' => array( 'ID' => 11 ), | ||
+ | |||
+ | ); | ||
+ | </file> | ||
+ | |||
+ | |||
+ | <note tip>**Available for people those who are writing useful contributions, translations or video clips for the wiki.** // | ||
+ | (As an alternative you could also make an donation).//</note> | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ |