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: "Apply Modification" direct link to the album modified  (Read 3436 times)

0 Members and 1 Guest are viewing this topic.

bb3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
"Apply Modification" direct link to the album modified
« on: March 16, 2009, 06:38:33 pm »

I wonder if i can change the link of "apply modification" because whenever i click apply modification it links to same modifying page. same with the album whenever i click "update album" it also links to the album modifying page.

what am i want to do is to change the link of the "apply modification" and "update album" i want them to link on the album of the modified file and to the modified album itself.

does anyone know to do it? thanks

link to my gallery:

http://gallery.redlens.org

uname: test
pword: user

thanks
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: "Apply Modification" direct link to the album modified
« Reply #1 on: March 17, 2009, 09:12:32 am »

I have no idea what you're talking about, but the "apply modification" buttons are not actually links, but submit buttons for forms. The way forms work mean that the form data entered by the visitor needs to be processed on a page - you can not deliberately change the target of a form. What you can do though is adding some code that performs a redirect after the form data have been processed. However, this is where you have lost me: what form should redirect to what page? Post deep links if you can.
« Last Edit: March 19, 2009, 08:43:45 am by Joachim Müller »
Logged

bb3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: "Apply Modification" direct link to the album modified
« Reply #2 on: March 18, 2009, 11:12:20 am »

sorry for the misunderstanding

what i want is whenever i hit the apply modification i want to redirect it to the album page and not in the modify page which is the default

http://redlens.org/gallery/editOnePic.php?id=147&what=picture <----- this is the modify page. you can see the "apply modification" button and when you click it, it redirects to the same page and i want to redirect it in the album page in which the modified files belong.

thanks for your time
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: "Apply Modification" direct link to the album modified
« Reply #3 on: March 19, 2009, 08:52:20 am »

Untested code out of the back of my head (please report): edit editOnePic.php, find
Code: [Select]
if (isset($_POST['submitDescription'])) process_post_data();and replace with
Code: [Select]
if (isset($_POST['submitDescription'])) {
        process_post_data();
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
        $redirect = "displayimage.php?pos=-$pid";
header($header_location . $redirect);
pageheader('OK', "<meta http-equiv=\"refresh\" content=\"0;url=$redirect\" />");
msg_box($lang_info, 'redirecting', 'continue', $redirect);
pagefooter();
ob_end_flush();
die;
}
Logged

bb3

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 39
Re: "Apply Modification" direct link to the album modified
« Reply #4 on: March 19, 2009, 10:33:57 am »

hi Joachim,

thanks!! it works but it redirected to the file itself. what i want to happen is to redirect it to the album where you can see thumbnails and where the file belongs.

i also tested multiple modification but it didnt redirect to the album http://redlens.org/gallery/index.php?file=jupload/jupload&action=edit_uploaded_pics&album=41&nb_pictures=3

Sorry but im not good in coding

thanks for the big help joachim
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: "Apply Modification" direct link to the album modified
« Reply #5 on: March 19, 2009, 10:37:41 am »

Change
Code: [Select]
if (isset($_POST['submitDescription'])) {
        process_post_data();
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
        $redirect = "displayimage.php?pos=-$pid";
header($header_location . $redirect);
pageheader('OK', "<meta http-equiv=\"refresh\" content=\"0;url=$redirect\" />");
msg_box($lang_info, 'redirecting', 'continue', $redirect);
pagefooter();
ob_end_flush();
die;
}
to
Code: [Select]
if (isset($_POST['submitDescription'])) {
        process_post_data();
$header_location = (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) ? 'Refresh: 0; URL=' : 'Location: ';
        $redirect = "thumbnails.php?album=$aid";
header($header_location . $redirect);
pageheader('OK', "<meta http-equiv=\"refresh\" content=\"0;url=$redirect\" />");
msg_box($lang_info, 'redirecting', 'continue', $redirect);
pagefooter();
ob_end_flush();
die;
}
then
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.