Hard-coding 'return to topic after post'

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

Previous topic - Next topic

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."

Advertisement: