Habe folgende Sitemap:
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
/***************************************************************************
* Save this file as: sitemap.php (or anything you like)
* Version: Friday, Oct 4, 2002
* Email: angus@phphacks.com
* Purpose of hack: Basically generates a list of topics and
* displays them with link to the topic. Goal
* is to provide search engines like Google
* with a static page of links to dynamic pages
* You should link to this page from your sites
* home page somewhere.
* Demo: http://www.aussiecelebs.com/forums/site_map.php
* Tested on: phpBB 2.01, 2.02
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
?>
<html>
<head>
<meta http-equiv="content-language" content="de">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Forum :: Sitemap</title>
<meta name="keywords" content="...">
<meta name="description" content="...">
</head>
<?php
echo "<h3>Alle Forum Beiträge</h3>";
$sql = "SELECT t.topic_id FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f
WHERE
t.forum_id = f.forum_id AND f.auth_view = " . AUTH_ALL . " AND p.topic_id = t.topic_id AND p.post_id = t.topic_last_post_id ORDER BY p.post_time DESC";
$topicscount_query = $db->sql_query($sql);
$row_count = $db->sql_numrows($topicscount_query);
$max_count = $row_count/100;
if($HTTP_GET_VARS[next]>0 && $HTTP_GET_VARS[next]<=$max_count) {
$next = $HTTP_GET_VARS[next];
}else {
$next=0;
}
// SQL statement to fetch active topics of public forums
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f
WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . "
AND p.topic_id = t.topic_id
AND p.post_id = t.topic_last_post_id
ORDER BY p.post_time DESC LIMIT ".($next*100).",100";
$topics_query = $db->sql_query($sql);
if ( !$topics_query )
{
message_die(GENERAL_ERROR, "Could not query list of active topics", "", __LINE__, __FILE__, $sql);
}
else if ( !$db->sql_numrows($topics_query) )
{
message_die(GENERAL_MESSAGE, $lang['No_match']);
}
else
{
while ($topic = $db->sql_fetchrow($topics_query))
{
echo "<a href='" . append_sid("viewtopic.php?t=".$topic['topic_id'])."'>".$topic["topic_title"]."</a><br>\n";
}
}
echo "
<BR><BR>
[
";
for($ii=0; $ii<$max_count; $ii++) {
if($ii+1<$max_count) {
if($ii==$next) {
echo("<A> ".($ii+1)." |</A>");
}else{
echo("<A HREF='" . append_sid("sitemap".($ii)).".html'> ".($ii+1)." |</A>");
}
}else{
if($ii==$next) {
echo("<A> ".($ii+1)." </A>");
}else{
echo("<A HREF='" . append_sid("sitemap".($ii)).".html'> ".($ii+1)." </A>");
}
}
}
echo "
]
</body>
</html>
";
?>