Which is really the default theme and when did it change.

Started by akc42, February 10, 2013, 06:29:23 PM

Previous topic - Next topic

akc42

I am just in the progress of updating one of the sites I look after from 2.0RC5 to 2.0.4.  I am doing it a test server because we made quite a few mods to things and I need to see that it is all working before I put it live.

We have our own theme that doesn't have a boardIndex template.  In fact it uses a version of the colorizer mod that I incorporated several years ago, which I have kept up to date with  updates since v1 of SMF.

When we migrated to version 2 (one of the early release candidates) I modified the BoardIndex.template.php file in the Themes/Default directory to support the extra parameters with the board colors.  Although my own theme was the only one available to users, it is clear that it used the Themes/Default directory for the boardIndex part of the display

I have just completed the database upgrade, and now when I display the forum, it is creating the BoardIndex from the version in Themes/Core. The two most obvious effects of this is that the icon showing if there are new posts or not has reverted to the on.gif on2.gif and off.gif files rather than the slightly larger on.png on2.png and off.png files.  I have also lost all my colour.

Has there been a change recently as to how SMF defaults to a particular alternative when the current theme doesn't have the file, or has the database upgrade changed some settings?

Kindred

no, As it has always done. SMF will use the default version of a template file if such a file is not present in the custom theme


The current default theme is also called "Curve" and has not been significantly changes since 2.0RC4
Core is the old 1.1.x default theme which was sort of updated for 2.0, but not really very well - and core is in the Core directory for 2.0, while "curve" is in the default directory.


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

Arantor

Add to that small fact that themes can even indicate a parent theme, it is entirely possible for a theme to indicate it is based on Core not Curve. Without seeing the theme's code it's hard to tell.

akc42

Quote from: Arantor on February 11, 2013, 12:13:01 AM
Add to that small fact that themes can even indicate a parent theme, it is entirely possible for a theme to indicate it is based on Core not Curve. Without seeing the theme's code it's hard to tell.
How to you get a theme to indicate a parent.  I was looking to see if that is possible in the wiki and couldn't find anything

akc42

I have been digging a little deeper into this.   

It all comes down to $settings['base_theme_dir'], which seems not to be in my database (so presumable not needed in 2.0RC5) but which by the time it has come to setup $settings['template_dirs'] has been set to the core theme.  As a result the template dirs list mytheme, core, default in that order as the directories to look for templates.  Since BoardIndex.template.php doesn't exist in my these it tries "core" next and finds it there.

I haven't tracked down where $settings['base_theme_dir'] gets set from yet, but this seems likely the crux of my problem.

Shambles

Quote from: akc42 on February 11, 2013, 05:45:42 AM
I haven't tracked down where $settings['base_theme_dir'] gets set from yet, but this seems likely the crux of my problem.

Yep. Look in ManageServer.php

akc42

Quote from: Shambles on February 11, 2013, 05:50:54 AM
Quote from: akc42 on February 11, 2013, 05:45:42 AM
I haven't tracked down where $settings['base_theme_dir'] gets set from yet, but this seems likely the crux of my problem.

Yep. Look in ManageServer.php

I found it, and its not in there.  Its in Load.php in the loadTheme function.

What happens is it gets this data from the database (the smf_themes table).  The reason that base_theme_dir has been set is the recent upgrade process added this to the database.

Why would it make it core and not default?  Is this a bug?

akc42

Removed the added entries from my database and now it all works perfectly.

Have reported it as a bug

Advertisement: