News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Global "Return to topics after posting by default"?

Started by Ibis, March 16, 2004, 08:21:45 AM

Previous topic - Next topic

Ibis

Is there any way to have "Return to topics after posting by default." on by default for all users?
I mean, for the admin to have on/off instead of just the users in their profiles?

I kinda want it like that, returning to the post instead of the message index :)
Searched this forum but couldn't find anything, sorry if I missed a thread or something that's already about this :)

pulpitfire

this is completely an unnoficial answer, so back up Post.php and try it at your own risk.  In Post.php, change:


// Return to post if the mod is on.
if (isset($_REQUEST['msg']) && !empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg']);
elseif (!empty($_REQUEST['goback']))
{


to this:


// Return to post if the mod is on.
                 redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg']);
if (!empty($_REQUEST['goback']))
{


this worked for me on one test, but is just a kind of temp-fix, until there is a complete mod to give you the option of selecting if you want it to redirect by default. 

bostasp

#2
I was pretty sure it was there... now I can't seem to find it either. :(

Ignore me, pege is being superman again  ;)

Ibis

Quote from: pege on March 16, 2004, 08:48:12 AM
this is completely an unnoficial answer, so back up Post.php and try it at your own risk.  In Post.php, change:
*lots of nice code here*
this worked for me on one test, but is just a kind of temp-fix, until there is a complete mod to give you the option of selecting if you want it to redirect by default. 
It worked like a charm :) Thanks :)

pulpitfire


Ibis

Actually, It didn't :P It goes back to the tread, but not to the specific post made, but to the first one in the thread :) Thanks anyway, might be me scewing something up :P

pulpitfire

actually, the option for the default theme on my board, at least, is only to take you back to the topic, and not necessarily the post.  when i check the "return to topic" box, it only takes me back to the topic. 

there is an easier way.  backup Post.template.php, and change this:


<td class="smalltext"><input type="checkbox" name="goback"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : '') . ' value="1" class="check" /> ' . $txt['back_to_topic'] . '</td>




<td class="smalltext"><input type="checkbox" name="goback"' . ($context['back_to_topic'] || !empty($options['return_to_post']) ? ' checked="checked"' : 'checked="checked"') . ' value="1" class="check" /> ' . $txt['back_to_topic'] . '</td>


this shouldn't mess anything up.  all it does is makes the box to return to the topic "checked" at all times.  nevertheless, use at own risk.


pulpitfire


Post.php looks like it should redirect to the specific post.  i'm not sure why it does here, but not on my default theme. 

question (Unknown).  when you check the "return to topic" button on the default theme, is it supposed to take you back to the specific message, or just to the beginning of the topic?  Also, is there some other option that can be checked to make it go back to the specific message when the "return to topic" button is checked?  thanks.

Ibis

Just tested it at my local Apache-server, where I test the forum, and make changes before uploading them to the real one. And it works there, going to the correct post, if I have it enabled in my Profile.
Mighty strange that.

EDIT: And now it works on the real one too o_O
With a little delay anyways :P
Hmm, I'll keep on playing around :P

pulpitfire


Ibis

I'm using your last tip there, with the Post.template, and that one's working like a charm :) Thanks once more :)

pulpitfire


[Unknown]

The not-returning-to-a-post problem is a bug in Internet Explorer.

-[Unknown]

Ibis

Hehe, too bad for my users then, I'm using Firefox :P Must have been using IE when having the problem then :) (was playing around with it)
Anyway, thanks for the help all :)

pulpitfire

thing is, i use the same browser for this SMF forum and mine.  when i click return to topic here, it takes me back to the specific post.  when i click it on mine, it takes me to the top of the thread.

HRM

I'm having excactly the same thing as pege. So don;'t think it's IE.

And i don't see the tag mentioned a few topics above this one btw.
Ed
To install something for the cat's 'cut' is never nice..... (old dutch saying) :D

Oldiesmann

It's not putting the "#new" thing on the end of the URL like it should...

Advertisement: