I'm trying to create a PORTAL BLOCK (or php block?) to show in geeklog's home page last 10 posts in my phpbb forum.
This is the PHPBB code, if I try to execute PHP in a blank page I receive the topic list (corecctly). But if I try to use in geeklog, creating a new portal block, I get an error:
mer 27 feb 2008 17:48:46 CET - Unable to aquire feed reader for http://www.xxx.it/test.php
mer 27 feb 2008 17:48:46 CET - Unable to parse XML Error Code: 9 Error Message: Invalid character
Text Formatted Code
<?php
// forum db access...
$db_host = 'localhost';
$db_name = 'name';
$db_user = 'username';
$db_password = 'password';
$db = mysql_connect($db_host, $db_user, $db_password);
if ($db == FALSE)
die ("Connection Error.");
mysql_select_db($db_name, $db)
or die ("Error selecting database.");
// forum id you dont want to show
$query = "SELECT topic_id,topic_title FROM phpbb_topics WHERE forum_id !='7' AND forum_id !='44' AND forum_id !='29' AND forum_id !='25' AND forum_id !='54' AND forum_id !='62' AND forum_id !='66' AND forum_id !='60' ORDER BY topic_last_post_id DESC LIMIT 0,10";
$result = mysql_query($query, $db);
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\" \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">";
echo "<rss version=\"0.91\">";
echo "<channel>";
echo "<title>title</title>";
echo "<link>forum link</link>";
echo "<description>forum description</description>";
while ($row = mysql_fetch_array($result))
{ echo "<item>";
echo "<title>$row[topic_title]</title>";
echo "<link>http://www.xxx.it/forum/viewtopic.php?t=$row[topic_id]</link>";
echo "<description></description>";
echo "</item>"; }
echo "</channel>";
echo "</rss>";
mysql_close($db);
?>