<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13734] trunk/wp-admin/import/livejournal.php: LJ importer tweaks.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13734">13734</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-03-17 16:52:44 +0000 (Wed, 17 Mar 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>LJ importer tweaks. Props briancolinger. fixes <a href="http://trac.wordpress.org/ticket/12620">#12620</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminimportlivejournalphp">trunk/wp-admin/import/livejournal.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminimportlivejournalphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/import/livejournal.php (13733 => 13734)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/import/livejournal.php        2010-03-17 16:27:25 UTC (rev 13733)
+++ trunk/wp-admin/import/livejournal.php        2010-03-17 16:52:44 UTC (rev 13734)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">                         <input type="hidden" name="step" value="<?php echo esc_attr( get_option( 'ljapi_step' ) ) ?>" />
</span><span class="cx">                         <p><?php _e( 'It looks like you attempted to import your LiveJournal posts previously and got interrupted.' ) ?></p>
</span><span class="cx">                         <p class="submit">
</span><del>-                                <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Continue previous import' ) ?>" />
</del><ins>+                                <input type="submit" class="button" value="<?php esc_attr_e( 'Continue previous import' ) ?>" />
</ins><span class="cx">                         </p>
</span><span class="cx">                         <p class="submitbox"><a href="<?php echo esc_url($_SERVER['PHP_SELF'] . '?import=livejournal&amp;step=-1&amp;_wpnonce=' . wp_create_nonce( 'lj-api-import' ) . '&amp;_wp_http_referer=' . esc_attr( $_SERVER['REQUEST_URI'] )) ?>" class="deletion submitdelete"><?php _e( 'Cancel &amp; start a new import' ) ?></a></p>
</span><span class="cx">                         <p>
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">                         <p><?php _e( "<strong>WARNING:</strong> This can take a really long time if you have a lot of entries in your LiveJournal, or a lot of comments. Ideally, you should only start this process if you can leave your computer alone while it finishes the import." ) ?></p>
</span><span class="cx">
</span><span class="cx">                         <p class="submit">
</span><del>-                                <input type="submit" class="button-primary" value="<?php esc_attr_e( 'Connect to LiveJournal and Import' ) ?>" />
</del><ins>+                                <input type="submit" class="button" value="<?php esc_attr_e( 'Connect to LiveJournal and Import' ) ?>" />
</ins><span class="cx">                         </p>
</span><span class="cx">
</span><span class="cx">                         <p><?php _e( '<strong>NOTE:</strong> If the import process is interrupted for <em>any</em> reason, come back to this page and it will continue from where it stopped automatically.' ) ?></p>
</span><span class="lines">@@ -762,6 +762,9 @@
</span><span class="cx">         // Check form inputs and start importing posts
</span><span class="cx">         function step1() {
</span><span class="cx">                 global $verified;
</span><ins>+
+                do_action( 'import_start' );
+
</ins><span class="cx">                 set_time_limit( 0 );
</span><span class="cx">                 update_option( 'ljapi_step', 1 );
</span><span class="cx">                 if ( !$this->ixr ) $this->ixr = new IXR_Client( $this->ixr_url, false, 80, 30 );
</span><span class="lines">@@ -821,7 +824,7 @@
</span><span class="cx">                         <form action="admin.php?import=livejournal" method="post" id="ljapi-auto-repost">
</span><span class="cx">                         <?php wp_nonce_field( 'lj-api-import' ) ?>
</span><span class="cx">                         <input type="hidden" name="step" id="step" value="1" />
</span><del>-                        <p><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
</del><ins>+                        <p><input type="submit" class="button" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
</ins><span class="cx">                         </form>
</span><span class="cx">                         <?php $this->auto_ajax( 'ljapi-auto-repost', 'auto-message', 0 ); ?>
</span><span class="cx">                 <?php
</span><span class="lines">@@ -835,6 +838,8 @@
</span><span class="cx">
</span><span class="cx">         // Download comments to local XML
</span><span class="cx">         function step2() {
</span><ins>+                do_action( 'import_start' );
+
</ins><span class="cx">                 set_time_limit( 0 );
</span><span class="cx">                 update_option( 'ljapi_step', 2 );
</span><span class="cx">                 $this->username = get_option( 'ljapi_username' );
</span><span class="lines">@@ -871,7 +876,7 @@
</span><span class="cx">                         <p><strong><?php printf( __( 'Imported comment batch %d of <strong>approximately</strong> %d' ), get_option( 'ljapi_comment_batch' ), $batch ) ?></strong></p>
</span><span class="cx">                         <?php wp_nonce_field( 'lj-api-import' ) ?>
</span><span class="cx">                         <input type="hidden" name="step" id="step" value="2" />
</span><del>-                        <p><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
</del><ins>+                        <p><input type="submit" class="button" value="<?php esc_attr_e( 'Import the next batch' ) ?>" /> <span id="auto-message"></span></p>
</ins><span class="cx">                         </form>
</span><span class="cx">                         <?php $this->auto_ajax( 'ljapi-auto-repost', 'auto-message', 0 ); ?>
</span><span class="cx">                 <?php
</span><span class="lines">@@ -886,6 +891,9 @@
</span><span class="cx">         // Re-thread comments already in the DB
</span><span class="cx">         function step3() {
</span><span class="cx">                 global $wpdb;
</span><ins>+
+                do_action( 'import_start' );
+
</ins><span class="cx">                 set_time_limit( 0 );
</span><span class="cx">                 update_option( 'ljapi_step', 3 );
</span><span class="cx">
</span><span class="lines">@@ -947,7 +955,7 @@
</span><span class="cx">                 $str .= wp_nonce_field( 'lj-api-import', '_wpnonce', true, false );
</span><span class="cx">                 $str .= wp_referer_field( false );
</span><span class="cx">                 $str .= '<input type="hidden" name="step" id="step" value="' . esc_attr($next_step) . '" />';
</span><del>-                $str .= '<p><input type="submit" class="button-primary" value="' . esc_attr( $label ) . '" /> <span id="auto-message"></span></p>';
</del><ins>+                $str .= '<p><input type="submit" class="button" value="' . esc_attr( $label ) . '" /> <span id="auto-message"></span></p>';
</ins><span class="cx">                 $str .= '</form>';
</span><span class="cx">
</span><span class="cx">                 return $str;
</span><span class="lines">@@ -1000,6 +1008,7 @@
</span><span class="cx">                                                 str = '<?php _e( "Processing next batch." ) ?> <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="processing" align="top" />';
</span><span class="cx">                                                 jQuery( '#<?php echo $msg ?>' ).html( str );
</span><span class="cx">                                                 jQuery('#ljapi-status').load(ajaxurl, {'action':'lj-importer',
</span><ins>+                                                                                                                                'import':'livejournal',
</ins><span class="cx">                                                                                                                                 'step':jQuery('#step').val(),
</span><span class="cx">                                                                                                                                 '_wpnonce':'<?php echo wp_create_nonce( 'lj-api-import' ) ?>',
</span><span class="cx">                                                                                                                                 '_wp_http_referer':'<?php echo $_SERVER['REQUEST_URI'] ?>'});
</span><span class="lines">@@ -1042,6 +1051,8 @@
</span><span class="cx">                 $wpdb->update( $wpdb->comments,
</span><span class="cx">                                                 array( 'comment_karma' => 0, 'comment_agent' => 'WP LJ Importer', 'comment_type' => '' ),
</span><span class="cx">                                                 array( 'comment_type' => 'livejournal' ) );
</span><ins>+
+                do_action( 'import_end' );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function LJ_API_Import() {
</span></span></pre>
</div>
</div>
</body>
</html>