Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Hack Help: Show direct link to picture file after uploading it.  (Read 2606 times)

0 Members and 1 Guest are viewing this topic.

faptastic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21

[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
Code: [Select]
    // 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

Code: [Select]
    // 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Hack Help: Show direct link to picture file after uploading it.
« Reply #1 on: May 31, 2006, 07:05:16 am »

Replacing
Code: [Select]
echo ("<tr><td>http://localhost/cpg/". $uploaded_pic."</td></tr>");with
Code: [Select]
echo ("<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.
Logged

faptastic

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Hack Help: Show direct link to picture file after uploading it.
« Reply #2 on: May 31, 2006, 07:20:03 am »

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

DiaMirza.com

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Hack Help: Show direct link to picture file after uploading it.
« Reply #3 on: June 01, 2006, 11:01:26 pm »

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.  ???
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.