Tweaks
This commit is contained in:
parent
0aab2adde1
commit
e806c268e9
1 changed files with 12 additions and 14 deletions
|
@ -38,7 +38,6 @@ class WP_OpenPhoto {
|
|||
|
||||
$openphoto = get_option('openphoto_wordpress_settings');
|
||||
$client = new OpenPhotoOAuth(str_replace('http://','',$openphoto['host']),$openphoto["oauth_consumer_key"],$openphoto["oauth_consumer_secret"],$openphoto["oauth_token"],$openphoto["oauth_token_secret"]);
|
||||
$client = new OpenPhotoOAuth(str_replace('http://','',$openphoto['host']));
|
||||
|
||||
// get photos
|
||||
$sizes['thumbnail']['w'] = get_option('thumbnail_size_w');
|
||||
|
@ -77,11 +76,12 @@ class WP_OpenPhoto {
|
|||
caption_text.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
||||
url_text = parent_el.find('.url-text').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_class = 'size-' + size;
|
||||
height = 100;
|
||||
width = 150;
|
||||
height = size_height;
|
||||
width = size_width;
|
||||
op_single = parent_el.find('#op-single').attr('name');
|
||||
img = '';
|
||||
|
||||
|
@ -139,7 +139,7 @@ class WP_OpenPhoto {
|
|||
<div class="tablenav">
|
||||
<?php
|
||||
|
||||
if ( $photos ) { print_r($photos); die();
|
||||
if ( $photos ) {
|
||||
if ($total_pages > 1) {
|
||||
echo '<div class="tablenav-pages">';
|
||||
|
||||
|
@ -155,7 +155,7 @@ class WP_OpenPhoto {
|
|||
echo '<a class="page-numbers" href="?post_id=' . $post_id . '&type=image&tab=openphoto&m=' . $m . '&pg='. $i . '">'. $i . '</a> ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($current_page < $total_pages) {
|
||||
echo '<a class="next page-numbers" href="?post_id='. $post_id . '&type=image&tab=openphoto&m=' . $m . '&pg='. ($current_page+1) . '">»</a> ';
|
||||
}
|
||||
|
@ -173,9 +173,7 @@ class WP_OpenPhoto {
|
|||
$tag->id = trim($tag->id);
|
||||
$selected = "";
|
||||
if ( $tag->id==$m ) $selected = ' selected="selected"';
|
||||
echo '<option value="'.$tag->id .'"' . $selected . '>' . $tag->id;
|
||||
if ( (int) $tag->count > 1) echo '(' . $tag->count . ')';
|
||||
echo '</option>';
|
||||
if ($tag->count > 0) echo '<option value="'.$tag->id .'"' . $selected . '>' . $tag->id . ' (' . $tag->count . ')</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
@ -284,14 +282,14 @@ class WP_OpenPhoto {
|
|||
echo '<td class="field size-area">';
|
||||
$thumbnail_width = 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. ' × ' . $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. ' × ' . $thumbnail_height . ')</label></div>';
|
||||
$medium_width = 300;
|
||||
$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 . ' × ' . $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 . ' × ' . $medium_height . ')</label></div>';
|
||||
$large_width = 600;
|
||||
$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 . ' × '. $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.' × '.$photo->width.')</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 . ' × '. $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.'" 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.' × '.$photo->width.')</label></div>';
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '<tr class="submit">';
|
||||
|
@ -500,4 +498,4 @@ class WP_OpenPhoto_Settings {
|
|||
}
|
||||
|
||||
new WP_OpenPhoto;
|
||||
require_once('openphoto-php/OpenPhotoOAuth.php');
|
||||
require_once('openphoto-php/OpenPhotoOAuth.php');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue