Announcing: phpSmug 2.0

lildudelildude Registered Users Posts: 70 Big grins
Finally, after 7 months of slow but steady development, I'm happy to announce phpSmug 2.0 is now available for download and it's also got a whole new site dedicated to it - phpsmug.com (please update your bookmarks).

It's been a long time coming as there has only been one bug reported in the last release, and it wasn't a major issue, and I've been working on consolidating the code to make it more uniform and a lot easier to manage and maintain.

phpSmug has changed quite a bit, so please be sure to read the documentation (also in the README.txt) and my release announcement before updating your applications.


[HIGHLIGHT]
[SIZE=+1]NOTICE - NOTICE - NOTICE[/SIZE]

phpSmug 2.0 is [SIZE=+1]NOT[/SIZE] a drop in replacement for phpSmug 1.0.x or phpSmug 1.1.x.
phpSmug 2.0 has all this functionality and more and accordingly those older releases
(and this thread) are obsolete.
[/HIGHLIGHT]

If you encounter any problems with phpSmug 2.0, please let me know either via this thread or on the actual release post on phpsmug.com.

Oh and one final thing, I'll be offering up some link love for all applications that use phpSmug 2.0 and later. Keep an eye on phpsmug.com for details on how you can let me know about your application (I'm still thinking about how I can best promote them).

Enjoy.

Comments

  • jamesthedisciplejamesthedisciple Registered Users Posts: 4 Beginner grinner
    edited April 22, 2009
    phpSmug and wordpress
    Hi,
    I use wordpress for my blog and your little php script looks ideal for what I would like to do. Can it be used within wordpress and if so, how do I go about it?
  • lildudelildude Registered Users Posts: 70 Big grins
    edited April 22, 2009
    Hi,
    I use wordpress for my blog and your little php script looks ideal for what I would like to do. Can it be used within wordpress and if so, how do I go about it?

    Hi James

    Unfortunately, phpSmug isn't much use in the state I provide it - it's really just a wrapper to make communicating with the API easier. In order to get it working in Wordpress, you'll need to write some code that using phpSmug to query the API to get the info you want.

    Cheers,
    Colin
  • jamesthedisciplejamesthedisciple Registered Users Posts: 4 Beginner grinner
    edited April 22, 2009
    phpSmug and wordpress
    lildude wrote:
    Hi James

    Unfortunately, phpSmug isn't much use in the state I provide it - it's really just a wrapper to make communicating with the API easier. In order to get it working in Wordpress, you'll need to write some code that using phpSmug to query the API to get the info you want.

    Cheers,

    Colin
    Hi Colin,
    If I get it going I'll let you know
    James
  • darryldarryl Registered Users Posts: 997 Major grins
    edited May 8, 2009
    So, the documentation for phpSmug reads:
    There is no need to pass the SessionID or oauth_token* arguments to the various methods as phpSmug will automatically pass these, where applicable, unless otherwise documented. The exception is when using phpSmug to go through the OAuth authorization process detailed later.

    So I'm using an e-mail/password login, and it works fine in a single .php file. But when I link to another .php file, I no longer have a session.

    So... does the documentation only apply for a single .php script? Or am I missing something somewhere?

    I see in the example for oAuth that you're using php sessions to store the getAccessToken. But I don't see anything similar in the login or anon examples.
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited September 1, 2009
    I can't seem to get the login_withHash to work. I've followed the documentation to the T (even using the same variable names). I am able to login using email/password. I'm also able to login with hash when using the api straight from a browser. I'm not a programmer, but I did study C for a while and can reverse engineer examples and follow syntax well once I get used to it. I've worked with php before, so for the most part this is all pretty simple.

    But I don't know what I'm doing wrong, and I'm on a really tight time deadline for getting this done. Any assistance appreciated.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited September 1, 2009
    Well, after many hours of thinking I did something wrong, it looks like the documentation was wrong. <img src="https://us.v-cdn.net/6029383/emoji/rolleyes1.gif&quot; border="0" alt="" >

    This line from the readme.txt file says:
    To login using a UserID and password hash (obtained from a previous
    Email/Password login):
    $f->login("UserID=<value>", "Hash=<value>");
    It should say:
    To login using a UserID and password hash (obtained from a previous
    Email/Password login):
    $f->login("UserID=<value>", "PasswordHash=<value>");
    Just missing the word "Password" from the argument. Finally!!!
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • lildudelildude Registered Users Posts: 70 Big grins
    edited September 2, 2009
    SamirD wrote:
    Well, after many hours of thinking I did something wrong, it looks like the documentation was wrong. rolleyes1.gif

    This line from the readme.txt file says:
    It should say:Just missing the word "Password" from the argument. Finally!!!

    Hi SamirD.

    Well spotted. Thanks for bringing this to my attention. I'll update the README in the next release.

    Cheers,
    Colin
  • lildudelildude Registered Users Posts: 70 Big grins
    edited September 2, 2009
    darryl wrote:
    So, the documentation for phpSmug reads:



    So I'm using an e-mail/password login, and it works fine in a single .php file. But when I link to another .php file, I no longer have a session.

    So... does the documentation only apply for a single .php script? Or am I missing something somewhere?

    I see in the example for oAuth that you're using php sessions to store the getAccessToken. But I don't see anything similar in the login or anon examples.

    Hi Darryl.

    Sorry about the delay in getting back to you - for some reason I've not been getting the automatic comments on this thread.

    Anyway, if you're going to use oAuth, you need store the token id and secret returned by auth_getAccessToken() yourself so you can then pass them with every new instantiation of the phpSmug object as per the README...
    You will need to save the token and token secret returned by the
         `auth_getAccessToken()' call in your own location for later use.
    
         Once you've saved the token and token secret, you will no longer need to
         use any of the authentication methods above.  Simply call
         `setToken("id=<value>", "Secret=<value>")' and pass the token ID and token
         secret immediately after instantiating your object instance.
    
         For example:
    
              $f = new phpSmug(array("APIKey" => "12345678",
              	"AppName" => "My Cool App/1.0 (http://app.com)",
              	"APIVer" => "1.2.2")
              	);
              $f->setToken("id=<value>", "Secret=<value>");
    


    phpSmug does not keep a record of this token and secret as it can persist indefinitely, unlike the object you've just instantiated. The login methods work because your MUST login every time. Every login generates a new SmugMug API session which is automatically passed on because it only persists as long as the object does.

    HTH
    Colin
Sign In or Register to comment.