Changeset 4495 for trunk/wp-admin/link-parse-opml.php
- Timestamp:
- 11/19/2006 07:56:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-parse-opml.php
r3295 r4495 5 5 // we need to map XML attribute names to our columns 6 6 $opml_map = array('URL' => 'link_url', 7 8 9 10 11 12 7 'HTMLURL' => 'link_url', 8 'TEXT' => 'link_name', 9 'TITLE' => 'link_name', 10 'TARGET' => 'link_target', 11 'DESCRIPTION' => 'link_description', 12 'XMLURL' => 'link_rss' 13 13 ); 14 14 … … 21 21 function startElement($parser, $tagName, $attrs) { 22 22 global $updated_timestamp, $all_links, $map; 23 23 global $names, $urls, $targets, $descriptions, $feeds; 24 24 25 25 if ($tagName == 'OUTLINE') { 26 27 28 29 30 26 foreach (array_keys($map) as $key) { 27 if (isset($attrs[$key])) { 28 $$map[$key] = $attrs[$key]; 29 } 30 } 31 31 32 32 //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n"); 33 33 34 35 36 37 34 // save the data away. 35 $names[] = $link_name; 36 $urls[] = $link_url; 37 $targets[] = $link_target; 38 38 $feeds[] = $link_rss; 39 40 39 $descriptions[] = $link_description; 40 } // end if outline 41 41 } 42 42 … … 56 56 57 57 if (!xml_parse($xml_parser, $opml, true)) { 58 59 60 58 echo(sprintf(__('XML error: %1$s at line %2$s'), 59 xml_error_string(xml_get_error_code($xml_parser)), 60 xml_get_current_line_number($xml_parser))); 61 61 } 62 62
Note: See TracChangeset
for help on using the changeset viewer.