if a
user (if allowed, not admin
) 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 detailsopen
member.php and look for:
add_searchwords($image_id, $search_words);
$msg = $lang['image_edit_success'];
add
below header("Refresh: 2; url=".$site_sess->url(ROOT_PATH."details.php?image_id=".$image_id, "&")); // refresh after edit MOD
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
Part 2) Go back after
editing commentopen ./
member.phpand find
$msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error'];
replace with:
// 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"
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
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