Author Topic: [MOD REQ] Redirect to image details after upload  (Read 6754 times)

0 Members and 1 Guest are viewing this topic.

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
[MOD REQ] Redirect to image details after upload
« on: September 15, 2008, 01:16:59 PM »
How can I automatically redirect user to image details after he/she uploaded image?

I thought that I could add something like this in member.php but don't know how can I get image ID:

Quote
      $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";
     header("Location: details.php?image_id=".$image_id."");
     exit;   

Offline Lucifix

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
    • http://www.slo-foto.net
Re: [MOD REQ] Redirect to image details after upload
« Reply #1 on: September 15, 2008, 01:38:02 PM »
I did something by my self, but this could only be temporary:

Code: [Select]
$sql = "SELECT user_id, image_id, image_date FROM ".IMAGES_TABLE." WHERE user_id=".$user_info['user_id']." ORDER BY image_date DESC LIMIT 1";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$image_new = ($row['image_id']);

header("Location: details.php?image_id=".$image_id."");
exit;

Offline I_Want_Mods_2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [MOD REQ] Redirect to image details after upload
« Reply #2 on: March 15, 2009, 04:50:06 PM »
Why this could only be temporary?
I use 4images 1.7.6

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD REQ] Redirect to image details after upload
« Reply #3 on: March 15, 2009, 10:01:27 PM »
because that method might fail if image required validation.

You can add below       $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";

this code:
      if ($image_id)
        
redirect("details.php?".URL_IMAGE_ID."=".$image_id);

but it will not show any messages it will simply redirect.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline 4ella

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • http://www.dancersrecruit.com/pictures/
Re: [MOD REQ] Redirect to image details after upload
« Reply #4 on: June 08, 2009, 03:05:37 PM »
@Vano .
Is it possible to redirect to the current category instead the current image? I think its better because people can continue upload with Upload button - Or to implement the Upload button to the Image page , I have the problems that people doesn't know what to do and where to go after succesful or failed upload to continue uploading (only way or quickiest way I know is via clickstream - not very comfortable and newbies doesnt know that immediately ).

http://www.dancersrecruit.com/pictures/
4IMAGES 1.7.6 version/default theme
Apache version   2.2.11 (Unix)
PHP version   5.2.9
MySQL version   5.0.75-community-log
Architecture   x86_64
Operating system   Linux

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD REQ] Redirect to image details after upload
« Reply #5 on: June 08, 2009, 04:04:03 PM »
Use this instead:
      if ($image_id)
        
redirect("categories.php?".URL_CAT_ID."=".$cat_id);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline 4ella

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • http://www.dancersrecruit.com/pictures/
Re: [MOD REQ] Redirect to image details after upload
« Reply #6 on: June 08, 2009, 04:24:19 PM »
Thanks a lot V@no -:), much more better now than control panel , quicker access to upload another picture , recommend to  everyone , only message miss there .

http://www.dancersrecruit.com/pictures/
4IMAGES 1.7.6 version/default theme
Apache version   2.2.11 (Unix)
PHP version   5.2.9
MySQL version   5.0.75-community-log
Architecture   x86_64
Operating system   Linux