CVS edit link for haojiang

i write my website a module using flickr as an image hosting server.
i would like to share with the community.
CommentFileSizeAuthor
#1 uploadtoflickr.zip18.44 KBhaojiang

Comments

haojiang’s picture

Title: haojiang [haojiang] » [uploadToFlickr]:a new module upload photoes to flickr autoly [request cvs account]
Assigned: Unassigned » haojiang
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new18.44 KB

1.module [uploadToFlickr] , will autoly upload photoes to several flickr accounts concurrently ! it first analyze the $node->body field and find out all images'src link then it upload them to the flickr and then replaces all images'src with flickr'src!
there is a short video showing how to use , uploadtoflickr.avi

2.Using php cur_multi method , so , no pear required which is not like the famous project phpflickr and the others projects ! And what's more , you could upload concurrently which is only limit by you RAM

3.module will add a tab on the node/% page , you click "uploadToFlickr" tab and then confirm , that's all , photo outside of your site will be download temperately in you site and then upload together with the photo in already in your site to the flickr.

4.i provided an api method in case you need to upload to several flickr accounts in the same time with lots of images beacuse flickr limit the free acount to 100MB/month upload bandwidth.Using api means that flickr will be your image garden !

5.just a code screen cast:of my api

<?php
chdir('/home2/crawgirl/public_html/feedme/');//set to your site's root directory
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
//require inc file firstly
module_load_include('inc', 'uploadtoflickr', 'uploadtoflickr.page');
//several photoes from the internet:not form you site
$src[]="http://www.benbenlong.net/uploads/allimg/100512/11440459630-2.jpg";
$src[]="http://www.benbenlong.net/uploads/allimg/100512/1144045a56-3.jpg";
$src[]="http://www.benbenlong.net/uploads/allimg/100512/11440456036-1.jpg";
$src[]="http://www.benbenlong.net/uploads/allimg/100512/11440456036-4.jpg";
$src[]="http://www.benbenlong.net/uploads/allimg/100512/11440456036-5.jpg";
//serveral photoes from our server
$src[]="./api/1.jpg";//respect to index.php
$src[]="./api/2.jpg";//to the current file

$size="large";//small , all .....,not necessary,
$downoutsite=TRUE;
$api_key="8268c703cbcd3cf04631977d46de53b8";//this is another api_key , remember?
$scret="affccfd7625fcd59";
$auth_token="7215762392c641405-e1af8a22b6076b2e";
//$tempfolder="./sites/all/default/files/uploadtoflickr/"//must be written by drupal
$result= uploadtoflickr_upload($src,$size,$downoutsite,$api_key,$scret,$auth_token);
// or just $result=uploadtoflickr_upload($src);is fine
print_r($result);

?>

6.module is just woking fine , expressly api mode , there will be no harm to working sites
7.But the UI of this module is just too bad , cause i could not successfully figure out formapi : multistep form, drupal_goto,form_confirm, they are too difficult to me right now, please provide help if you know them , this will help me make a better UI .

8.there will be coming features ,very easy , because i write the core in a class ! you will find it name "class curlflickr" in uploadtoflickr.page.inc

9.and i need help with the durpal session control/handle , i still not figure out why i could not use session_start on inc file, if i have know enough message on session control , a better core of this module will come.

10.this version will have the user to change the *.inc for config on the first time using , but just once config,nothing more.

download the attachment to test! and the demo site is one of my photo collection site : http://feedme.trackself.com

learning from
rules:http://drupal.org/node/751826
http://blog.riff.org/2008_08_12_checkboxes_forms_step_step
multistepform:http://pingvision.com/blog/ben-jeavons/2009/multi-step-forms-drupal-6-us...
http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....
passing argument :http://diggit.drupalextras.com/passing-arguments-form-callback-within-dr...
http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....

avpaderno’s picture

Title: [uploadToFlickr]:a new module upload photoes to flickr autoly [request cvs account] » haojiang [haojiang]
Assigned: haojiang » Unassigned
avpaderno’s picture

Status: Needs review » Needs work

Hello, and thanks for applying for a CVS account.
After a quick review, I found out the code needs to be correct as per the following points:

  1. See http://drupal.org/coding-standards to understand how a module should be written. In particular see how the code must be formatted, and the constants must be written.
  2. The code depends from PHP 5, but it doesn't declare this dependency in the file .info.
  3. The content of the directory tools must be removed.
haojiang’s picture


See http://drupal.org/coding-standards to understand how a module should be written. In particular see how the code must be formatted, and the constants must be written.

crying......tearing......
Operators , Casting , Control Structures.....and all formats
it was a huge job , are there any tools available to do this in a second please?

avpaderno’s picture

There is a module, but it doesn't replace a human review, as it is not able to report all the changes you need to do to your code. The module is http://drupal.org/project/coder, anyway.

haojiang’s picture

thx a great lot , using eclipse to correct code now and will try project/code if fail in eclipse

haojiang’s picture

could i hold this require for a while , because i would like to add some interest features .
Since i add features , i will have to rewrite some codes , so while these rewriting , i could code following the standard and change them ,and the main reason is that i have to find/learn a tool/eclipse which could check if the code is standard for me.
thx for all you help.

avpaderno’s picture

To get this application approved, the code needs to follow the Drupal coding standards. The more you wait to change the code to follow the coding standards, the more difficult would be for you to correct the code.

I don't think there is an Eclipse plugin that is able to check the code and see if it follows the Drupal coding standards; the only tool available is the module I reported before.

avpaderno’s picture

Status: Needs work » Closed (won't fix)

There have not been replies in the past week. I am marking this application as won't fix.

avpaderno’s picture

Component: Miscellaneous » new project application
Issue summary: View changes
Status: Closed (won't fix) » Closed (duplicate)
Related issues: +#2234637: [D7] XunSearch