feedoutput = $feed; $this->parse_opml($file); $this->generate_table(); } function parse_opml ($file) { $fp = fopen($file, 'r'); if (!$fp) return; $xml = fread($fp, filesize($file)); fclose($fp); $parser = xml_parser_create(''); $status = xml_parse_into_struct($parser, $xml, $this->vals, $this->index); xml_parser_free($parser); if (!$status) return; return true; } function generate_table () // creates table from parsed OPML file { $this->html .= ''; } } function showopml($file, $feed = true) { $opml = new OPMLtoHTML($file, $feed); echo $opml->html; echo '共' . $opml->count . '个feed。'; } $bl_opml_url = ''; function download_blv_opml() { global $bl_opml_url; $bl_opml = @file_get_contents($bl_opml_url) ; if (!$bl_opml) return false; $f = @fopen(ABSPATH . 'export.opml', "w"); if (!$f) return false; fwrite($f,$bl_opml); fclose($f); } if (function_exists('wp_cron_init') and ($bl_opml_url != '')) add_action('wp_cron_daily', 'download_blv_opml'); ?>