News:

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

Main Menu

Q re how themes work in 2.1 please

Started by landyvlad, July 05, 2018, 08:29:22 PM

Previous topic - Next topic

landyvlad

At the outset I am going to say that I assume the answers are "Yes, they do" and "yes".

Do the themes in 2.1 work in the same way as 2.0.x ?

That is, do forum modifications need to be installed in each theme separately?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GigaWatt

"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

landyvlad

Ah yes, well I suppose it does depend whether the mod makes any changes to the theme files eh !  :)
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GigaWatt

"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

landyvlad

and I don't suppose there's any EASY way to know.

It'd be either run it and see what the 'test' install shows OR
go through the manually parsing changes to see what files are touched  (and know what files relate to themes)


It's be good if mod authors could state whether their mods touch theme files. Maybe an idea for the future in the mods section?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

Aleksi "Lex" Kilpinen

The manual install instructions is the easy way to see now. Though I too think that the mod site could use some easy checkbox kind of things:

- Edits files (yes/no)
- Edits database (yes/no)
- Uses hooks (yes/no)
- Uninstalls cleanly (yes/no)

That sort of thing.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

landyvlad

Quote from: Aleksi "Lex" Kilpinen on July 06, 2018, 12:10:52 AM
The manual install instructions is the easy way to see now. Though I too think that the mod site could use some easy checkbox kind of things:

- Edits files (yes/no)
- Edits database (yes/no)
- Uses hooks (yes/no)
- Uninstalls cleanly (yes/no)

That sort of thing.

Yep - where do we submit this to the developers and the site people as a worthwhile inclusion?
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GigaWatt

Quote from: landyvlad on July 05, 2018, 11:51:43 PM
and I don't suppose there's any EASY way to know.

If it adds something to the UI, chances are the mod has to make modifications in the theme files too. I don't think this is a must (most of the gurus here could probably give you a more precise answer), but I think in most cases, yes, those mods will most likely make modifications to theme files as well.

In any case, before the mod is installed, it does a test to see if it can patch the files it has to patch (based on the installer info), so the list of files that it has to patch is presented. If you see any files in the Themes directory, then yes, it also has to patch theme files.

Quote from: Aleksi "Lex" Kilpinen on July 06, 2018, 12:10:52 AM
- Edits files (yes/no)
- Edits database (yes/no)
- Uses hooks (yes/no)
- Uninstalls cleanly (yes/no)

Yes, this would be a nice feature to add when submitting a mod ;).

Although, this doesn't stop the author from changing the policy in future releases :S.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

landyvlad

So if I have a forum set up with say 20 mods.

I then install a new theme.

I'd have to check the manual instructions for each of those mods and manually make the changes in the new theme files accordingly?



"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GigaWatt

Quote from: landyvlad on July 08, 2018, 08:44:52 PM
I'd have to check the manual instructions for each of those mods and manually make the changes in the new theme files accordingly?

Basically, yes, that would be correct.

Or, you could see which ones of those mods actually edit theme files, uninstall them in the reverse order you installed them, install the theme and install them back again in the order you installed them in the first place. In some cases, some mods might not find the code that they're supposed to replace in the theme you installed. In that case, yes, you have to manually edit the code of the theme file an insert/edit what the mod was trying to edit automatically.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

landyvlad

Thank you. Good to know how these things work.

It'd be handy to somehow have themes and other mods as entirely independent, but I also assume that this would require an extensive re-write of the forum code.

Maybe something to consider for SMF 3.x :D


I'll mark this thread as solved for now. Ta.
"Put as much effort into your question as you'd expect someone to give in an answer"

Please do not PM, IM or Email me with questions on astrophysics or theology.  You will get better and faster responses by asking homeless people in the street. Thank you.

Be the person your dog thinks you are.

GigaWatt

Quote from: GigaWatt on July 08, 2018, 09:28:56 PM
In some cases, some mods might not find the code that they're supposed to replace in the theme you installed. In that case, yes, you have to manually edit the code of the theme file an insert/edit what the mod was trying to edit automatically.

Forgot to mention that, in this case, you don't install the mod on the theme you're going to do the manual edits (test fails in some files of the theme, that means you don't change any files in the theme, i.e. you don't install the mod on that particular theme). Instead, write down which files have to be edited, and what code has to be edited, added, etc. and do It manually. For example, if the mod has to edit index.template.php, make a copy (backup) of the file in the same directory (for example index.template.php.before.some.mod.edits), edit the code of the original file and see if the edits work. If there are multiple files that need to be edited, make a backup of all of them before you do the edits, edit them and see if the changes work as expected ;).

Quote from: landyvlad on July 08, 2018, 10:18:54 PM
It'd be handy to somehow have themes and other mods as entirely independent, but I also assume that this would require an extensive re-write of the forum code.

Yes, with the current way SMF works, that would require extensive code edits and, as far as I know, there are no plans for this kind of major code rework. Besides, this would also mean that the current mod and theme system will probably not work in the new system, so authors will be forced to either update their mods/themes or abandon maintaining them (the latter being more probable).

This is precisely what happened when Mozilla switched to WebExtensions and abandoned the XUL extension system. Only a few authors stayed developing WebExtensions and the extensions are either donation ware (with the damn PayPal button showing up on every setting page of the extension), ad ware (supported by ads... basically making the extension useless since the browser opens pop ups on every new tab :S), paid extensions (from all sorts of suspicious startup companies) or require additional software to be downloaded for the extension to work (if I wanted to use additional software, I would have just used a separate piece of software, right, not look for an extension for my browser).

I think this is the more likely scenario if the mod/theme system in SMF is changed. Sure, the software by itself will be free, but every mod worth having that adds really useful options and functions to the forum, will be a paid one :S.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Aleksi "Lex" Kilpinen

Well, up to a point the hook system in 2.x is designed to allow a lot without editing existing codebase, and meant to be used like that, but we do still have a lot of mods doing direct edits as well.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: