$arrRspObjGetPhotoCount = getResponseObject( $arrParamsGetPhotoCount ); if ( $arrRspObjGetPhotoCount['stat'] == 'fail' ) { // invalid user ID if ( $arrRspObjGetPhotoCount['code'] == '1' ) { $bolIsAnId = false; } // invalid API Key if ( $arrRspObjGetPhotoCount['code'] == '100' ) { $bolIsAnApiKey = false; } } if ( ( true == $bolIsAnId ) && ( true == $bolIsAnApiKey ) ) { // Save the posted values in the database update_option( FLICKR_API_KEY, $strApiKeyValue ); update_option( FLICKR_USER_ID, $strUserIdValue ); update_option( FLICKR_DISPLAY_NUM, $intNumberOfPhotosValue ); update_option( FLICKR_RANDOMISE, $intRandomise ); update_option( FLICKR_SIZE_CHOICE, $strSizeChoice ); update_option( FLICKR_XSS_ACTIVATED, $intXSSActivated ); echo '

Options saved.

'; } else { echo '

WARNING: Please fix the highlighted issue(s).

'; } // end: check user inputted data is correct } // start: if hidden value has been set update photo data from the main Flickr account if ( isset( $_POST['hidden'] ) ) { $bolScriptHasRun = flickrScriptMain(); if ( true == $bolScriptHasRun ) { echo '

Photos Updated.

'; } else { echo '

WARNING: Photos have NOT been Updated.

'; } } // end: if hidden value has been set update photo data from the main Flickr account } // start: call the function to display the data on the admin pannel displayAdminOptionsPage( $bolIsAnApiKey, $strApiKeyValue, $bolIsAnId, $strUserIdValue, $intNumberOfPhotosValue, $bolIsAFolder, $intRandomise, $strSizeChoice, $intXSSActivated ); // end: call the function to display the data on the admin pannel } function displayAdminOptionsPage( $bolIsAnApiKey, $strApiKeyValue, $bolIsAnId, $strUserIdValue, $intNumberOfPhotosValue, $bolIsAFolder, $intRandomise, $strSizeChoice, $intXSSActivated ) { // start: display options on page echo '

Flickr Control

'; if ( true == $bolIsAnApiKey ) { echo ' '; } else { echo '
Flickr API Key: This API Key does not exist! Your options have not been updated.

Check Your API Key

Apply For An API Key

'; } if ( true == $bolIsAnId ) { echo '
Flickr User NSID:

The NSID can be found in the address/url bar of your web browser when you are on the "Your Photos" page in your Flickr account.
It\'s the code that appears just after http://www.flickr.com/photos/

'; } else { echo '
Flickr User NSID: This ID does not exist! Your options have not been updated.

The NSID can be found in the address/url bar of your web browser when you are on the "Your Photos" page in your Flickr account.
It\'s the code that appears just after http://www.flickr.com/photos/

'; } echo '
Number Of Photos To Display: (Max: 500)

Please note: if you choose to display more photos than you have publically made available,
the number of photos actually displayed will be capped at the total number publically available, up to a maximum of 500.

'; echo '

Photo Size & Randomise Settings

Please select the size you would like the photos to arrive as from your Flickr account. You can be more specific to the size of your images by altering the CSS file used by this plugin. Please select the size closest to what you intend to set the size to in the CSS file. This will lower the chances of reduced quality displayed images.

Please Note: if you change the size in this list you will need to update the options AND update your photos also for it to take effect.

'; $arrData = array( 'Square' => '(Default) Square (75px x 75px)', 'Thumbnail' => 'Thumbnail (variable x variable)', 'Small' => 'Small (variable x variable)', 'Medium' => 'Medium (variable x variable)', 'Original' => 'Original (actual width x actual height)' ); foreach ($arrData as $strName => $strDescription) { $strChecked = ''; if ($strName === $strSizeChoice) { $strChecked = ' checked="checked"'; } printf ('%s
', FLICKR_SIZE_CHOICE, $strName, $strChecked, $strDescription); } echo '
'; echo '

Here you can enable a random selection of photos to be taken from your Flickr account. If you choose not to randomise the selection, the latest images from your account will be used.


Randomise Photos:

XSS Security Control

If Flickr change their URL content and/or structure you may see this error on your site "One or more photos have been disabled for XSS security reasons". If this happens then please de-activate the XSS security function by unticking the checkbox below, the issue should then be fixed in the next release of the plugin.

Warning: Do NOT disable this function unless you experience this error message.


Activate XSS Security:

'; echo '



Update Photo Collection

To populate the cache file with your current public Flickr photo collection, click on the Update Photos button.

Please note: you will need to perform this task to reflect any changes made in your Flickr account.


This process may take a few minutes to run,
especially if you have a large number of photos.

'; // end: display options on page } // end: setup the options page in wordpress admin ?>