Hi ,
Is it possible to have all the output from DB for posts, comments, trackbacks, pingbacks & also all pages output in xml.
I do not want to use the RSS for XML generation.
What I would ideally like is $Item should return all array values in xml for each and every page of the blog.
Is that possible in version 1.8.5
I would like something like this to be output from the functions in the blog.
<?php
$db_name = "b2evolution";
$connection = mysql_connect('localhost', "demouser", "demopass") else Could not connect.
$table_name = 'evo_blogs';
$db = mysql_select_db($db_name);
$query = "SELECT * FROM " . $table_name;
$result = mysql_query($query) or die("Could not complete database query");
$num = mysql_num_rows($result);
if ($num != 0)
{
$file = fopen("results.xml", "w");
$_xml ="<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n";
$_xml .="<blogs>\r\n";
while ($row = mysql_fetch_array($result))
{
$_xml .="\t<blog title=\"" . $row["title"] . "\">\r\n";
$_xml .="\t\t<author>" . $row["author</isbn>\r\n";
$_xml .="\t\t<category>" . $row["category"] . "</category>\r\n";
$_xml .="\t\t<publisher code=\"" . $row["publishercode"] . "\">" . $row["publisher"] . "</publisher>\r\n";
$_xml .="\t\t<authors>\r\n";
$_xml .="\t\t\t<name>" . $row["authorsname1"] . "</name>\r\n";
$_xml .="\t\t\t<name>" . $row["authorsname2"] . "</name>\r\n";
$_xml .="\t\t</authors>\r\n";
$_xml .="\t</blog>\r\n";
}
$_xml .="</blogs>";
fwrite($file, $_xml);
fclose($file);
echo "XML has been written. <a href=\"results.xml\">View the XML.</a>";
}
else
{
echo "No Records found";
}
?>
You can get every post with a call like this : http://demo.b2evolution.net/v-1-8/blogs/index.php?blog=1&tempskin=_rss2&posts=99999999
¥