sNews Forum

Previous sNews versions => sNews 1.5 Final => sNews 1.5 Problem Solving => Topic started by: michael kennedy on February 22, 2007, 10:48:13 pm

Title: 1.5.31 Redirect removed?
Post by: michael kennedy on February 22, 2007, 10:48:13 pm
Hi all, I remember inside of 1.5.30 that after you clicked on "Edit" and saw the "Operation completed succesfully!" page, then after a few seconds it would redirect you back to the newly completed page.

But it no longer does this in 1.5.31.  How much code is it to re-insert this?

I found it useful to be able to see the newly edited article again incase I made any errors, or wanted to quickly send the URL to someone.

Or if you think it's better that it stay on the "Operation completed" page, can't we atleast get a few more links there besides "back"?

How about having that page display:

- View Article
- Administration
- Logout

Just a thought...
Title: 1.5.31 Redirect removed?
Post by: tarmithius13 on February 22, 2007, 10:55:34 pm
I would like the redirect back. I thought I did something in my template conversions to break it but apparently it is not just me.
Title: 1.5.31 Redirect removed?
Post by: piXelatedEmpire on February 22, 2007, 11:49:10 pm
I was wondering what happened there... I think it is very important to either redirect to the article automatically or provide a view article link.
Title: 1.5.31 Redirect removed?
Post by: KayDee on February 26, 2007, 05:15:27 am
If you want it to redirect back to the article you just edited, you just need to add back in the meta refresh line that was removed from this version.

In function processing(), find this line (around line 1540 or so)
Code: [Select]
echo notification('','','administration/'); unset($_SESSION['temp']);and add after it:
Code: [Select]
echo '';Change the content number from 2, to however many seconds you want it to take before it redirects you there.
Title: 1.5.31 Redirect removed?
Post by: tarmithius13 on February 26, 2007, 01:34:41 pm
Oh thank you that works perfectly.
Title: 1.5.31 Redirect removed?
Post by: michael kennedy on February 26, 2007, 06:49:16 pm
Thanks, not bad for your first post KayDee.  :)
Title: 1.5.31 Redirect removed?
Post by: Keyrocks on February 26, 2007, 07:05:58 pm
Removal of this string from 1.5.31 bugged me too. Thanks for sharing this KayDee. Makes me happier. I wonder why it was removed from 1.5.31 in the first place? Must have been an oversight. :)
Title: 1.5.31 Redirect removed?
Post by: michael kennedy on February 26, 2007, 07:20:54 pm
Yeah, do you have the power to put it back in the core build keyrocks?

I also noticed what I think is another bug....  I tried changing the username and password from the admin panel and it keeps saying that the password doesn't match.  :/
Title: 1.5.31 Redirect removed?
Post by: Zucye on February 26, 2007, 07:49:33 pm
Quote from: keyrocks
Removal of this string from 1.5.31 bugged me too.
Me tooo...
 :D
Title: 1.5.31 Redirect removed?
Post by: Luka on February 26, 2007, 08:38:09 pm
I decided to remove that because it seemed that sometimes you don't want it to redirect you automatically. Also, automatic redirection was removed along with some other things to keep the core secure. Is this a thing you miss?
Title: 1.5.31 Redirect removed?
Post by: Zucye on February 26, 2007, 08:41:43 pm
YES!

** Also the tabs on the top part of this forum suddenly don't look nice (they are overlapping).
Title: 1.5.31 Redirect removed?
Post by: piXelatedEmpire on March 01, 2007, 01:36:49 am
Quote from: Luka
I decided to remove that because it seemed that sometimes you don't want it to redirect you automatically. Also, automatic redirection was removed along with some other things to keep the core secure. Is this a thing you miss?
I think many of us miss this particular feature.
Thanks for the fix KayDee :)
Title: 1.5.31 Redirect removed?
Post by: philmoz on March 01, 2007, 04:20:40 am
Quote from: Luka
I decided to remove that because it seemed that sometimes you don't want it to redirect you automatically. Also, automatic redirection was removed along with some other things to keep the core secure. Is this a thing you miss?
Actually, that is fair.
different people want the redirect to take them to different places. for eg,

someone commenting -- possible redirects
--show (thank you)/(awaiting moderation) =pause=> return to article
--show (thank you)/(awaiting moderation) =pause=> return to category
--show (thank you)/(awaiting moderation) =pause=> return to home

