/* THIS IS NOT A COMPLETE PLUG-IN. This is just a snippet of code that you need to paste into your version of LiveJournal Crossposter, which is available at: http://code.google.com/p/ljxp/ You also need Cricket Moods and Post Avatar: http://dev.wp-plugins.org/wiki/CricketMoods http://www.garinungkadol.com/downloads/post-avatar/ This works for WordPress 2.3.3. No guarantees for any other version. This has an obvious bug: it doesn't crosspost moods and avatars unless you've already saved a version of your post. The easiest way to do this is to click "Save and Continue Editing," then click "Publish." To use this code, open LiveJournal Crossposter and find the lines that say: if($header_loc) { $the_event .= $postHeader; } else { $the_event = $postHeader.$the_event; } Found them? Okay, now just copy and paste the uncommented code (below) directly before the code you just found. Written by Laura (http://rusty-halo.com). If this helps you or if you figure out how to improve it, please leave me a comment at: http://rusty-halo.com/wordpress/?p=2558 */ /* start cricket moods hack */ // Get the moods for the current post. $post_moods = get_post_meta($post->ID, 'mood'); $separator = ' & '; $before = '
Current Mood: '; $after = '
'; if( !empty($post_moods) ) { $count = count($post_moods) - 1; // Get a list of the available moods. $mood_list = cm_process_moods( get_the_author_ID() ); $output = ''; foreach( $post_moods as $i => $mood_id ) { if( $i == 0 ) { $output .= $before; } // Failsafe in case that mood ID doesn't actually exist. if( !empty($mood_list[$mood_id]) ) { $mood_name = wptexturize($mood_list[$mood_id]['mood_name']); // Only print the img tag if the mood has an associated image. if( !empty( $mood_list[$mood_id]['mood_image'] ) ) { /* if your wordpress installation is not in the root directory, you need to remove the subdirectories here in the str_replace part (replace 'wordpress' with 'whatever your subdirectory is') */ $set_site_url = get_option('siteurl'); $base_site_url = str_replace('wordpress','',$set_site_url); $output .= ''. $mood_name .' '. __('emoticon', 'cricket-moods') .' '; } $output .= $mood_name; if( $i != $count ) { $output .= $separator; } } // Determine if this is the last mood. if( $i == $count ) { $output .= $after; } } } $the_event = $the_event . $output; /* end cricket moods hack */ /* start post avatar hack */ $class = get_option('gklpa_class'); $before = gkl_unescape_html(stripslashes(get_option('gklpa_before'))); $after = gkl_unescape_html(stripslashes(get_option('gklpa_after'))); $getsize = get_option('gklpa_getsize'); global $gkl_AvatarURL, $gkl_myAvatarDir; $post_id = $post->ID; $CurrAvatar = get_post_meta($post->ID,'postuserpic'); $CheckAvatar = $gkl_myAvatarDir . $CurrAvatar[0]; // Display nothing if value is empty or file does not exist if ( !empty($CurrAvatar) && file_exists($CheckAvatar) ) { // Show post avatar $CurrAvatarLoc = $gkl_AvatarURL . $CurrAvatar[0]; if ( $CurrAvatarLoc != $gkl_AvatarURL ) { $CurrAvatarLoc = str_replace('/', DIRECTORY_SEPARATOR, $gkl_myAvatarDir . ltrim($CurrAvatar[0],'/')); if($getsize) { $dim = @getimagesize($CheckAvatar); $style = 'style="width:' . $dim[0] .'px;height:'. $dim[1] .'px; float: left; margin: 0 6px 3px 0;"'; } else { $style = 'style="border:none;"'; } $CurrAvatarLoc = $gkl_AvatarURL . ltrim($CurrAvatar[0],'/'); $class = $class ? ' class="'.$class.'"' : ''; $before = $before ? $before : ''; $after = $after ? $after : ''; $this_avatar_display = $before .''. $after ."\n"; } } $the_event = $this_avatar_display.$the_event; /* end post avatar hack */