- Timestamp:
- 11/17/13 20:25:53 (12 years ago)
- Branch:
- 2.6
- Children:
- 2567:6c11245cbf04, 2568:61c67a7d17fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/blogroll/class.dc.importblogroll.php
r1179 r2566 15 15 { 16 16 protected $entries = null; 17 17 18 18 public function parse($data) 19 19 { … … 28 28 } 29 29 } 30 31 30 31 32 32 protected function _parseOPML($data) 33 33 { 34 34 $xml = @simplexml_load_string($data); 35 35 if (!$xml) throw new Exception(__('File is not in XML format.')); 36 36 37 37 $outlines = $xml->xpath("//outline"); 38 38 39 39 $this->entries = array(); 40 40 foreach ($outlines as $outline) { … … 56 56 } 57 57 } 58 58 59 59 protected function _parseXBEL($data) 60 60 { 61 61 $xml = @simplexml_load_string($data); 62 62 if (!$xml) throw new Exception(__('File is not in XML format.')); 63 63 64 64 $outlines = $xml->xpath("//bookmark"); 65 65 66 66 $this->entries = array(); 67 67 foreach ($outlines as $outline) { … … 77 77 } 78 78 } 79 80 79 80 81 81 public function getAll() 82 82 { … … 84 84 return $this->entries; 85 85 } 86 86 87 87 } 88 88 89 89 class dcImportBlogroll { 90 90 91 91 public static function loadFile($file) 92 92 { 93 93 if (file_exists($file) && is_readable($file)) { 94 94 $importer = new linksImporter(); 95 $importer->parse(file_get_contents($file)); 95 $importer->parse(file_get_contents($file)); 96 96 return $importer->getAll(); 97 97 } … … 99 99 } 100 100 } 101 ?>
Note: See TracChangeset
for help on using the changeset viewer.