then there is admin.
-- operation success/error message =pause=> show article
-- operation success/error message =pause=> show (return to) editor
-- operation success/error message =pause=> show admin panel

so, maybe they should be 'left out' of basic snews, and some enterprising coder make a mod that puts them back in, and makes it possible to select the site options which are then stored in settings table...

ps.. I too liked the redirect, but I like security better ;)
Title: 1.5.31 Redirect removed?
Post by: michael kennedy on March 02, 2007, 05:52:36 pm
@philmoz

so back to my orginal idea - It's impossible to please everyone, so why not give them a list of several pages to then redirect to?
Title: 1.5.31 Redirect removed?
Post by: KayDee on March 05, 2007, 08:31:55 am
You are all welcome, and I like security better too  :)

Instead of the meta refresh, you could add a list of links there instead. Here is the way I did it. There might be a better way. If someone knows of one (or I goofed somewhere), they can let me know.

First, delete the meta refresh line from before that enables the redirect. Then, add the following language variables(the original 'Back' variable is near line 186, if you wanted to keep them organized together):
 
Code: [Select]
$l['back_admin'] = 'Go To Admin Panel';
$l['back_list'] = 'Show Article List';
$l['back_article'] = 'View Edited Article';
Again, find In function processing(), find this line (around line 1540 or so)
 
Code: [Select]
echo notification('','','administration/'); unset($_SESSION['temp']);Change that line to:
 
Code: [Select]
echo notification('','',''); unset($_SESSION['temp']);
echo '

'.l('back_admin').'

';
echo '

'.l('back_article').'

';
echo '

'.l('back_list').'

';
Now it will give you a choice of links:: 'Go To Admin Panel', 'View Edited Article', or 'Show Article List'
Title: 1.5.31 Redirect removed?
Post by: Zucye on March 05, 2007, 03:14:18 pm
Thanks KayDee, that seems to work very nice.
I really annoyed me to go looking for the article after it was edited, to see the final view :)
Title: 1.5.31 Redirect removed?
Post by: tarmithius13 on March 05, 2007, 03:46:01 pm
Works like a charm, thanks KayDee.
Title: 1.5.31 Redirect removed?
Post by: codetwist on March 05, 2007, 05:09:37 pm
Sense of good UI restored finally.
Title: 1.5.31 Redirect removed?
Post by: piXelatedEmpire on March 06, 2007, 01:33:50 am
Very sweet KayDee works terrificly!  :D
Title: 1.5.31 Redirect removed?
Post by: Zucye on May 23, 2007, 07:07:27 am
Quote
echo '

'.l('back_article').'

';
This link does not seem to point to the just edited article on the version 1.6 (like it did before :(  ) but to the Articles List.  How can I fix it?
Title: 1.5.31 Redirect removed?
Post by: codetwist on May 23, 2007, 08:16:34 am
Try following instead of that single line:
Code: [Select]
$linkToItem = find_cat_sef($category) . '/' . $seftitle .'/';
echo '

'.l('back_article').'

';
Title: 1.5.31 Redirect removed?
Post by: Zucye on May 29, 2007, 08:03:58 am
Thanks Codetwist, that works much better than before :)

Also, the line to change on Version 1.6 is (The second Instance) :
Code: [Select]
echo notification(0,'',$link); unset($_SESSION['temp']);Replace with (I added a link to the previous page - it makes editing, a bit simpler):
Code: [Select]
echo notification(0,'',''); unset($_SESSION['temp']);
echo '

'.l('back').'

';
$linkToItem = find_cat_sef($category) . '/' . $seftitle .'/';
echo '

'.l('back_article').'

';
echo '

'.l('back_list').'

';
echo '

'.l('back_admin').'

';
Title: 1.5.31 Redirect removed?
Post by: Sasha on May 29, 2007, 08:50:16 am
zucye we love yu baybe
Title: 1.5.31 Redirect removed?
Post by: Zucye on May 29, 2007, 04:32:21 pm
Oh.  Thank you Sasha!  I love you guys too.:D
Title: 1.5.31 Redirect removed?
Post by: Jochum Meester on May 30, 2007, 11:34:18 pm
You can even put a condition in there; if the admin is logged in then show the 'back to admin' / 'show article' links, if he/she's not logged in (normal guest) then only show this and that link. Just my 0.02  :rolleyes: