MyBB Community Forums

Full Version: How to update and alter released themes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I'm new to MyBB, but have used other open source projects and am exploring MyBB and trying to learn how it works.

One thing I've not met before is that the PHP templates for a theme are stored in the database rather than the file system. I'm trying to figure out how that works in two areas: upgrading a theme, and editing a theme.

Upgrades first. If I use a released theme, and the theme author releases an upgrade, do I just go to the same screen in AdminCP where you install the theme, and install the new version in the same way? Does it then just overwrite the templates in the database (assuming the checkbox is checked to import templates)?

Edits: Likely as not, I'd want to start with a released theme, then edit it. Change headers / footers / menu bars / add analytics code and so on. Those changes are then in the database. What do other people do when the original theme has an update?

If I was using a file-based templating system, I'd take a unified diff from the original theme and my altered version of it. I'd then see if that can be patched against the new version of the original theme, so that my changes get incorporated into the new theme. Any hunks that won't patch, I'd do by hand. I don't know if any equivalent to "diff -ur" for database-stored templates. So before I start editing a theme, and do it in a way that makes upgrading unnecessarily painful, I thought I'd ask here what workflow other people have for all this.

Oh, and PS: Are CSS files all in the database as well? If I edit those in AdminCP, where do those edits end up?
In MyBB, it is currently not possible to do upgrade in such a way that you just upload a new theme and it will retain all your custom changes.

The best way is to ask your theme dev to release a changelog of all templates or theme css and you use those files to find diff and do an update. If there are too many changes in new theme, than I will suggest doing your custom changes in the new version.

I hope there is a better way in future for dealing such issues though.

Regards
WallBB
(2017-02-07, 02:10 PM)WallBB Wrote: [ -> ]In MyBB, it is currently not possible to do upgrade in such a way that you just upload a new theme and it will retain all your custom changes.

Asking for that to be automated would be a big ask. Big Grin

I wasn't particularly expecting that. I can see that looking for released themes that issue a detailed changelog would help me - but not many seem to do that.

The system does know about changes - there's a "revert" button for any template changes. Given that, is there any way to get a report of all changes that have been made, so they can be made again. (I can see that I'm going to end up keeping detailed documentation of each change, so I can work through my list whenever there's an update).