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

"; - echo "

error:
$error

"; - die(); -} - -$connexion = mysql_connect($server, $loginsql, $passsql) or die("

Check your b2config.php file!

Can't connect to the database
".mysql_error()); -$dbconnexion = mysql_select_db($base, $connexion); - -if (!$dbconnexion) { - echo mysql_error(); - die(); -} $step = $HTTP_GET_VARS['step']; if (!$step) $step = 0; ?> @@ -56,42 +42,41 @@ switch ($step) { $standalone = 0; include_once('b2header.php'); if ($user_level < $minadminlevel) - die ("Cheatin' uh ?"); + die ("Cheatin’ uh?"); ?>
- - - -
-

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.

-
+

On this page you can import your blogroll.

+ +
    +
  1. Go to Blogrolling.com + and sign in. Once you've done that, click on Get Code, and then + look for the OPML + code.
  2. + +
  3. Select that and copy it into the box below.
    + Your OPML code: -

    Please select a category for these links.

    +
  4. +
  5. Now select a category you want to put these links in.
    + Category: + - - -

    Finally, click on the 'Import' button and we're off!

    - + +
  6. + +
  7. +
-
+
- - - -
+

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.

-
+