4images Modifications / Modifikationen > Mods & Plugins (Releases & Support)

[MOD]Go automaticaly back to image, after editing image/comment

(1/4) > >>

martrix:
if a user (if allowed, not admin :wink:) edits the image-details or a comment and posts the changes, he'll get stuck on a page just saying "Image edited successfully" or "Comment editet successfully"...
This tiny mod brings the user automaticaly back to the image-detail after posting the data...

Part 1) Go back, after editing image details
open member.php and look for:


--- Code: ---       add_searchwords($image_id, $search_words);
       $msg = $lang['image_edit_success'];
--- End code ---

add below


--- Code: ---      header("Refresh: 2; url=".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_id, "&")); // refresh after edit MOD
--- End code ---

save, but leave open, if want to implement part 2 also ;)

If 2 seconds is not enough for you, than just change that... you'd know where  :wink:


Part 2) Go back after editing comment

open ./member.php
and find

--- Code: ---$msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error'];
--- End code ---

replace with:
--- Code: ---// start - go automaticaly back to image after "editcomment"
    $sql = "SELECT image_id
            FROM ".COMMENTS_TABLE."
            WHERE comment_id = $comment_id";
    $id_result = $site_db->query($sql);
$row = $site_db->fetch_array($id_result);
$image_id = $row['image_id'];
// end - go automaticaly back to image after "editcomment"
    $msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error'];
// start - go automaticaly back to image after "editcomment"
header("Refresh: 2; url=".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_id, "&"));
// end - go automaticaly back to image after "editcomment"
--- End code ---

Also here it is set to 2 seconds. I won't tell you where to change that, 'cause it's obvious ;)

I thought I could manage the second part without a new SQL query, but i could not... maybe someone out there could teach me a better way :D

Part 3 would be a User-editation system :) Maybe someone has this already - I mean: the user may edit his comments (if allowed from the ACP)

Have fun

Vincent:
sounds good, it is working if you are looged in as adim?
in my case i have tested it but it is not working
---
i looged in - take a picture (detail) and below the picture you have a (Bearbeiten) text/button - on click i get in and have added a Keyword - the i saved but nothing happen - maybe the problem also was because when i push the button it opens a new window!

sincerly
vincent

V@no:
u are talking about different things here. when u edit an image being logged in as admin, it opens ACP page in new window.
When u logged in as regular member, it opens member page for editing images in the same window - and thats where these changes applyed to.

Vincent:

--- Quote from: Vincent on May 14, 2005, 09:37:35 AM ---sounds good, it is working if you are looged in as adim?

--- End quote ---
so this question could be answered with no!  :?

thanks v@no for your tip

vincent

V@no:
ops, sorry, I didnt even noticed it was a question...my bad...:?

Navigation

[0] Message Index

[#] Next page

Go to full version