########################################################################################################## # LiveJournal AutoUpdate coded by LaughingLizard http://dinki.mine.nu/word/ # # Compatible with all versions of WordPress http://www.mindfulmusings.net/weblog/ # ########################################################################################################## Instructions for WordPress 1.2+: YOU **HAVE** TO DOWNLOAD THE NEW CLASS-XMLRPC.PHPS FILE FROM THE LINK BELOW IF YOU ARE USING WORDPRESS 1.2 MINGUS http://weblogtoolscollection.com/b2-img/class-xmlrpc.phps RENAME THE FILE TO CLASS-XMLRPC.PHP AND REPLACE THE ORIGINAL FOUND IN WP-INCLUDES FOLDER OF YOUR BLOG 1) If my-hacks.php does not exist, please create a new file called my-hacks.php inside your wordpress root directory. Add to the end of the file. Make sure my-hacks support is turned on in wp-admin. This setting is under options/Miscellaneous in your admin page. Copy the function below to my-hacks.php inside the tags. function ljautoupdate ($content='', $post_title='') { /*ljautoupdate*/ require_once ("wp-includes/class-xmlrpc.php"); $lj_userid = "your lj username"; //Your LiveJournal username, please replace within quotes $lj_passwd = "your lj password"; //Your LiveJournal password, please replace within quotes $lj_method = "LJ.XMLRPC.postevent"; $lineendings = "pc"; $content = stripslashes(stripslashes($content)); $content = convert_smilies($content); $content = convert_chars($content, 'html'); $event = $content; $subject = stripslashes (ereg_replace('[\\]+', '\\', $post_title)); $time_difference = get_settings("time_difference"); $year = date('Y', (time() + ($time_difference * 3600))); $month = date('m', (time() + ($time_difference * 3600))); $day = date('d', (time() + ($time_difference * 3600))); $hour = date('H', (time() + ($time_difference * 3600))); $minute = date('i', (time() + ($time_difference * 3600))); $client = new xmlrpc_client("/interface/xmlrpc", "www.livejournal.com", 80); $x_params_r = array( "username" => utf8_encode( $lj_userid ), "password" => utf8_encode( $lj_passwd ), "lineendings" => $lineendings, "event" => utf8_encode( $event ), "subject" => utf8_encode( $subject ), "year" => utf8_encode( $year ), "mon" => utf8_encode( $month ), "day" => utf8_encode( $day ), "hour" => utf8_encode( $hour ), "min" => utf8_encode( $minute )); $params = array( phpxmlrpc_encode( $x_params_r ) ); $msg = new xmlrpcmsg('LJ.XMLRPC.postevent', $params); $client->setDebug(0); $result = $client->send($msg); if ($result->faultCode() != 0) { print "Couldn't process request: " . $result->faultString(); return; } /*end ljautoupdate*/ } Now modify your livejournal username and password in the function and save the file. Then find post.php inside your wp-admin folder and find: case 'post': and then look for this line: $result = $wpdb->query($postquery); Paste the following code right after that line: if ($content && $post_status == 'publish') ljautoupdate($content, $post_title); #####################################################################################################################3 TO ADD A LITTLE CHECK BUTTON TO THE WP-ADMIN INTERFACE (this is optional if you want ot be able to turn this feature off): Find this line in your edit-form.php file (which is inside the wp-admin folder):