Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Admin Side Theming! (r3149)
Bloke wrote:
Now, I would argue that a plugin is the right place for all this paraphernalia, but in order to work the core would have to check for the existence of a cookie first and try to find that theme — of course, dropping back to global/classic if not found. Once something like this (or an equivalent) is in place,
I elected to make something equivalent which delegates the actual implementation onto the strong shoulders of imaginative plugin authors while the TXP core suffers from a very low overhead for vanilla installs ;-)
You could start like so, and work your way upwards:
if (@txpinterface == 'admin') {
register_callback('foo_theme_name', 'admin_side', 'theme_name');
}
function foo_theme_name($event, $step, $extra='')
{
global $txp_user;
return ($txp_user) ? 'classic' : 'remora';
}
Offline
Re: Admin Side Theming! (r3149)
Bloke wrote:
Yeah, tried that and it affected 0 rows, so it did not work. I don’t see any option for the theme switching in Advanced prefs.
Offline
Re: Admin Side Theming! (r3149)
jstubbs wrote:
I don’t see any option for the theme switching in Advanced prefs.
This is probably the odd case of a SVN checkout being younger than the modify date of the _update_xxx.php script. Try this:
UPDATE txp_prefs SET val= '0' WHERE name = 'dbupdatetime' ;
Offline
Re: Admin Side Theming! (r3149)
Thanks Robert – that query affected one row so it worked, but still not theme drop down select box (assuming that’s what it is).
Offline
Re: Admin Side Theming! (r3149)
Well, then we’d have to beat this stubborn thing into submission:
INSERT into txp_prefs SET prefs_id = 1, name = 'theme_name', val = 'classic', type = '1', event = 'admin', html = 'themename', position = '160';
Offline
Re: Admin Side Theming! (r3149)
wet wrote:
I elected to make something equivalent which delegates the actual implementation onto the strong shoulders of imaginative plugin authors
Sweet as. You da man! I’ll have a play with this at some point, thanks.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Admin Side Theming! (r3149)
If I accidentally activate a theme that isn’t working properly (i.e. causing a fatal error), is there anyway to revert back to the original theme through TXP? Right now I’m just going into the DB and changing the entry manually. Let me know if I’m missing something.
Offline
Re: Admin Side Theming! (r3149)
Amit – You can delete the offending theme files then do a refresh which should bring back the Classic theme. Then re-upload your theme files and start again.
Last edited by thebombsite (2009-03-23 14:54:03)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: Admin Side Theming! (r3149)
wet wrote:
INSERT into txp_prefs SET prefs_id = 1, name = 'theme_name', val = 'classic', type = '1', event = 'admin', html = 'themename', position = '160';
Thanks for the SQL. I entered it and now see a text option for the theme:
theme_name classic
Its not a drop down box. Should be, correct?
Offline
Re: Admin Side Theming! (r3149)
Yes. You are quite sure that you pulled the very latest development state from SVN, aren’t you?
Offline
Re: Admin Side Theming! (r3149)
I think I am having issues with that Robert. Can you point me to the “correct” SVN instructions? I used Transmit following the TextBook guidelines, but maybe I missed something. I have OSX and only need SVN for TXP.
Offline
Re: Admin Side Theming! (r3149)
Sorry, no idea. “I’m a PC, you’re a Mac”. Wrong religion…
Offline