diff --git a/wp-admin/links.import.php b/wp-admin/links.import.php index 9ed0da6091..438c1ce0b6 100644 --- a/wp-admin/links.import.php +++ b/wp-admin/links.import.php @@ -32,20 +32,6 @@ include_once("../wp-links/links.php"); $title = 'Import Blogroll'; -function mysql_doh($msg,$sql,$error) { - echo "
$msg
"; - echo "query:
$sql
error:
$error
- On this page you can import your blogroll.-You will need your unique blogrolling.com Id. -First, go to Blogrolling.com - and sign in. Once you've done that, click on Get Code, and then - look for the OPML - code. -Select that and copy it into the box below. - - |
-
+
Importing...You need to supply your OLPML url. Press back on your browser and try again\n"; + echo "You need to supply your OPML url. Press back on your browser and try again \n"; } else { @@ -126,22 +110,23 @@ switch ($step) { $titles = $items[4]; $targets = $items[5]; $link_count = count($names); - for ($i = 0; $i < count($names); $i++) { + for ($i = 0; $i < $link_count; $i++) { if ('Last' == substr($titles[$i], 0, 4)) + $titles[$i] = ''; + if ('http' == substr($titles[$i], 0, 4)) $titles[$i] = ''; //echo "INSERT INTO $tablelinks (link_url, link_name, link_target, link_category, link_description, link_owner) VALUES('{$urls[$i]}', '{$names[$i]}', '{$targets[$i]}', $cat_id, '{$titles[$i]}', \$user_ID)\n"; - $query = "INSERT INTO $tablelinks (link_url, link_name, link_target, link_category, link_description, link_owner)\n " . - " VALUES('{$urls[$i]}', '".addslashes($names[$i])."', '{$targets[$i]}', $cat_id, '".addslashes($titles[$i])."', $user_ID)\n"; - $result = mysql_query($query) or die("Couldn't insert link. Sorry".mysql_error()); + $query = "INSERT INTO $tablelinks (link_url, link_name, link_target, link_category, link_description, link_owner) + VALUES('{$urls[$i]}', '".addslashes($names[$i])."', '{$targets[$i]}', $cat_id, '".addslashes($titles[$i])."', $user_ID)\n"; + $result = $wpdb->query($query); + echo " Inserted {$names[$i]} "; } ?> -Inserted links into category . +Inserted links into category . All done! Go manage those links. - |
-