Skip to content

Commit 321d1ed

Browse files
author
ptcong
committed
update docs
1 parent 6fccce0 commit 321d1ed

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ and include the code on the top of your file:
9191
ChipVN_ClassLoader_Loader::registerAutoLoad();
9292

9393
then
94-
### Upload to Picasa.
94+
### Upload to Picasa - ver 1
9595
To upload image to Picasa, you need to have some AlbumIds otherwise the image will be uploaded to _default_ album.
9696
To create new AlbumId faster, you may use echo `$uploader->addAlbum('testing 1');`
9797

@@ -103,6 +103,36 @@ To create new AlbumId faster, you may use echo `$uploader->addAlbum('testing 1')
103103
echo $uploader->upload(getcwd(). '/test.jpg');
104104
// this plugin does not support transload image
105105

106+
### Upload to Picasanew - ver 2 (use OAuth 2.0)
107+
To upload image to Picasanew, you need to have some AlbumIds otherwise the image will be uploaded to _default_ album.
108+
To create new AlbumId faster, you may use echo `$uploader->addAlbum('testing 1');`
109+
110+
$uploader = ChipVN_ImageUploader_Manager::make('Picasanew');
111+
$uploader->login('your user name', ''); // we don't need password here
112+
$uploader->setApi('Client ID'); // register in console.developers.google.com
113+
$uploader->setSecret('Client secret');
114+
// you can set upload to an albumId by array of albums or an album, system will get a random album to upload
115+
//$uploader->setAlbumId(array('51652569125195125', '515124156195725'));
116+
//$uploader->setAlbumId('51652569125195125');
117+
if (!$uploader->hasValidToken()) {
118+
$uploader->getOAuthToken('http://yourdomain.com/test.php');
119+
}
120+
echo $uploader->upload(getcwd(). '/test.jpg');
121+
// this plugin does not support transload image
122+
123+
### Upload to Flickr
124+
To upload image to Picasa, you need to have some AlbumIds otherwise the image will be uploaded to _default_ album.
125+
To create new AlbumId faster, you may use echo `$uploader->addAlbum('testing 1');`
126+
127+
$uploader = ChipVN_ImageUploader_Manager::make('Flickr');
128+
$uploader->setApi('API key');
129+
$uploader->setSecret('API secret');
130+
$token = $uploader->getOAuthToken('http://yourdomain.com/test.php');
131+
$uploader->setAccessToken($token['oauth_token'], $token['oauth_token_secret']);
132+
133+
echo $uploader->upload(getcwd(). '/test.jpg');
134+
// this plugin does not support transload image
135+
106136
### Upload to Imageshack
107137

108138
$uploader = ChipVN_ImageUploader_Manager::make('Imageshack');

0 commit comments

Comments
 (0)