trailing tabs and whitespace cleanup.
git-svn-id: http://svn.automattic.com/wordpress/trunk@4953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c7ce6107ad
commit
d0f79bb3f2
|
@ -12,8 +12,7 @@ if (!$step) $step = 0;
|
|||
?>
|
||||
<?php
|
||||
switch ($step) {
|
||||
case 0:
|
||||
{
|
||||
case 0: {
|
||||
include_once('admin-header.php');
|
||||
if ( !current_user_can('manage_links') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
@ -22,6 +21,7 @@ switch ($step) {
|
|||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<h2><?php _e('Import your blogroll from another system') ?> </h2>
|
||||
<form enctype="multipart/form-data" action="link-import.php" method="post" name="blogroll">
|
||||
<?php wp_nonce_field('import-bookmarks') ?>
|
||||
|
@ -40,7 +40,6 @@ switch ($step) {
|
|||
<input id="userfile" name="userfile" type="file" size="30" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<p style="clear: both; margin-top: 1em;"><?php _e('Now select a category you want to put these links in.') ?><br />
|
||||
|
@ -72,19 +71,16 @@ foreach ($categories as $category) {
|
|||
?>
|
||||
<div class="wrap">
|
||||
|
||||
<h2><?php _e('Importing...') ?></h2>
|
||||
<h2><?php _e('Importing...') ?></h2>
|
||||
<?php
|
||||
$cat_id = $_POST['cat_id'];
|
||||
if (($cat_id == '') || ($cat_id == 0)) {
|
||||
if ( $cat_id == '' || $cat_id == 0 )
|
||||
$cat_id = 1;
|
||||
}
|
||||
|
||||
$opml_url = $_POST['opml_url'];
|
||||
if (isset($opml_url) && $opml_url != '' && $opml_url != 'http://') {
|
||||
if ( isset($opml_url) && $opml_url != '' && $opml_url != 'http://' ) {
|
||||
$blogrolling = true;
|
||||
}
|
||||
else // try to get the upload file.
|
||||
{
|
||||
} else { // try to get the upload file.
|
||||
$overrides = array('test_form' => false, 'test_type' => false);
|
||||
$file = wp_handle_upload($_FILES['userfile'], $overrides);
|
||||
|
||||
|
@ -96,30 +92,32 @@ foreach ($categories as $category) {
|
|||
$blogrolling = false;
|
||||
}
|
||||
|
||||
if (isset($opml_url) && $opml_url != '') {
|
||||
if ( isset($opml_url) && $opml_url != '' ) {
|
||||
$opml = wp_remote_fopen($opml_url);
|
||||
include_once('link-parse-opml.php');
|
||||
|
||||
$link_count = count($names);
|
||||
for ($i = 0; $i < $link_count; $i++) {
|
||||
for ( $i = 0; $i < $link_count; $i++ ) {
|
||||
if ('Last' == substr($titles[$i], 0, 4))
|
||||
$titles[$i] = '';
|
||||
if ('http' == substr($titles[$i], 0, 4))
|
||||
if ( 'http' == substr($titles[$i], 0, 4) )
|
||||
$titles[$i] = '';
|
||||
$link = array( 'link_url' => $urls[$i], 'link_name' => $wpdb->escape($names[$i]), 'link_category' => array($cat_id), 'link_description' => $wpdb->escape($descriptions[$i]), 'link_owner' => $user_ID, 'link_rss' => $feeds[$i]);
|
||||
wp_insert_link($link);
|
||||
echo sprintf('<p>'.__('Inserted <strong>%s</strong>').'</p>', $names[$i]);
|
||||
}
|
||||
?>
|
||||
<p><?php printf(__('Inserted %1$d links into category %2$s. All done! Go <a href="%3$s">manage those links</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p>
|
||||
<?php
|
||||
} // end if got url
|
||||
else
|
||||
{
|
||||
echo "<p>" . __("You need to supply your OPML url. Press back on your browser and try again") . "</p>\n";
|
||||
} // end else
|
||||
|
||||
if ( ! $blogrolling )
|
||||
<p><?php printf(__('Inserted %1$d links into category %2$s. All done! Go <a href="%3$s">manage those links</a>.'), $link_count, $cat_id, 'link-manager.php') ?></p>
|
||||
|
||||
<?php
|
||||
} // end if got url
|
||||
else
|
||||
{
|
||||
echo "<p>" . __("You need to supply your OPML url. Press back on your browser and try again") . "</p>\n";
|
||||
} // end else
|
||||
|
||||
if ( ! $blogrolling )
|
||||
@unlink($opml_url);
|
||||
?>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue