Hack Help: Show direct link to picture file after uploading it. Hack Help: Show direct link to picture file after uploading it.
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Hack Help: Show direct link to picture file after uploading it.

Started by faptastic, May 31, 2006, 04:40:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

faptastic

[Does this count as a request?]

This is a hack which will show a direct link to the picture after uploading it.
After choosing the album to place it in, and pressing continue, the link appears at the bottom, so users can quickly copy and paste. I need this for a forum, as we want a moderatable image gallery/uploading place sort of like photobucket or imageshack.us. However, I'm new to coppermine, so this code should NOT BE USED except as demonstration.

In upload.php
replace

    // Create the form and echo more instructions.
    create_form($form_array);

    // More instructions.
    if(count($escrow_array) > '1') {

        form_statement($lang_upload_php['place_instr_2']);

    }

    // Make button say 'Continue.'
    close_form($lang_continue);


    // Close the table, create footers, and flush the output buffer.
    endtable();
    pagefooter();
    ob_end_flush();


with

    // Create the form and echo more instructions.
    create_form($form_array);

    // More instructions.
    if(count($escrow_array) > '1') {

        form_statement($lang_upload_php['place_instr_2']);

    }

    // Make button say 'Continue.'
    close_form($lang_continue);

//OMGHAX
if ($uploaded_pic != ""){
echo ("<tr><td>http://localhost/cpg/". $uploaded_pic."</td></tr>");
}
//end OMGHAX

    // Close the table, create footers, and flush the output buffer.
    endtable();
    pagefooter();
    ob_end_flush();


NOTE: You may want to replace localhost/cpg/ with the location of your gallery installation.

Although this is just a demonstration, that's what I'm aiming for. Is that fine for what I need, or is there a safer, better way to go about this?

Joachim Müller

Replacingecho ("<tr><td>http://localhost/cpg/". $uploaded_pic."</td></tr>");withecho ("<tr><td>".$CONFIG['ecards_more_pic_target']. $uploaded_pic."</td></tr>");should make this code work without the need to hardocde the URL of your gallery folder.

faptastic

Alright! Thanks so much! Oh, and by the way, sorry about forgetting to set version.  :P I'm a dolt.

DiaMirza.com

If you upload only one picture it doesn't shows the link to the uploaded file.
This is also the case, when you upload more than 1 picture, it shows the links to all except the last one.  ???