page)-1; //iterate over the pages $fcThisPage=0; while (($fcThisPage <= $fcMaxPages)&& ($fcThisPage <= $fcNumPages)) { $fcPageText ="{$LoadedXML->page[$fcThisPage]->revision->text}"; $fcPageTitle="{$LoadedXML->page[$fcThisPage]->title}"; $fcUserName ="{$LoadedXML->page[$fcThisPage]->revision->contributor->username}"; //pmwiki requires capitalisation of each word that forms file name $fcPageTitle=ucwords(strtolower($fcPageTitle)); $fcPageTitle="$fcGroup.$fcPageTitle"; $fcPageName =str_replace(' ','',$fcPageTitle); $fcPageFileName="$FarmD/newfiles/$fcPageName"; ## uncomment this and set $fcMaxPages to 0 if you have problems ## print "Page $fcThisPage $fcPageTitle $fcPageFileName \n"; // pmwiki encoding - you may need to add more here depending on your site content // $fcPageText =str_replace('%','%25',$fcPageText); $fcPageText =str_replace('<','%3C',$fcPageText); $fcPageText =str_replace("\n",'%0a',$fcPageText); $fcPageContent="version=pmwiki-2.2.0-beta68 ordered=1 urlencoded=1 agent= author=$fcUserName charset=ISO-8859-1 csum= ctime=1220695294 host= name=$fcPageTitle rev=1 targets= text=$fcPageText "; file_put_contents($fcPageFileName,$fcPageContent); $fcThisPage=$fcThisPage+1; } ?>