Changeset 1325810
- Timestamp:
- 01/11/2016 01:26:11 PM (10 years ago)
- Location:
- flickr-field-for-advanced-custom-fields/trunk
- Files:
-
- 2 edited
-
acf-flickr-v4.php (modified) (7 diffs)
-
acf-flickr-v5.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flickr-field-for-advanced-custom-fields/trunk/acf-flickr-v4.php
r1306209 r1325810 115 115 <td class="label"> 116 116 <label><?php _e('Flickr API Key','acf-flickr'); ?><span class="required">*</span></label> 117 <p class="description"><?php _e('Find or register your API key at <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a>', 'acf-flickr');?> </p>117 <p class="description"><?php _e('Find or register your API key at <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a>', 'acf-flickr');?>. Alternatively, you can set the constant <strong>FLICKR_FIELD_API_KEY</strong>.</p> 118 118 </td> 119 119 <td> … … 151 151 <td class="label"> 152 152 <label><?php _e('Flickr Secret Key','acf-flickr'); ?><span class="required">*</span></label> 153 <p class="description"><?php _e('Find or register your secret key at <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a>', 'acf-flickr');?> </p>153 <p class="description"><?php _e('Find or register your secret key at <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a>', 'acf-flickr');?>. Alternatively, you can set the constant <strong>FLICKR_FIELD_SECRET</strong>.</p> 154 154 </td> 155 155 <td> … … 369 369 $field['optgroup'] = isset($field['optgroup']) ? $field['optgroup'] : false; 370 370 371 // Check constants 372 if(defined('FLICKR_FIELD_API_KEY')) { 373 $field['flickr_api_key'] = FLICKR_FIELD_API_KEY; 374 } 375 if(defined('FLICKR_FIELD_SECRET')) { 376 $field['flickr_secret_key'] = FLICKR_FIELD_SECRET; 377 } 378 if(defined('FLICKR_FIELD_API_TOKEN')) { 379 $field['flickr_private_token'] = FLICKR_FIELD_API_TOKEN; 380 } 381 371 382 // Get all Flickr sets by the given user ID and api key (both required) 372 383 require_once(dirname(__FILE__) . '/phpflickr/phpFlickr.php'); … … 421 432 <tbody> 422 433 <?php 423 if (is_array($flickr_data) && !empty($flickr_data)) {434 if (is_array($flickr_data) && (!empty($flickr_data['photoset']) || !empty($flickr_data['galleries']['gallery']))) { 424 435 if ($field['flickr_content_type'] == 'sets') { 425 436 $data = $flickr_data['photoset']; … … 458 469 else { 459 470 ?><tr class="field_label"> 460 <td colspan="2"><?php _e('There are no Flickr sets available for user ID'); ?> <?php echo $field['flickr_user_id']; ?> <?php _e('or there is a problem with API KEY'); ?> <?php echo $field['api_key']; ?></td>471 <td colspan="2"><?php _e('There is no Flickr data available for user ID'); ?> <em><?php echo $field['flickr_user_id']; ?></em> <?php _e('or there is a problem with api key'); ?> <em><?php echo $field['flickr_api_key']; ?></em></td> 461 472 </tr><?php 462 473 } … … 503 514 </ul> 504 515 <?php else: ?> 505 <p><?php _e('There are no Flickr sets available for user ID'); ?> <?php echo $field['flickr_user_id']; ?> <?php _e('or there is a problem with API KEY'); ?> <?php echo $field['api_key']; ?></p>516 <p><?php _e('There is no Flickr data available for user ID'); ?> <?php echo $field['flickr_user_id']; ?> <?php _e('or there is a problem with api key'); ?> <?php echo $field['api_key']; ?></p> 506 517 <?php 507 518 endif; … … 696 707 require_once(dirname(__FILE__) . '/phpflickr/phpFlickr.php'); 697 708 709 // Check constants 710 if(defined('FLICKR_FIELD_API_KEY')) { 711 $value['api_key'] = FLICKR_FIELD_API_KEY; 712 } 713 if(defined('FLICKR_FIELD_SECRET')) { 714 $value['secret_key'] = FLICKR_FIELD_SECRET; 715 } 716 if(defined('FLICKR_FIELD_API_TOKEN')) { 717 $value['private_token'] = FLICKR_FIELD_API_TOKEN; 718 } 719 698 720 if($value['private_mode']) { 699 721 // Private Mode -
flickr-field-for-advanced-custom-fields/trunk/acf-flickr-v5.php
r1306209 r1325810 92 92 'required' => true, 93 93 'label' => __('Flickr API Key','acf-flickr'), 94 'instructions' => __('Find or register your API key at','acf-flickr') . ' <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a> ',94 'instructions' => __('Find or register your API key at','acf-flickr') . ' <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a>. Alternatively, you can set the constant <strong>FLICKR_FIELD_API_KEY</strong>.', 95 95 'type' => 'text', 96 96 'name' => 'flickr_api_key', … … 112 112 acf_render_field_setting( $field, array( 113 113 'label' => __('Flickr Secret Key','acf-flickr'), 114 'instructions' => __('Find or register your Secret key at','acf-flickr') . ' <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a> ',114 'instructions' => __('Find or register your Secret key at','acf-flickr') . ' <a href="http://www.flickr.com/services/apps/" target="_blank">http://www.flickr.com/services/apps</a>. Alternatively, you can set the constant <strong>FLICKR_FIELD_SECRET</strong>.', 115 115 'type' => 'text', 116 116 'name' => 'flickr_secret_key', … … 254 254 // Get all Flickr sets by the given user ID and api key (both required) 255 255 require_once(dirname(__FILE__) . '/phpflickr/phpFlickr.php'); 256 257 // Check constants 258 if(defined('FLICKR_FIELD_API_KEY')) { 259 $field['flickr_api_key'] = FLICKR_FIELD_API_KEY; 260 } 261 if(defined('FLICKR_FIELD_SECRET')) { 262 $field['flickr_secret_key'] = FLICKR_FIELD_SECRET; 263 } 264 if(defined('FLICKR_FIELD_API_TOKEN')) { 265 $field['flickr_private_token'] = FLICKR_FIELD_API_TOKEN; 266 } 256 267 257 268 if(isset($field['flickr_private_mode']) && $field['flickr_private_mode'] == true) { … … 341 352 else { 342 353 ?><tr class="field_label"> 343 <td colspan="2"><?php _e('There are no Flickr sets available for user ID'); ?> <?php echo $field['flickr_user_id']; ?> <?php _e('or there is a problem with API KEY'); ?> <?php echo $field['api_key']; ?></td>354 <td colspan="2"><?php _e('There is no Flickr data available for user ID'); ?> <em><?php echo $field['flickr_user_id']; ?></em> <?php _e('or there is a problem with api key'); ?> <em><?php echo $field['flickr_api_key']; ?></em></td> 344 355 </tr><?php 345 356 } … … 383 394 </ul> 384 395 <?php else: ?> 385 <p><?php _e('There are no Flickr sets available for user ID'); ?> <?php echo $field['flickr_user_id']; ?> <?php _e('or there is a problem with API KEY'); ?> <?php echo $field['api_key']; ?></p>396 <p><?php _e('There is no Flickr data available for user ID'); ?> <?php echo $field['flickr_user_id']; ?> <?php _e('or there is a problem with api key'); ?> <?php echo $field['flickr_api_key']; ?></p> 386 397 <?php 387 398 endif; … … 664 675 require_once(dirname(__FILE__) . '/phpflickr/phpFlickr.php'); 665 676 677 // Check constants 678 if(defined('FLICKR_FIELD_API_KEY')) { 679 $value['api_key'] = FLICKR_FIELD_API_KEY; 680 } 681 if(defined('FLICKR_FIELD_SECRET')) { 682 $value['secret_key'] = FLICKR_FIELD_SECRET; 683 } 684 if(defined('FLICKR_FIELD_API_TOKEN')) { 685 $value['private_token'] = FLICKR_FIELD_API_TOKEN; 686 } 687 666 688 if($value['private_mode']) { 667 689 // Private Mode
Note: See TracChangeset
for help on using the changeset viewer.