News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Hard-coding 'return to topic after post'

Started by samborabora, March 16, 2014, 10:01:19 AM

Previous topic - Next topic

samborabora

I've set the "Return to topics after posting by default" on my mobile theme, but it isn't actually bothering to follow this setting. Whereabouts in the templates can I hard-code the function to return to topic after posting a reply?

kat

Did you set that in your profile? Or, did you set it in the theme's admin settings?

samborabora

Admin settings to set it for all themes. The mobile theme strangely doesn't show in the settings page, but I set it on all the themes, and I changed the URL in the browser to match the id of the theme, and it appeared to be set to Return to Topic, but it still doesn't work. I guess it must be a badly programmed theme which is why I want to hard code it in.

kat

If it's the theme, itself, that's being a pain, you might get better help in the theme's support topic.

The best that I can figure, code-wise, is this

echo '
<li>
<input type="hidden" name="default_options[return_to_post]" value="0" />
<label for="return_to_post"><input type="checkbox" name="default_options[return_to_post]" id="return_to_post" value="1"', !empty($context['member']['options']['return_to_post']) ? ' checked="checked"' : '', ' class="input_check" /> ', $txt['return_to_post'], '</label>
</li>


in Profile.template.php. If you change "value="0"" to ""value="1"" and vice-versa, it might do the job. But, I'm not sure, of that, by any stretch of the imagination. So, keep a backup of the file, in case I'm wrong, woncha?

samborabora

Thanks so much for your advice, here is the code for the Profile.template.php page for the iphone theme:

<?php
// Version: 2.0 RC4; Profile

function template_profile_above(){}
function 
template_profile_below(){}

