5 Jan 2009 Upgraded to Wordpress 2.7
This website have been upgrade to latest wordpress release in 2009. So there is a good start very everything new. The user experience this still same as the theme in wordpress 2.6 is still working in wordpress 2.7. The nextgen gallery have been update to ver 1.02 also. The highslide is working well with the new nextgen gallery and no modification is needed. The photo2post need some modification as the new nextgen have some changes in coding . The manage.php and mange-images.php need to have some modification. In manage.php, the following code is added right before the “case ‘import_meta’” line for the photo2post functionality:
case ‘photo2post’:
// refer to begining of file for reference of $post
$post_status = ‘open’;
$post_author = 1;
$post_category = array(9); //check and adjust for the post category ID for post created
$post_content = ”;
$post_status = ‘publish’;
$post_title = ”;
$post_type = ‘post’;
$tags_input = array(’x1′,’x2′);
$time_difference = get_option(’gmt_offset’) * 3600;
if ( is_array($_POST['doaction']) ) {
$post_count = 1;
foreach ( $_POST['doaction'] as $imageID ) {
$post_title = $wpdb->get_var(”SELECT alttext FROM $wpdb->nggpictures WHERE pid = ‘$imageID’ “);
$post_content = $wpdb->get_var(”SELECT description FROM $wpdb->nggpictures WHERE pid = ‘$imageID’ “);
$tags_input = wp_get_object_terms($imageID, ‘ngg_tag’, ‘fields=names’);
if ( is_array($tags_input) ) $tags_input = implode(’, ‘, $tags_input);
$post_content .= ‘<p>[SinglePic not found]</p><a class=”highslide” href=”http://ghorse.org/wordpress/wp-content/plugins/nextgen-gallery/admin/showmeta.php?id=’.$imageID.’” onclick=”return hs.htmlExpand(this, {objectType: \’iframe\’, wrapperClassName: \’exif\’} )” >Click here to view EXIF data.’;
// copied from wp-mail.php/
$ddate_U = time(); //get current unit time stamp add by KF
$ddate_U = $ddate_U + ($post_count*12*3600); //set post 12 hours apart starting 12 hours from now
$post_count = $post_count+1;
$post_date = gmdate(’Y-m-d H:i:s’, $ddate_U + $time_difference);
$post_date_gmt = gmdate(’Y-m-d H:i:s’, $ddate_U);
// copied from wp-mail.php/
$p2post = compact(’post_content’,'post_title’,'post_date’,'post_date_gmt’,'post_author’,'post_category’,'post_status’,'post_type’,'tags_input’);
$post_ID = wp_insert_post($p2post);
if ( is_wp_error( $post_ID ) ) echo “\n” . $post_ID->get_error_message();
}
nggGallery::show_message(__(’Photo to Post Finished ‘,”nggallery”));
}
break;
case ‘import_meta’:
// Import Metadata
The new version of nextgen gallery have merged its tag handling with the wordpress tags database, so the method of retrieving tags related to an image is changed as indicated in the red lines of codes above. Other than that, the photo2post code remains the same.
In manage-images.php, the following line of code is added to triggering the photo2post function right after the “move_to” action line:
<option value=”copy_to” ><?php _e(”Copy to…”,’nggallery’)?></option>
<option value=”move_to”><?php _e(”Move to…”,’nggallery’)?></option>
<option value=”photo2post”><?php _e(”Photo2Post”,’nggallery’)?></option>
The ablum display is still not working with language switcher plugin and the modifcation in the following post is still needed:
http://ghorse.org/wordpress/2008/10/fix-the-nextgen-gallery-album-display-with-language-switcher/

Hey, this is a great great idea.. I am not using the translation stuff as much as i love the idea of being able to photo2post! I have one issue and that is when i try and manage galleries it gives me this:
Parse error: syntax error, unexpected T_STRING in /home/content/c/h/e/chemmyone/html/craigryder/wp-content/plugins/nextgen-gallery/admin/manage.php on line 175
I am not that good with PHP yet so i’ve tried to add all the other fixes and ideas that you have mentioned in this post in case that was the problem.. I am not sure what else to do…
If you have any idea please let me know either here as i will subscribe to the comments or at my email in the form, if you have the time that is. Thanks so much.
Craig
Comment by Craig Ryder — 20 Jan 2009 @ 6:26 AM
Actually those errors have cleared up.. i guess when i pasted your code unformatted into Screem it messed with the ‘ and ” ’s .. go figure.. i’m still not quite sure that it is working properly but i will now go over what you have posted much more carefully. Again, thanks for this great addition to the nextgen gallery and WP..:)
Comment by Craig Ryder — 20 Jan 2009 @ 7:13 AM