JohnF_vbulletin3_import33261
New Member
Alright here is the thing, I have this site that was once wordpress but have been converted into 70+ static pages, the admin is deleted and the whole site is static(which means every page is in index.html), I want to create a script that makes an xml so that I will just have to import it in the new wordpress install.So far, I am able to create an XML but it only imports one post.The data source is the URL of a page and I use jquery $get to filter only to gather the post of a given archive.\[code\]//html<input type="text" class="full_path"><input type="button" value="http://stackoverflow.com/questions/12705473/Get Data" class="getdata">//script$('.getdata').click(function(){ $.get($('.full_path').val(), function(data) { post = $(data).find('div [style*="width:530px;"]'); $('.result').html(post.html()); }); });//get Data\[/code\]Through AJAX I send the cleaned data into a php below that creates the XML:\[code\]$file = 'newpost.xml';$post_data = http://stackoverflow.com/questions/12705473/$_REQUEST['post_data'];// Open the file to get existing content$current = file_get_contents($file);// Append a new post to the file$catStr = '';if(isset($post_data['categories']) && count($post_data['categories']) > 0){ foreach($post_data['categories'] as $category) { $catStr .= '<category domain="category" nicename="'.$category.'"><![CDATA['.$category.']]></category>'; } }$tagStr = '';if(isset($post_data['tags']) && count($post_data['tags']) > 0){ //populate post_tag like the above}$post_name = str_replace(' ','-',$post_data["title"]);$post_name = str_replace(array('"','/',':','.',',','[',']','