diff --git a/wp-admin/linkmanager.php b/wp-admin/linkmanager.php index 25e79cd051..62cf722ced 100644 --- a/wp-admin/linkmanager.php +++ b/wp-admin/linkmanager.php @@ -363,8 +363,8 @@ switch ($action) {
- - +
Link Categories:Manage Link Categories
+
Link Categories:Manage Link CategoriesImport Blogroll
Show links in category:
diff --git a/wp-admin/links.import.php b/wp-admin/links.import.php new file mode 100644 index 0000000000..9ed0da6091 --- /dev/null +++ b/wp-admin/links.import.php @@ -0,0 +1,152 @@ +$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; +?> + +
+ + + +
+

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.

+ + + Your OPML code: +

Please select a category for these links.

+ +

Select category: +

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

+ + +
+
+ +
+ + + +
+

Importing...

+You need to supply your OLPML url. Press back on your browser and try again

\n"; + } + else + { + $opml = implode('', file($opml_url)); + preg_match_all('//', $opml, $items); + $names = $items[1]; + $types = $items[2]; + $urls = $items[3]; + $titles = $items[4]; + $targets = $items[5]; + $link_count = count($names); + for ($i = 0; $i < count($names); $i++) { + if ('Last' == 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()); + } +?> +

Inserted links into category .

+ +
+
+ + + \ No newline at end of file