News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Ok, I haz nother question (mods that update version in db).

Started by Antechinus, January 16, 2015, 12:58:06 AM

Previous topic - Next topic

Antechinus

Just thinking, which always leads to trouble. Since I'm doing bug fixes for Apocalypse via package manager patches, it occurred to me that really I should write said packages so that they edit the theme version, if possible.

So with the fourth patch installed it'd be listed as Apocalypse_TK_2.04, for example, which should make things easier to keep track of. I assume this is not actually difficult to arrange.

How duz I do dis? Would need a db query of some description, I assume.

ETA: Well ok, it'd have to edit theme.info.xml and Settings.english.php too, but they're easy.

Arantor

Last I checked the only thing stored in the database as a version number is the version of SMF when first installed.

If you want to update the theme's name as shown to users/admins (which is what I assume you're trying to do), you need to find out the theme id number, then update smf_themes where variable = name and id_member = 0.

Antechinus

Yup, that was the idea. I can see finding out the theme id being a nuisance in practice though, unless there's some cunning way of doing it automatically without involving the admin. Then there's the fact that it'd have to work reliably on all databases.

On second thought, this may be more trouble than it is worth. It may be more practical to simply have a note added in admin somewhere that says what level the theme has been patched to. I could arrange that pretty easily with no db shenanigans required (already know how to do that) and I was mainly thinking of keeping track for admin and support purposes.

Arantor

There's no really reliable way to find the theme id. Even using the folder name is not especially reliable.

Antechinus

I suspected as much. Ok, I'll tick this off and do it the sensible way. Cheers. :)

Advertisement: