Skip to content

Commit

Permalink
code in place for sizing options
Browse files Browse the repository at this point in the history
  • Loading branch information
randyjensen committed Dec 2, 2011
1 parent b5414b6 commit aef442b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions openphoto-wordpress.php
Expand Up @@ -76,11 +76,12 @@ function media_render_openphoto_tab() {
caption_text.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;'); caption_text.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
url_text = parent_el.find('.url-text').val(); url_text = parent_el.find('.url-text').val();
alignment = parent_el.find('.alignment-area input[type="radio"]]:checked').val(); alignment = parent_el.find('.alignment-area input[type="radio"]]:checked').val();
size = parent_el.find('.size-area input[type="radio"]]:checked').val(); size_height = parent_el.find('.size-area input[type="radio"]]:checked').attr('data-image-height');
size_width = parent_el.find('.size-area input[type="radio"]]:checked').attr('data-image-width');
size_alt = parent_el.find('.size-area input[type="radio"]]:checked').attr('alt'); size_alt = parent_el.find('.size-area input[type="radio"]]:checked').attr('alt');
size_class = 'size-' + size; size_class = 'size-' + size;
height = 100; height = size_height;
width = 150; width = size_width;
op_single = parent_el.find('#op-single').attr('name'); op_single = parent_el.find('#op-single').attr('name');
img = ''; img = '';


Expand Down Expand Up @@ -154,7 +155,7 @@ function media_render_openphoto_tab() {
echo '<a class="page-numbers" href="?post_id=' . $post_id . '&amp;type=image&amp;tab=openphoto&amp;m=' . $m . '&amp;pg='. $i . '">'. $i . '</a> '; echo '<a class="page-numbers" href="?post_id=' . $post_id . '&amp;type=image&amp;tab=openphoto&amp;m=' . $m . '&amp;pg='. $i . '">'. $i . '</a> ';
} }
} }


if ($current_page < $total_pages) { if ($current_page < $total_pages) {
echo '<a class="next page-numbers" href="?post_id='. $post_id . '&amp;type=image&amp;tab=openphoto&amp;m=' . $m . '&amp;pg='. ($current_page+1) . '">&raquo;</a> '; echo '<a class="next page-numbers" href="?post_id='. $post_id . '&amp;type=image&amp;tab=openphoto&amp;m=' . $m . '&amp;pg='. ($current_page+1) . '">&raquo;</a> ';
} }
Expand Down Expand Up @@ -281,14 +282,14 @@ function media_render_openphoto_tab() {
echo '<td class="field size-area">'; echo '<td class="field size-area">';
$thumbnail_width = 150; $thumbnail_width = 150;
$thumbnail_height = 150; $thumbnail_height = 150;
echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-thumbnail-'.$unique_id.'" value="thumbnail" alt="'.$photo->{"path".$sizes['thumbnail']} . '" checked="checked"><label for="image-size-thumbnail-'.$unique_id.'">Thumbnail</label> <label for="image-size-thumbnail-'.$unique_id.'" class="help">(' . $thumbnail_width. '&nbsp;×&nbsp;' . $thumbnail_height . ')</label></div>'; echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-thumbnail-'.$unique_id.'" value="thumbnail" alt="'.$photo->{"path".$sizes['thumbnail']} . '" data-image-height="'.$thumbnail_height.'" data-image-width="'.$thumbnail_width.'" checked="checked"><label for="image-size-thumbnail-'.$unique_id.'">Thumbnail</label> <label for="image-size-thumbnail-'.$unique_id.'" class="help">(' . $thumbnail_width. '&nbsp;×&nbsp;' . $thumbnail_height . ')</label></div>';
$medium_width = 300; $medium_width = 300;
$medium_height = 187; $medium_height = 187;
echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-medium-'.$unique_id.'" value="medium" alt="'.$photo->{"path".$sizes['medium']}.'"><label for="image-size-medium-'.$unique_id.'">Medium</label> <label for="image-size-medium-'.$unique_id.'" class="help">(' . $medium_width . '&nbsp;×&nbsp;' . $medium_height . ')</label></div>'; echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-medium-'.$unique_id.'" value="medium" alt="'.$photo->{"path".$sizes['medium']}.'" data-image-height="'.$medium_height.'" data-image-width="'.$medium_width.'"><label for="image-size-medium-'.$unique_id.'">Medium</label> <label for="image-size-medium-'.$unique_id.'" class="help">(' . $medium_width . '&nbsp;×&nbsp;' . $medium_height . ')</label></div>';
$large_width = 600; $large_width = 600;
$large_height = 400; $large_height = 400;
echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-large-'.$unique_id.'" value="large" alt="'.$photo->{"path".$sizes['large']}.'"><label for="image-size-large-'.$unique_id.'">Large</label> <label for="image-size-large-'.$unique_id.'" class="help">('. $large_width . '&nbsp;×&nbsp;'. $large_height . ')</label></div>'; echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-large-'.$unique_id.'" value="large" alt="'.$photo->{"path".$sizes['large']}.'" data-image-height="'.$large_height.'" data-image-width="'.$large_width.'"><label for="image-size-large-'.$unique_id.'">Large</label> <label for="image-size-large-'.$unique_id.'" class="help">('. $large_width . '&nbsp;×&nbsp;'. $large_height . ')</label></div>';
echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-full-'.$unique_id.'" value="full" alt="'.$photo->pathOriginal.'"><label for="image-size-full-'.$unique_id.'">Full Size</label> <label for="image-size-full-'.$unique_id.'" class="help">('.$photo->height.'&nbsp;×&nbsp;'.$photo->width.')</label></div>'; echo '<div class="image-size-item"><input type="radio" name="attachments['.$unique_id.'][image-size]" id="image-size-full-'.$unique_id.'" value="full" alt="'.$photo->pathOriginal.'" data-image-height="'.$photo->height.'" data-image-width="'.$photo->width.'"><label for="image-size-full-'.$unique_id.'">Full Size</label> <label for="image-size-full-'.$unique_id.'" class="help">('.$photo->height.'&nbsp;×&nbsp;'.$photo->width.')</label></div>';
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
echo '<tr class="submit">'; echo '<tr class="submit">';
Expand Down Expand Up @@ -497,4 +498,4 @@ function settings_validate_submission( $input ) {
} }


new WP_OpenPhoto; new WP_OpenPhoto;
require_once('openphoto-php/OpenPhotoOAuth.php'); require_once('openphoto-php/OpenPhotoOAuth.php');

0 comments on commit aef442b

Please sign in to comment.