Example #1
0
 function load($file)
 {
     if (@file_exists($file)) {
         $opml = new opml();
         //Remove BOM if needed
         $BOM = '/^/';
         $fileContent = file_get_contents($file);
         $fileContent = preg_replace($BOM, '', $fileContent, 1);
         //Parse
         $opml->parse($fileContent);
         return $opml;
     }
 }
Example #2
0
function generate_opml()
{
    $opml_data = array('head' => array('title' => blog_title() . ' OPML File', 'ownerName' => blog_title(), 'ownerId' => site_url()), 'body' => array(array('text' => blog_title(), 'description' => blog_description(), 'htmlUrl' => site_url(), 'language' => 'unknown', 'title' => blog_title(), 'type' => 'rss', 'version' => 'RSS2', 'xmlUrl' => site_url() . 'feed/rss')));
    $opml = new opml($opml_data);
    echo $opml->render();
}