Pagina 1 van 1

Rss Mod

Geplaatst: 28 jun 2004, 18:28
door [_M-A-R-K_]
Ik heb dus de rss mod gedownload en geupload en nu krijg ik dit

De XML-pagina kan niet worden weergegeven
Kan XML-invoer niet lezen met opmaakmodel XSL. Herstel de fout en klik vervolgens op de knop Vernieuwen of probeer het later opnieuw.


--------------------------------------------------------------------------------

De volgende labels zijn niet afgesloten: rss. Fout bij het verwerken van bron http://cp152095-a.landg1.lb.home.nl/Forum/rss.php.



wat doe ik verkeerd moet ik iets veranderen :?

Geplaatst: 28 jun 2004, 19:55
door mosymuis
Internet Explorer is weer vaag als altijd, Mozilla geeft:
XML Parsing Error: no element found
Location: http://cp152095-a.landg1.lb.home.nl/Forum/rss.php
Line Number 18, Column 1:
dit betekent dat je laatste tag mist:

Code: Selecteer alles

</rss>

Geplaatst: 29 jun 2004, 06:18
door [_M-A-R-K_]
Bedoel je dat ik van

Code: Selecteer alles

<?

include("config.php");
$link=@mysql_connect($dbhost, $dbuser, $dbpasswd);
@mysql_select_db($dbname) or die();

$sql = "select * from ".$table_prefix."config";
$result = mysql_query($sql);
while($sitedata = mysql_fetch_array($result)) {
	switch ($sitedata[0]) {	
		case "cookie_domain":
			$cookie_domain = $sitedata[1];
			break;			
		case "cookie_path":
			$cookie_path = $sitedata[1];
			break;			
		case "sitename":
			$sitename = $sitedata[1];
			break;			
		case "site_desc":
			$site_desc = $sitedata[1];
			break;			
	}
}

$sql = 'SELECT '.$table_prefix.'topics.topic_title, '.$table_prefix.'topics.topic_replies, '.$table_prefix.'topics.topic_id, '.$table_prefix.'posts.post_time, '.$table_prefix.'topics.topic_poster, '.$table_prefix.'users.username, '.$table_prefix.'posts_text.post_text FROM '.$table_prefix.'topics, '.$table_prefix.'posts, '.$table_prefix.'forums, '.$table_prefix.'users, '.$table_prefix.'posts_text WHERE '.$table_prefix.'posts.post_id='.$table_prefix.'posts_text.post_id and '.$table_prefix.'posts.post_id='.$table_prefix.'topics.topic_last_post_id AND '.$table_prefix.'topics.topic_moved_id=0 AND '.$table_prefix.'forums.forum_id='.$table_prefix.'topics.forum_id AND '.$table_prefix.'users.user_id='.$table_prefix.'posts.poster_id AND '.$table_prefix.'forums.auth_view=0 ORDER BY '.$table_prefix.'topics.topic_id DESC LIMIT 0,20';
$result = @mysql_query($sql);

header("Content-Type: text/xml");
echo "<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n<channel>\n<title>$sitename</title>\n<link>http://" . $cookie_domain . $cookie_path."</link>\n<description>$site_desc</description>\n<language>en-us</language>\n<generator>phpBB</generator>\n<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n"; 

while ($data=@mysql_fetch_array($result)) {
	$posts=$data[1]+1;
	echo "<item>\n<title>".htmlspecialchars($data[0])."</title>\n<link>http://" . $cookie_domain . $cookie_path."viewtopic.php?t=".$data[2]."</link>\n<description>".htmlspecialchars($data[6])."</description>\n<author>".htmlspecialchars($data[5])."</author><pubDate>".$data[3]."</pubDate>\n</item>\n\n";
}
echo "</channel>\n";

@mysql_close($link);

?>
Moet maken

Code: Selecteer alles

<?

include("config.php");
$link=@mysql_connect($dbhost, $dbuser, $dbpasswd);
@mysql_select_db($dbname) or die();

$sql = "select * from ".$table_prefix."config";
$result = mysql_query($sql);
while($sitedata = mysql_fetch_array($result)) {
	switch ($sitedata[0]) {	
		case "cookie_domain":
			$cookie_domain = $sitedata[1];
			break;			
		case "cookie_path":
			$cookie_path = $sitedata[1];
			break;			
		case "sitename":
			$sitename = $sitedata[1];
			break;			
		case "site_desc":
			$site_desc = $sitedata[1];
			break;			
	}
}

$sql = 'SELECT '.$table_prefix.'topics.topic_title, '.$table_prefix.'topics.topic_replies, '.$table_prefix.'topics.topic_id, '.$table_prefix.'posts.post_time, '.$table_prefix.'topics.topic_poster, '.$table_prefix.'users.username, '.$table_prefix.'posts_text.post_text FROM '.$table_prefix.'topics, '.$table_prefix.'posts, '.$table_prefix.'forums, '.$table_prefix.'users, '.$table_prefix.'posts_text WHERE '.$table_prefix.'posts.post_id='.$table_prefix.'posts_text.post_id and '.$table_prefix.'posts.post_id='.$table_prefix.'topics.topic_last_post_id AND '.$table_prefix.'topics.topic_moved_id=0 AND '.$table_prefix.'forums.forum_id='.$table_prefix.'topics.forum_id AND '.$table_prefix.'users.user_id='.$table_prefix.'posts.poster_id AND '.$table_prefix.'forums.auth_view=0 ORDER BY '.$table_prefix.'topics.topic_id DESC LIMIT 0,20';
$result = @mysql_query($sql);

header("Content-Type: text/xml");
echo "<?xml version=\"1.0\"?>\n<rss version=\"2.0\">\n<channel>\n<title>$sitename</title>\n<link>http://" . $cookie_domain . $cookie_path."</link>\n<description>$site_desc</description>\n<language>en-us</language>\n<generator>phpBB</generator>\n<docs>http://blogs.law.harvard.edu/tech/rss</docs>\n"; 

while ($data=@mysql_fetch_array($result)) {
	$posts=$data[1]+1;
	echo "<item>\n<title>".htmlspecialchars($data[0])."</title>\n<link>http://" . $cookie_domain . $cookie_path."viewtopic.php?t=".$data[2]."</link>\n<description>".htmlspecialchars($data[6])."</description>\n<author>".htmlspecialchars($data[5])."</author><pubDate>".$data[3]."</pubDate>\n</item>\n\n";
}
echo "</channel>\n";

@mysql_close($link);

?>
</rss>

Geplaatst: 29 jun 2004, 07:31
door mosymuis
Daar lijkt het wel op, ja. Probeer het eens zou ik zeggen. ;)