Changeset 28743 for trunk/src/wp-admin/link-parse-opml.php
- Timestamp:
- 06/11/2014 07:30:26 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/link-parse-opml.php
r27262 r28743 14 14 // columns we wish to find are: link_url, link_name, link_target, link_description 15 15 // we need to map XML attribute names to our columns 16 $opml_map = array('URL' => 'link_url', 16 $opml_map = array( 17 'URL' => 'link_url', 17 18 'HTMLURL' => 'link_url', 18 19 'TEXT' => 'link_name', … … 45 46 */ 46 47 function startElement($parser, $tagName, $attrs) { 47 global $updated_timestamp, $all_links, $map;48 48 global $names, $urls, $targets, $descriptions, $feeds; 49 49 50 if ($tagName == 'OUTLINE') { 51 foreach (array_keys($map) as $key) { 52 if (isset($attrs[$key])) { 53 $$map[$key] = $attrs[$key]; 54 } 50 if ( 'OUTLINE' === $tagName ) { 51 $name = ''; 52 if ( isset( $attrs['TEXT'] ) ) { 53 $name = $attrs['TEXT']; 55 54 } 56 57 //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n"); 58 55 if ( isset( $attrs['TITLE'] ) ) { 56 $name = $attrs['TITLE']; 57 } 58 $url = ''; 59 if ( isset( $attrs['URL'] ) ) { 60 $url = $attrs['URL']; 61 } 62 if ( isset( $attrs['HTMLURL'] ) ) { 63 $url = $attrs['HTMLURL']; 64 } 59 65 // save the data away. 60 $names[] = $ link_name;61 $urls[] = $ link_url;62 $targets[] = $link_target;63 $feeds[] = $link_rss;64 $descriptions[] = $link_description;66 $names[] = $name; 67 $urls[] = $url; 68 $targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : ''; 69 $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : ''; 70 $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : ''; 65 71 } // end if outline 66 72 }
Note: See TracChangeset
for help on using the changeset viewer.