function 
template_summary()
{
global $context$settings$options$scripturl$modSettings$txt;

echo ($context['member']['avatar']['href']) ? '
<style type="text/css">
#avatar{
background: url('
.str_replace(' ','%20'$context['member']['avatar']['href']).') #fff center no-repeat !important;}</style>' '''

<div id="profileheader">

<div id="avatar"></div>

<div id="username"><h3>'
$context['member']['name'] ,'</h3><h4>'$context['member']['group'] ,'</h4></div>

</div>


<ul class="profile">

<li>
<div class="field">
<div class="fieldname">'
$txt['iPosts'] .'</div>
<div class="fieldinfo">'
$context['member']['posts'] .'</div>
</div>
</li>'
,$context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override' '

<li>
<div class="field">
<div class="fieldname">'
$txt['iEmail'] .'</div>
<div class="fieldinfo">'
$context['member']['email']. '</div>
</div>
</li>'
:'',(!empty($modSettings['titlesEnable']) && !empty($context['member']['title']))?'

<li>
<div class="field">
<div class="fieldname">'
$txt['iTitle'] .'</div>
<div class="fieldinfo">'
$context['member']['title'] .'</div>
</div>
</li>'
:'',($context['member']['blurb']!='')?'

<li>
<div class="field">
<div class="fieldname">'
$txt['iText'] .'</div>
<div class="fieldinfo">'
$context['member']['blurb']. '</div>
</div>
</li>'
:'', ($modSettings['karmaMode'] == '1') ? '

<li>
<div class="field">
<div class="fieldname">'
$txt['iKarma'] . ' </div>
<div class="fieldinfo">'
.($context['member']['karma']['good'] - $context['member']['karma']['bad']).'</div>
</div>
</li>'
:'', ($modSettings['karmaMode'] == '2') ? '

<li>
<div class="field">
<div class="fieldname">'
$modSettings['karmaLabel']. ' </div>
<div class="fieldinfo">+'
$context['member']['karma']['good']. '/-'$context['member']['karma']['bad']. '</div>
</div>
</li>'
:'', (!isset($context['disabled_fields']['gender']) && !empty($context['member']['gender']['name'])) ? '

<li>
<div class="field">
<div class="fieldname">'
$txt['iGender'] .'</div>
<div class="fieldinfo">'
.$context['member']['gender']['name'].'</div>
</div>
</li>'
:'', ($context['member']['age']>0)? '

<li>
<div class="field">
<div class="fieldname">'
$txt['iAge'] .'</div>
<div class="fieldinfo">'
$context['member']['age'].'</div>
</div>
</li>'
:'',(!isset($context['disabled_fields']['location']) && !empty($context['member']['location']))?'

<li><div class="field">
<div class="fieldname">'
$txt['iLocation'] .'</div>
<div class="fieldinfo">'
.$context['member']['location'].'</div>
</div>
</li>'
:'','

<li>
<div class="field">
<div class="fieldname">'
$txt['iRegistered'] .'</div>
<div class="fieldinfo">'
$context['member']['registered'] ,' </div>
</div>
</li>

<li>
<div class="field">
<div class="fieldname">'
$txt['iLastActive'] .'</div>
<div class="fieldinfo">'
$context['member']['last_login'], '</div>
</div>
</li>'
,($context['can_see_ip'])?'

<li>
<div class="field">
<div class="fieldname">'
$txt['iIP'] .'</div>
<div class="fieldinfo"><a href="#" style="color:#000">'
.$context['member']['ip'].'</a></div>
</div>
</li>'
:'',(empty($modSettings['disableHostnameLookup']) && !empty($context['member']['ip']) && $context['can_see_ip']) ? '

<li>
<div class="field">
<div class="fieldname">'
$txt['iHostname'] .'</div>
<div class="fieldinfo">'
$context['member']['hostname']. '</div>
</div>
</li>'
:'','

<li><div class="last field">
<div class="fieldname">'
$txt['iLocalTime'] .'</div>
<div class="fieldinfo">'
$context['member']['local_time'], '</div>
</div>
</li>

</ul>

<div class="profilebuttons">

<button'
, ($context['can_send_pm']) ? '':' disabled="disabled"' ,' onclick="window.location.href=\'index.php?action=pm;sa=send;u='$context['member']['id'] ,'\';">'$txt['iSendPM'] ,'</button>

<button'
, ($context['member']['show_email'] == 'yes' || $context['member']['show_email'] == 'yes_permission_override') ? ' onclick="window.location=\'mailto:'$context['member']['email'] .'\';"':' disabled="disabled"','>'$txt['iSendEmail'] ,'</button></button>


</div>

'
;

}

?>


There doesn't appear to be any of those lines here, which could explain the problem somewhat. Is there somewhere he in which these values could go?

kat

Yuk! With that file, as it is, I'd try a bit of "Trial and error", to see if I can get it to work.

samborabora

Been playing around but, not having alot of luck. Is this theme drastically different from Curve, since I can't quite see where the return_to_post function could really go on this. I'd really appreciate any ideas as to why it isn't returning to the post at all, even after it has been setup in the Layout settings.

margarett

You should really get some support in the theme's support topic...

You need to check, in the table "smf_themes", if you find a record like "return_to_post", with your user ID and the theme's ID, value = 1
This is the first step to check if the database setting is there or not.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Sorry for the late reply! I quite agree, I should ask in the theme's support, but it's so old this mobile theme! smf4iphone is super dead, but it's a really nice, quick theme for the phone, so I fitted it out with better detector and it shows up well, it's just for some reason there aren't any available theme options for it, the smf4iphone theme literally doesn't show up in member options, I wasn't aware that you could disable things like this for a theme? Is there anyway of hard wiring these kinds of settings in?

EDIT: It also doesn't have the "Edit this theme's stylesheets." under modify themes, I had no idea you could deactivate such settings?

Hj Ahmad Rasyid Hj Ismail

Interesting... I was about to create my own mobile theme. May be I can look into this too...

Arantor

The best mobile theme for SMF 2.0 is Dragooon's SMF4Mobile available from smf-media.com (paid). It'll take something fairly special to replace that.

2.1 is slowly gaining better mobile-aware theming though.

samborabora

Quote from: ahrasis on August 05, 2014, 12:40:12 PM
Interesting... I was about to create my own mobile theme. May be I can look into this too...
It's a strange old theme, it seemed to be created by one person, then that was taken it was repacked with a detector by fabius, I believe. I've gotten used to it style, and the html is really lite, just divs, spans and a lot of li's, but I think these days it has a few issues that I'm working through and trying to repair. If you're interested in what's going on with it, the download is: http://custom.simplemachines.org/themes/index.php?lemma=2089 but I'm currently using it with http://custom.simplemachines.org/mods/index.php?mod=3349 Mobile Device Detect.

Quote from: ‽ on August 05, 2014, 12:41:35 PM
The best mobile theme for SMF 2.0 is Dragooon's SMF4Mobile available from smf-media.com (paid). It'll take something fairly special to replace that.

2.1 is slowly gaining better mobile-aware theming though.

I hadn't seen that one, it does look amazingly all-singing, all-dancing, I forgot there were paid themes external to this site. I defiantly meant the best mobile theme I'd seen for free  ;)

Hj Ahmad Rasyid Hj Ismail

It's normal for mobile theme to drop many of the smf forum features especially administrative ones.

Dragoon mobile theme seems very good to me too. ;) It will be better if he can make it an android and ios app as well instead of just mobile theme. That would be gorgeous.

Arantor


Hj Ahmad Rasyid Hj Ismail

May be and may be not so expensive. The only think I think lacking is notification for the app implementation. Other than that web view function (for android) can call the forum just fine.

Arantor

No, it is more expensive seeing how it has a base cost even to just get started on the whole app development thing, unless you're talking about something like Tapatalk, but then there's Tapatalk which works on more than just SMF forums.

Hj Ahmad Rasyid Hj Ismail

I have created an android app: http://goo.gl/VnToA

I don't see why this one should be more difficult and should cost more if I am just going to use a simple webview function. I have all the tools and will create one to see how difficult it can be.

I will also share the steps for others to create one similar app later.

Arantor

Firstly, a simple webview does absolutely nothing of any practical use because there's no useful difference between a webview on a predefined webpage and just using the native browser to go to the same webpage.

Secondly, on iOS, it's demonstrably worse for the user experience because UIWebView gets a slower JavaScript engine than Safari does.

If you're going to build a native app, the idea is to actually build something with a phone-scaled UI using phone UI conventions, which a webview won't magically fix for you. Which means you need some kind of API on the server side to provide just the data for your custom built front end, like Tapatalk does.


Hj Ahmad Rasyid Hj Ismail

I prefer to do a simpler thing first. Once it is done, I can try to improve it bit by bit. First, I will do an android app with web view of a forum running mobile theme. Second, I will improve it by having some sort of forum notification. That is enough for me already and I will surely share this later.

Definitely someone like you can do more, if you want it. But that is, if you want it.

Arantor

But that still requires you having a mobile theme in the first place, which is the entire point of what you want to avoid if you have a native app.

Have fun with it. I personally think you're wasting a lot of time for no actual benefit, but have fun with it.

samborabora

Quote from: ahrasis on August 05, 2014, 02:27:56 PM
It's normal for mobile theme to drop many of the smf forum features especially administrative ones.

Interesting, I didn't know this could be done. I presume this is why this return to topic setting isn't happening, because the setting have been disabled. So, is there a way of putting admin settings such as this back into the theme?

Hj Ahmad Rasyid Hj Ismail

#21
Quote from: ‽ on August 06, 2014, 06:00:52 AM
Have fun with it. I personally think you're wasting a lot of time for no actual benefit, but have fun with it.

Lols. I definitely am having fun creating one and it is ready on the day we speak. ;) A simple app of course and just for myself. :P

Quote from: samborabora on August 09, 2014, 01:24:24 AM
Quote from: ahrasis on August 05, 2014, 02:27:56 PM
It's normal for mobile theme to drop many of the smf forum features especially administrative ones.

Interesting, I didn't know this could be done. I presume this is why this return to topic setting isn't happening, because the setting have been disabled. So, is there a way of putting admin settings such as this back into the theme?
I think if you explore a bit more you will find it. I am in a mood of festive season right now with a lot of open houses to attend to. Will see to this later.

Edited: In case somebody is reading this and is curious how I made the app, I have shared it in [TIPS / TRICKS] Create Android App For Your Forum topic step by step with sample file and tested app for any interested parties' convenience in creating such app.

samborabora

Massive necro-bump, can anyone tell me how to turn on "Return to topics after posting by default" via mysql or something, since I can't do this via admin (the theme just doesn't appear in member options)

margarett

For yourself or for everyone?

In any case, you need to add a row in smf_themes for every user:
* Find out the theme ID
* add a record with:
** id_member: --> ID of your member
** id_theme: --> ID of the theme
** variable: "return_to_post"
** value: 1
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Illori

Quote from: samborabora on May 01, 2015, 10:37:42 AM
Massive necro-bump, can anyone tell me how to turn on "Return to topics after posting by default" via mysql or something, since I can't do this via admin (the theme just doesn't appear in member options)

if the theme does not show in member options then try resetting the options for the default theme instead.

as the text on that page says

QuotePlease note that some themes may use the default options, in which case they will not have their own options.

samborabora

Quote from: Illori on May 01, 2015, 05:10:02 PM

if the theme does not show in member options then try resetting the options for the default theme instead.

as the text on that page says

QuotePlease note that some themes may use the default options, in which case they will not have their own options.

Tried changing the default theme, but it just goes back to the board.

Quote from: margarett on May 01, 2015, 04:46:07 PM
For yourself or for everyone?

In any case, you need to add a row in smf_themes for every user:
* Find out the theme ID
* add a record with:
** id_member: --> ID of your member
** id_theme: --> ID of the theme
** variable: "return_to_post"
** value: 1

Phew, that looks like alot! This unfortunately wouldn't do it for new members, would it? Can the redirect url be changed in a Sources file?

margarett

If the theme doesn't have that option, the best way is to add it. It's a standard option in default theme, it's strange that it was removed...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on May 01, 2015, 06:56:20 PM
If the theme doesn't have that option, the best way is to add it. It's a standard option in default theme, it's strange that it was removed...

Is there a way of forcing it on forum-wide? There was a method here for SMF 1: http://www.simplemachines.org/community/index.php?topic=7519.0;nowap but that's possibly redundant now? I remember there was a way of setting redirect URLs in one of the SMF files, but I can't remember now where it was, is there a way of overriding every setting for every theme to just return to the post after making a post?

Illori

this is what seemed to fix this for me... may or may not be 100% correct but solved the problem.

in your smf_themes table, find your theme and locate its "id"

then for that id add the following

add variable theme_layers with value html,body
add variable theme_templates with value index

then i copied from the default theme Settings.template.php and Themes.template.php

now you should see this theme show up in the members options page.

dont forget to do a backup just in case something goes wrong.

after i have done this, phpmyadmin looks something like this



given that my theme is id 49

samborabora

#29
Thanks, I already had this:


So i copied the two files into the folder from default, set the settings (now available!) in smf administration area aaand... still doesn't work :D

Is there some way of adding it so that new members have a table in mysql with this set?

Or can it just all be overwritten globally in a file?

Illori

did you try to set the options for "Configure guest and new user options for this theme " ? that should do what you want.

samborabora

Quote from: Illori on May 02, 2015, 02:27:21 PM
did you try to set the options for "Configure guest and new user options for this theme " ? that should do what you want.

Yep, both that and the defaults, nothing is getting this theme to take notice, which is why I just want to hard force the entire forum structure to use return to post for all of my themes, where is the code that controls WHERE it redirects to?

samborabora


margarett

I am looking at that theme now (on the computer) and it seems it has no way of accessing admin panel correctly... Probably because it is meant to use on the phone without all the functionality of the desktop version...

You can probably hackishly force the back to topic behavior in Sources/Post.php (because there is the place where the redirect after post is decided)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

just as a note:   If an admin forced this on me, I would be really annoyed.

Making the setting on by default is bad enough, IMO - but it can still be changed by the user...   FORCING the user to go back to the post? That's just wrong.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samborabora

Quote from: Kindred on May 03, 2015, 08:51:21 PM
just as a note:   If an admin forced this on me, I would be really annoyed.

Making the setting on by default is bad enough, IMO - but it can still be changed by the user...   FORCING the user to go back to the post? That's just wrong.

Okay, I would like to know, since the smf devs hate "return to topic after posting", why is it NOT okay to return after posting a new post, but it IS okay to return after editing your own post? Cause that's what happens right here on the smf forums.

Kindred

Well, first of all, I'm not a dev. :)

Second... it is a choice, the way we have it configured.

third...  as to why it returns after an edit - I assume that is probably because of the standard flow stuff - especially since an edit could be done in the MIDDLE of a thread or even, inline.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samborabora

Quote from: margarett on May 03, 2015, 08:29:46 PM
I am looking at that theme now (on the computer) and it seems it has no way of accessing admin panel correctly... Probably because it is meant to use on the phone without all the functionality of the desktop version...

You can probably hackishly force the back to topic behavior in Sources/Post.php (because there is the place where the redirect after post is decided)

Quote from: Illori on May 02, 2015, 07:13:12 AM
then i copied from the default theme Settings.template.php and Themes.template.php

that seems to add the options in admin, or you can just change the theme number in your browser url, can you see if it works after that?

samborabora

Quote from: Kindred on May 04, 2015, 01:17:21 AM
Well, first of all, I'm not a dev. :)

Second... it is a choice, the way we have it configured.

third...  as to why it returns after an edit - I assume that is probably because of the standard flow stuff - especially since an edit could be done in the MIDDLE of a thread or even, inline.

I thought it was discouraged against returning to topic since "no-one needs to review their own post" phylosophy, wouldn't editing be the same, regardless of which part of the thread it is?

I'd be more concerned about allowing edits to posts when new replies have been made...

Kindred

well, there is no control over "don't allow edits after replies are made"

there is only an edit-time setting (like we have in place here, now)

it's not discouraged, per say...  *I* dislike it, and I rail against it... and I claim that my stance is more logical...  but the option is present to set the default (return to message or to message index) for your own system -- and, as long as it is allowed for each user to decide for him/herself, I'm not going to complain. :)

As for editing....   six of one, half dozen of another...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

Yeah that's just a matter of preference. I like to return to topic, Kindred obviously doesn't :P

In any case, the big point is: if you FORCE it on your users, they might riot :P

Quote from: samborabora on May 04, 2015, 01:17:42 AM
Quote from: margarett on May 03, 2015, 08:29:46 PM
I am looking at that theme now (on the computer) and it seems it has no way of accessing admin panel correctly... Probably because it is meant to use on the phone without all the functionality of the desktop version...

You can probably hackishly force the back to topic behavior in Sources/Post.php (because there is the place where the redirect after post is decided)

Quote from: Illori on May 02, 2015, 07:13:12 AM
then i copied from the default theme Settings.template.php and Themes.template.php

that seems to add the options in admin, or you can just change the theme number in your browser url, can you see if it works after that?
I'll check.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on May 04, 2015, 05:29:37 AM
Yeah that's just a matter of preference. I like to return to topic, Kindred obviously doesn't :P

In any case, the big point is: if you FORCE it on your users, they might riot :P

Quote from: samborabora on May 04, 2015, 01:17:42 AM
Quote from: margarett on May 03, 2015, 08:29:46 PM
I am looking at that theme now (on the computer) and it seems it has no way of accessing admin panel correctly... Probably because it is meant to use on the phone without all the functionality of the desktop version...

You can probably hackishly force the back to topic behavior in Sources/Post.php (because there is the place where the redirect after post is decided)

Quote from: Illori on May 02, 2015, 07:13:12 AM
then i copied from the default theme Settings.template.php and Themes.template.php

that seems to add the options in admin, or you can just change the theme number in your browser url, can you see if it works after that?
I'll check.

Oh, the option has been removed from my templates, along with most options... it's kind of a "my way or the highway" deal :D But seriously, if it CAN be sorted out without forcing in POST.php, it would be great!

Kindred

so - add it back in to the template settings?


Although - if the value is NOT set for a specific theme, it defaults to use the default theme settings...

(this, of course, assumes that there is not a lingering setting in the database from a previous theme with that ID)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samborabora

Quote from: Kindred on May 04, 2015, 09:21:21 AM
so - add it back in to the template settings?


Although - if the value is NOT set for a specific theme, it defaults to use the default theme settings...

(this, of course, assumes that there is not a lingering setting in the database from a previous theme with that ID)

Okay, if I've cloned template.settings from default into the smf4iphone folder, and default returns to topic, then one would expect smf4iphone would too, but it doesn't. So how else would I add it back to template settings?

Kindred

no. that's not how it works....  you don't CLONE anything.

If a theme does NOT have a setting, then the system will use that settings from the default theme.

If that is not happening, then you have an issue - probably from some mod...

You could, as we suggested add the settings back in....  Settings.template.php -- but copying from the default may remove custom settings that the specific theme added


--edit - sorry... settings.template.php does not control the deeper settings...
those are in the database and set here...
/index.php?action=admin;area=theme;sa=reset;
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

samborabora

Yes, I know it's set in the database, and it can't be a mod since it works for all the other themes, and it DOESN'T use the setting from default.

Quote from: margarett on May 04, 2015, 05:29:37 AM
I'll check.

Did you manage to see how it looked, Bruno?

margarett

Well the theme no (I such at themes - like in coding, generally ;D ;D ;D)

But to do what you want is easy. In Post.php, find this
}

// General function for topic announcements.
function AnnounceTopic()
{

BEFORE THAT, meaning, at the end of function Post2(), are the redirect conditions after posting. You have something like this:
// Return to post if the mod is on.
if (isset($_REQUEST['msg']) && !empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg'], $context['browser']['is_ie']);
elseif (!empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.new#new', $context['browser']['is_ie']);
// Dut-dut-duh-duh-DUH-duh-dut-duh-duh!  *dances to the Final Fantasy Fanfare...*
else
redirectexit('board=' . $board . '.0');

And you just need to eliminate the last condition, eg:
// Return to post if the mod is on.
if (isset($_REQUEST['msg']))
redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg'], $context['browser']['is_ie']);
else
redirectexit('topic=' . $topic . '.new#new', $context['browser']['is_ie']);


So that you will always redirect ;)

Eventually this could be tweaked to do that just on a certain theme but it should do the trick for now ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

Quote from: margarett on May 06, 2015, 05:25:10 AM
Well the theme no (I such at themes - like in coding, generally ;D ;D ;D)

But to do what you want is easy. In Post.php, find this
}

// General function for topic announcements.
function AnnounceTopic()
{

BEFORE THAT, meaning, at the end of function Post2(), are the redirect conditions after posting. You have something like this:
// Return to post if the mod is on.
if (isset($_REQUEST['msg']) && !empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg'], $context['browser']['is_ie']);
elseif (!empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.new#new', $context['browser']['is_ie']);
// Dut-dut-duh-duh-DUH-duh-dut-duh-duh!  *dances to the Final Fantasy Fanfare...*
else
redirectexit('board=' . $board . '.0');

And you just need to eliminate the last condition, eg:
// Return to post if the mod is on.
if (isset($_REQUEST['msg']))
redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg'], $context['browser']['is_ie']);
else
redirectexit('topic=' . $topic . '.new#new', $context['browser']['is_ie']);


So that you will always redirect ;)

Eventually this could be tweaked to do that just on a certain theme but it should do the trick for now ;)

This SEEMS correct, but strangely enough, it just gives me

An Error Has Occurred!
Unable to load the 'main' template.


?? :D

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

samborabora

This worked!
// Return to post if the mod is on.
if (isset($_REQUEST['msg']) && !empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.msg' . $_REQUEST['msg'] . '#msg' . $_REQUEST['msg'], $context['browser']['is_ie']);
elseif (!empty($_REQUEST['goback']))
redirectexit('topic=' . $topic . '.new#new', $context['browser']['is_ie']);
// Dut-dut-duh-duh-DUH-duh-dut-duh-duh!  *dances to the Final Fantasy Fanfare...*
else
redirectexit('topic=' . $topic . '.new#new', $context['browser']['is_ie']);
}


A real hack job, but it does what it's supposed to now, thank you Bruno!!

14 months later, we have the perfect solution to this question posed:

Quote
Quote from: samborabora on March 16, 2014, 10:01:19 AM
I've set the "Return to topics after posting by default" on my mobile theme, but it isn't actually bothering to follow this setting. Whereabouts in the templates can I hard-code the function to return to topic after posting a reply?

Thanks again!

Advertisement: