YAPB Admin form fix for WP2.5

March 15th, 2008  |  Published in Notebook  |  2 Comments

I’m still working on the to display the images in the post listing fields on the admin page, but this is to make it display correctly when adding a post.

The file you’ll need to replace the in is located at:

wp-content/yet-another-photoblog//edit_form_advanced_field_fileupload..

  1. <? if ($this->image): ?>
  2.         <!-- This fieldset gets rendered if we have an image attached to the post: Replace -->
  3.                 <div id="yapb_div_imageuploader" class="postbox">
  4.                         <h3><? _e('Photoblog', '') ?></h3>
  5.                         <div class="inside" style="height: 80px;">
  6.                                                         <img src="<? echo $this->image->getThumbnailHref(array('h=80','fltr[]=usm|30|3|3')) ?>" height="80" alt="" style="float:right; margin-right 10px;height:80px;padding:3px;border: 1px solid #CCCCCC">
  7.                                                         <input type="file" name="yapb_imageupload" size="30" tabindex="1" value="" id="imageupload" style="background-color:white;" /><br>
  8.                                                         <input type="checkbox" name="yapb_exifdate" id="checkbox_yapb_exifdate" value="1" <? if(get_option('yapb_check_post_date_from_exif')): ?>checked<? endif ?> />
  9.                                                         <label for="checkbox_yapb_exifdate"><? _e('Post date from image exif data if available', '') ?></label><br>
  10.                                                         <input type="checkbox" name="yapb_remove_image" value="1"> <span style="color:red;"><? _e('Remove image from post', '') ?></span><br>
  11.                         </div>
  12.                 </div>
  13.                
  14. <? else: ?>
  15.  
  16.         <!-- This fieldset gets rendered if we have no image attached to the post: Upload -->
  17.                 <div id="yapb_div_imageuploader" class="postbox">
  18.                         <h3><? _e('Photoblog', '') ?></h3>
  19.                         <div class="inside">
  20.                                 <input type="file" id="yapb_imageupload" name="yapb_imageupload" size="30" tabindex="1" value="" id="imageupload" style="background-color:white;" onChange="toggleCategory(true);" /><input class="button" type="button" value="<? _e('clear field', '') ?>" onClick="$('yapb_imageupload').value='';toggleCategory(false);" /><br />
  21.                                 <input type="checkbox" name="exifdate" id="checkbox_yapb_exifdate" value="1" <? if(get_option('yapb_check_post_date_from_exif')): ?>checked<? endif ?> />                 <label for="checkbox_yapb_exifdate"><? _e('Post date from image exif data if available', '') ?></label><br>
  22.                 </div>
  23.         </div>
  24. <? endif ?>

Download plaintext version

Responses

  1. Earl says:

    March 16th, 2008at 9:38 am(#)

    Thanks, testing it now.

  2. dalton says:

    March 18th, 2008at 8:10 am(#)

    Excellent! I am hoping to upgrade to 2.5 pretty soon after it comes out (barring any major bugs, of course) and YAPB was the one plugin holding me back!

Leave a Response