Sitemap für Google als xml ausgeben lassen
Verfasst: 05.06.2005 11:10
Ist es möglich die sitemap.php auch extra nocheinmal als .xml ausgeben zu lassen (oder auslesen zu lassen)? Ich würde gern den neuen Google Sitemap Service nutzen.
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Was habe ich verhauen?Error obtaining topic data
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
SELECT t.topic_id, t.topic_type, t.topic_status, p.post_time FROM phpbb_topics AS t, phpbb_posts AS p WHERE t.topic_last_post_id=p.post_id AND t.forum_id IN (2,3,4,5,6,7,8,9,10,11,12,13) ORDER BY t.topic_id LIMIT
Line : 84
File : sitemap.php
wie kann ich das machen? bis jetzt haben alle mod so hingehauen.docs gelesen und datenbank-anpassung ausgeführt?
Code: Alles auswählen
<?php
$phpbb_root_path = ''; // muß angepasst werden, falls eine Ebene unter dem Forumsordner.
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$server_url = $server_protocol . $server_name . $server_port . $script_name;
if(substr($server_url, -1, 1) != "/") { $server_url .= "/"; }
$server_url = code_utf8($server_url);
$zeit = time();
$pre_timezone = date('O', $zeit);
$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
$result = mysql_query("SELECT topic_id,post_time FROM " . POSTS_TABLE ) ;
while( $row = mysql_fetch_assoc($result)) {
if($last_time[$row["topic_id"]] < $row["post_time"]) { $last_time[$row["topic_id"]] = $row["post_time"]; }
}
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">
<url>
<loc>'.$server_url.'</loc>
<changefreq>always</changefreq>
<priority>1.0</priority>
</url>
';
$result = mysql_query("SELECT topic_id,topic_replies,topic_time FROM " . TOPICS_TABLE . " ORDER BY topic_id DESC LIMIT 50000") ;
while( $row = mysql_fetch_assoc($result)) {
$topicId = $row["topic_id"] ;
$alter = $zeit - $last_time[$row["topic_id"]] ;
$zeitbonus = max(min(round((600000 - $alter ) / 80000),7),0) ;
$last_time_post = date("Y-m-d\TH:i:s",$last_time[$row["topic_id"]]) . $time_zone ;
if ($alter < 604800) { $changefreq = 'weekly'; } else { $changefreq = 'monthly'; }
if ($alter < 84000) { $changefreq = 'daily'; }
$topicpriority = min(( $row["topic_replies"] + 1 + $zeitbonus ),9) ;
echo " <url>
<loc>".$server_url."viewtopic.php?t=$topicId</loc>
<lastmod>$last_time_post</lastmod>
<changefreq>$changefreq</changefreq>
<priority>0.$topicpriority</priority>
</url>
";
}
echo '</urlset>';
function code_utf8($text) {
$array_1 = array("&","\"","'",">","<","");
$array_2 = array("&",""","'",">","<","");
for($x=0;$x<4;$x++){
$text = str_replace($array_1[$x],$array_2[$x],$text);
}
return $text;
}
?>