Changeset 172726
- Timestamp:
- 11/12/2009 07:42:44 PM (16 years ago)
- Location:
- wp2flickr/trunk
- Files:
-
- 5 edited
-
functions.php (modified) (1 diff)
-
getToken.php (modified) (1 diff)
-
phpFlickr/phpFlickr.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
wp2flickr.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp2flickr/trunk/functions.php
r171980 r172726 17 17 18 18 function w2f_setToken(){ 19 delete_option('w2f_token'); 20 delete_option('w2f_user'); 21 add_option('w2f_token',$_GET['token']); 22 add_option('w2f_user',$_GET['user']); 23 echo 'Token updated<br /><br />'; 19 if (!empty($_GET['token'])) { 20 delete_option('w2f_token'); 21 delete_option('w2f_user'); 22 add_option('w2f_token',$_GET['token']); 23 add_option('w2f_user',$_GET['user']); 24 echo 'Token updated<br /><br />'; 25 } else { 26 echo 'Error updating token'; 27 } 24 28 } 25 29 26 30 function w2f_testUpload(){ 27 $flickr= new phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);31 $flickr= new w2f_phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false); 28 32 $flickr->setToken(get_option('w2f_token')); 29 33 $flickr_id=$flickr->sync_upload(dirname(__FILE__)."/DSC_1518.jpg", "test", "Hello, goodbye", "tags", 0,0,0 ); -
wp2flickr/trunk/getToken.php
r171980 r172726 4 4 require_once("config.php"); 5 5 6 $f=new phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);6 $f=new w2f_phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false); 7 7 $callbak2wp=$_SESSION['setTokenLink']; 8 8 $f->auth("write",$callbak2wp); -
wp2flickr/trunk/phpFlickr/phpFlickr.php
r171980 r172726 42 42 // ini_set('include_path', dirname(__FILE__) . '/PEAR' . $path_delimiter . ini_get('include_path')); 43 43 44 class phpFlickr {44 class w2f_phpFlickr { 45 45 var $api_key; 46 46 var $secret; … … 74 74 var $max_cache_rows = 1000; 75 75 76 function phpFlickr ($api_key, $secret = NULL, $die_on_error = false)76 function w2f_phpFlickr ($api_key, $secret = NULL, $die_on_error = false) 77 77 { 78 78 //The API Key must be set before any calls can be made. You can -
wp2flickr/trunk/readme.txt
r171980 r172726 3 3 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZCCHQ2ZHUGHDG&lc=US&item_name=wp2flickr%20plugin%20donation&item_number=wp2flickr¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted 4 4 Tags: yapb, photoblog, photo blog, photo blogging, images, yet another photoblog, flickr, flickr upload 5 Requires at least: 2. 55 Requires at least: 2.8.4 6 6 Tested up to: 2.8.5 7 Stable tag: 0.9 7 Stable tag: 0.9.1 8 8 9 9 Uploads photos from WordPress posts to Flickr. … … 20 20 == Installation == 21 21 Download and activate. 22 Go to Settings->wp2flickr menu and follow the steps 22 Go to Settings->wp2flickr menu and follow the steps. 23 23 24 24 == Frequently Asked Questions == … … 31 31 == Changelog == 32 32 33 = 0.9.1 = 34 * Add manual token option for problems with callback to flickr 35 * Rename phpFlickr class to avoid collitions with other plugins 36 * if token is not set exit publish hook 37 33 38 = 0.9 = 34 39 * Initial public released version -
wp2flickr/trunk/wp2flickr.php
r171980 r172726 3 3 Plugin Name: wp2flickr 4 4 Plugin URI: http://wp2flickr.com/ 5 Description: upload YAPB photos to flickr6 Version: 0.9 5 Description: upload photos from posts to flickr (standard media or YAPB) 6 Version: 0.9.1 7 7 Author: Fran Simó 8 8 Author URI: http://fransimo.info/ … … 34 34 function w2f_publish($post_id){ 35 35 if(w2f_check_record($post_id)) { return $post_id; } //publish hook is called whereever is a new public or a save of alredey published 36 36 if(''==get_option('w2f_token')) { return $post_id; } //if token is not set exit 37 37 38 38 $post=get_post($post_id); … … 86 86 87 87 if (!$imageFilePath=='') { 88 $flickr= new phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);88 $flickr= new w2f_phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false); 89 89 $flickr->setToken(get_option('w2f_token')); 90 90 if (get_option('w2f_flickr_URL')) { … … 229 229 echo "<form action=".wp_specialchars( $_SERVER['REQUEST_URI'] )." method=\"post\">"; 230 230 echo '<table>'; 231 echo '<tr><td>'; 232 231 echo '<tr valign="top"><td>'; 232 233 echo "Token"; 234 echo '</td><td>'; 235 $v=get_option('w2f_token'); 236 echo '<input type="text" name="form_w2f_token" size=50 value="'.$v.'"/><br />'; 237 echo 'This value should be set automatically in step 1 (flickr authorization) '; 238 echo '</td></tr><tr valign="top"><td>'; 239 233 240 echo "Is public? "; 234 241 echo '</td><td>'; … … 287 294 288 295 function w2f_updateOptions() { 296 update_option( 'w2f_token', stripslashes( $_REQUEST['form_w2f_token'] ) ); 289 297 $v=($_REQUEST['form_w2f_flickr_is_public']=='on') ? 1 : 0; 290 298 update_option( 'w2f_flickr_is_public', $v );
Note: See TracChangeset
for help on using the changeset viewer.