Plugin Directory

Changeset 172726


Ignore:
Timestamp:
11/12/2009 07:42:44 PM (16 years ago)
Author:
fsimo
Message:

0.9.1

Location:
wp2flickr/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp2flickr/trunk/functions.php

    r171980 r172726  
    1717
    1818    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        }
    2428    }
    2529   
    2630    function w2f_testUpload(){
    27         $flickr= new phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);
     31        $flickr= new w2f_phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);
    2832        $flickr->setToken(get_option('w2f_token'));
    2933        $flickr_id=$flickr->sync_upload(dirname(__FILE__)."/DSC_1518.jpg", "test", "Hello, goodbye", "tags", 0,0,0 );
  • wp2flickr/trunk/getToken.php

    r171980 r172726  
    44    require_once("config.php");
    55
    6     $f=new phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);
     6    $f=new w2f_phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);
    77    $callbak2wp=$_SESSION['setTokenLink'];
    88    $f->auth("write",$callbak2wp);
  • wp2flickr/trunk/phpFlickr/phpFlickr.php

    r171980 r172726  
    4242// ini_set('include_path', dirname(__FILE__) . '/PEAR' . $path_delimiter . ini_get('include_path'));
    4343
    44 class phpFlickr {
     44class w2f_phpFlickr {
    4545    var $api_key;
    4646    var $secret;
     
    7474    var $max_cache_rows = 1000;
    7575
    76     function phpFlickr ($api_key, $secret = NULL, $die_on_error = false)
     76    function w2f_phpFlickr ($api_key, $secret = NULL, $die_on_error = false)
    7777    {
    7878        //The API Key must be set before any calls can be made.  You can
  • wp2flickr/trunk/readme.txt

    r171980 r172726  
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ZCCHQ2ZHUGHDG&lc=US&item_name=wp2flickr%20plugin%20donation&item_number=wp2flickr&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
    44Tags: yapb,  photoblog, photo blog, photo blogging, images, yet another photoblog, flickr, flickr upload
    5 Requires at least: 2.5
     5Requires at least: 2.8.4
    66Tested up to: 2.8.5
    7 Stable tag: 0.9
     7Stable tag: 0.9.1
    88
    99Uploads photos from WordPress posts to Flickr.
     
    2020== Installation ==
    2121Download and activate.
    22 Go to Settings->wp2flickr menu and follow the steps 
     22Go to Settings->wp2flickr menu and follow the steps.
    2323
    2424== Frequently Asked Questions ==
     
    3131== Changelog ==
    3232
     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
    3338= 0.9 =
    3439* Initial public released version
  • wp2flickr/trunk/wp2flickr.php

    r171980 r172726  
    33    Plugin Name: wp2flickr
    44    Plugin URI: http://wp2flickr.com/
    5     Description: upload YAPB photos to flickr
    6     Version: 0.9
     5    Description: upload photos from posts to flickr (standard media or YAPB)
     6    Version: 0.9.1
    77    Author: Fran Sim&oacute;
    88    Author URI: http://fransimo.info/
     
    3434function w2f_publish($post_id){
    3535    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
    3737
    3838    $post=get_post($post_id);
     
    8686       
    8787        if (!$imageFilePath=='') {
    88             $flickr= new phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);
     88            $flickr= new w2f_phpFlickr(w2f_flickrAPI,w2f_flickrAPI_secret,false);
    8989            $flickr->setToken(get_option('w2f_token'));
    9090            if (get_option('w2f_flickr_URL')) {
     
    229229        echo "<form action=".wp_specialchars( $_SERVER['REQUEST_URI'] )." method=\"post\">";
    230230        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               
    233240        echo "Is public? ";
    234241        echo '</td><td>';
     
    287294
    288295function w2f_updateOptions() {
     296    update_option( 'w2f_token', stripslashes( $_REQUEST['form_w2f_token']  ) );
    289297    $v=($_REQUEST['form_w2f_flickr_is_public']=='on') ? 1 : 0;
    290298    update_option( 'w2f_flickr_is_public', $v );
Note: See TracChangeset for help on using the changeset viewer.