- Modificatie & Versie:
Directe link naar de modificatie:
Adres van je forum: http://
phpBB versie:
Heb je onlangs een andere modificatie of stijl geïnstalleerd?
Wat is het probleem?
Wie ziet mijn fouten?
Code: Selecteer alles
<?php
// We willen GEEN php, maar xml:
header ('Content-Type: text/xml');
// Verbinden met de database
define ('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'forum_cms/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
//string htmlspecialchars ( string $string [, int $quote_style= ENT_COMPAT [, string $charset [, bool $double_encode= true ]]] )
// Errors voorkomen:
if(empty($_GET['feed']))
$feed = 'Geen berichten';
else
$feed = $_GET['feed'];
// Begin maken:
echo "<?xml version=\"1.0\" encoding=\"windows-1252\"?>
<rss version=\"2.0\" xmlns:coop=\"http://www.google.com/coop/namespace\">
<channel>
<title>Factscommunity.nl - Nieuws</title>
<link>http://www.factscommunity.nl/</link>
<description>Het laatste Gaming nieuws. Van XBOX tot Wii<description>
<language>nl</language>";
// Nieuwsberichten
$sql3 = "SELECT DISTINCT( p.`post_id` ), `p`.`bbcode_uid`, t.`topic_id`, t.`topic_time`, t.`forum_id`, t.`topic_title`, t.`topic_first_poster_name`, t.`topic_replies`, f.`forum_name`
FROM `Forum_topics` AS `t`, `Forum_posts` AS `p`, `Forum_forums` AS `f`
WHERE `t`.`topic_id` = `p`.`topic_id`
AND `t`.`forum_id` IN ('47', '48', '49', '50','57')
AND `t`.`topic_first_post_id` = `p`.`post_id`
AND `t`.`forum_id` = `f`.`forum_id`
GROUP BY (p.`topic_id`)
ORDER BY `p`.`topic_id` DESC";
$result = $db->sql_query_limit($sql3, 0,20);
while ($row = $db->sql_fetchrow($result))
$delete_forum = array("`","'","~","!","@","#","$","%","^","&","*","(",")","-","_","=","+","[","{","]","}",";",":","'","\"","\\","|",",","<",".",">","/","?");
$forum_seo['forum_name'] = str_replace($delete_forum, '', strtolower($row['forum_name']));
$forum_seo['forum_name'] = str_replace(' ', ' ', $forum_seo['forum_name']);
$forum_seo['forum_name'] = str_replace(' ', '-', $forum_seo['forum_name']);
$delete_topic = array("~","!","@","#","$","%","^","&","*","(",")","-","_","=","+","[","{","]","}",";",":","\"","\\","|",",","<",".",">","/","?");
$topic_seo['topic_title'] = str_replace($delete_topic, '', strtolower($row['topic_title']));
$topic_seo['topic_title'] = str_replace(array("`","'"), '-', $topic_seo['topic_title']);
$topic_seo['topic_title'] = str_replace(' ', ' ', $topic_seo['topic_title']);
$topic_seo['topic_title'] = str_replace(' ', '-', $topic_seo['topic_title']);
$row = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $row);
$row = str_replace("\n", "\n<br />\n", $row);
$time = date("d.m.Y H:i", $row['topic_time']);
$title = stripslashes( $row['topic_title'] );
{
$pubdate = ($time);
$url = "http://www.factscommunity.nl/" . $forum_seo['forum_name'] . "-f" . $row['forum_id'] . "/" . $topic_seo['topic_title'] . "-t" . $row['topic_id'] . ".html";
$titel = $row['topic_title'];
$description = $row['post_text'];
echo "
<item>
<title>Nu op de site: <![CDATA[$titel]]></title>
<guid>$url</guid>
<coop:keyword><![CDATA[$titel]]></coop:keyword>
<link>$url</link>
<pubDate>$date +21600</pubDate>
<description><![CDATA[$description]]></description>
</item>";
}
echo "</channel>
</rss>";
?>