Author Topic

Paul Leclercq

Tuesday 27 November 2007 9:15:25 am

Comment25578

personnaly I would recommend using rss feeds to export your data.

There is a very good exemple on how to export your data using rss feeds on this page:
http://pwet.fr/blog/des_fils_rss_sur_mesure_dans_ez_publish

unfortunatly this is in french, but basically, all you need to do is create an overide for your pagelayout, and create an rss view. In which you will put the following code:

<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
<language>fr-FR</language>
{$module_result.content}
</channel>
</rss>

You will then simply need to create overrides to display the various content:
design/<mon_design>/templates/node/view/rss_full.tpl

You will then need an import function to import your data in drupal.

this simple function will read the url you whish. All you will need to do the is get the info in the xml using the xml parser you would like and import the data in your database. This way you could

function getFlux($flux)
{
$handle = fopen($flux, "rb");
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
return($contents);
}