Changeset 1107
- Timestamp:
- 04/20/2004 10:01:15 PM (21 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/link-import.php
r1099 r1107 124 124 $titles[$i] = ''; 125 125 $query = "INSERT INTO $tablelinks (link_url, link_name, link_target, link_category, link_description, link_owner, link_rss) 126 VALUES('{$urls[$i]}', '".addslashes($names[$i])."', '', $cat_id, '".addslashes($descriptions[$i])."', $user_ID, {$feeds[$i]})\n";126 VALUES('{$urls[$i]}', '".addslashes($names[$i])."', '', $cat_id, '".addslashes($descriptions[$i])."', $user_ID, '{$feeds[$i]}')\n"; 127 127 $result = $wpdb->query($query); 128 128 echo "<p>Inserted <strong>{$names[$i]}</strong></p>"; -
trunk/wp-admin/link-parse-opml.php
r1099 r1107 5 5 // columns we wish to find are: link_url, link_name, link_target, link_description 6 6 // we need to map XML attribute names to our columns 7 // if we are doing OPML use this map 8 $opml_map = array( 9 'link_url' => 'URL', 10 'link_url' => 'HTMLURL', 11 'link_name' => 'TEXT', 12 'link_name' => 'TITLE', 13 'link_target' => 'TARGET', 14 'link_description' => 'DESCRIPTION', 15 'link_rss' => 'XMLURL' 7 $opml_map = array('URL' => 'link_url', 8 'HTMLURL' => 'link_url', 9 'TEXT' => 'link_name', 10 'TITLE' => 'link_name', 11 'TARGET' => 'link_target', 12 'DESCRIPTION' => 'link_description', 13 'XMLURL' => 'link_rss' 16 14 ); 17 15 … … 27 25 28 26 if ($tagName == 'OUTLINE') { 29 if ($map['link_url'] != '') 30 $link_url = $attrs[$map['link_url']]; 31 if ($map['link_name'] != '') 32 $link_name = $attrs[$map['link_name']]; 33 if ($map['link_target'] != '') 34 $link_target = $attrs[$map['link_target']]; 35 if ($map['link_description'] != '') 36 $link_description = $attrs[$map['link_description']]; 37 if ($map['link_rss'] != '') 38 $link_rss = $attrs[$map['link_rss']]; 27 foreach (array_keys($map) as $key) { 28 if (isset($attrs[$key])) { 29 $$map[$key] = $attrs[$key]; 30 } 31 } 32 39 33 //echo("got data: link_url = [$link_url], link_name = [$link_name], link_target = [$link_target], link_description = [$link_description]<br />\n"); 34 40 35 // save the data away. 41 36 $names[] = $link_name; … … 44 39 $feeds[] = $link_rss; 45 40 $descriptions[] = $link_description; 46 } 41 } // end if outline 47 42 } 48 43
Note: See TracChangeset
for help on using the changeset viewer.