Tiggr
Thu. 20. September 2007, 12:31
Ich glaub ja immer noch, mit dem passenden Layout müsste das gehen!
Eventuell muss nur ein Parameter übergeben werden, wegen der aktuellen Seite.
Google-Sitemap geht so auch dynamisch:
Layout:CODE
<CMSPHP>
header("Content-type: text/xml");
echo '<'.'?xml version="1.0" encoding="UTF-8"?'.'>'."\n";
// Funktionen
if (!function_exists('htmlentitydecode')) {
function htmlentitydecode($string) {
$trans_tbl = get_html_translation_table (HTML_ENTITIES);
$trans_tbl = array_flip ($trans_tbl);
return strtr ($string, $trans_tbl);
}
}
if (!function_exists('replace_specials')) {
function replace_specials($text) {
$text = stripslashes($text);
if(strcmp('4.3', phpversion()) > 0) {
$text = htmlentitiesdecode($text);
$text = htmlspecialchars(strip_tags($text));
} else {
$hometext = htmlspecialchars(strip_tags(html_entity_decode($hometext)));
}
return $text;
}
}
</CMSPHP>
<cms:lay type="container" id="100" title="Sitemap"/>
<CMSPHP>
// Anker wg. CatWalker Bug entfernen
$mod['manipulate_output'] .= '$output = preg_replace("/<a.+\/a>?>/","",$output);';
// Kommentare der Container entfernen
$mod['manipulate_output'] .= '$output = preg_replace("/<!--.+-->?>/","",$output);';
// Zeilenumbrüche <br> und <br /> entfernen
$mod['manipulate_output'] .= '$output = str_replace("<br>","",$output);';
$mod['manipulate_output'] .= '$output = str_replace("<br />","",$output);';
// Zeitformat umwandeln im <lastmod> Tag
$mod['manipulate_output'] .= '$output = preg_replace("/<lastmod>(..)\.(..)\.(....)<\/lastmod>?>/","<lastmod>\\\\3-\\\\2-\\\\1</lastmod>",$output);';
// date(\'r\',strtotime(\
// Sonderzeichen maskieren, weitere Tags hier ggf. hinzufügen.
$mod['manipulate_output'] .= '$output = preg_replace("/<title>(.+?)<\/title>?>/e","\'<title>\'.replace_specials(\'\\\\1\').\'</title>\'",$output);';
$mod['manipulate_output'] .= '$output = preg_replace("/<description>(.+?)<\/description>?>/e","\'<description>\'.replace_specials(\'\\\\1\').\'</description>\'",$output);';
$mod['manipulate_output'] .= '$output = preg_replace("/<generator>(.+)<\/generator>?>/","<generator>'.replace_specials("$1").'</generator>",$output);';
// realtive in absolute Links zurückwandeln
$mod['manipulate_output'] .= '$output = preg_replace("/<loc>(.+)<\/loc>?>/","<loc>http://www.colorful-sky.de/'.replace_specials("$1").'</loc>",$output);';
$cfg_client['manipulate_output'] = $mod['manipulate_output'].$cfg_client['manipulate_output'];
</CMSPHP>
Und befüllt wird das dann mit dem Categorywalker!
Tschüss
Tiggr (aka Marcus)