Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#37 2009-03-23 06:57:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

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

#38 2009-03-23 07:03:42

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Admin Side Theming! (r3149)

Bloke wrote:

Does this help?

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

#39 2009-03-23 07:09:29

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

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

#40 2009-03-23 07:19:26

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

#41 2009-03-23 07:25:24

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

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

#42 2009-03-23 08:46:42

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,280
Website GitHub

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

#43 2009-03-23 14:47:10

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

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

#44 2009-03-23 14:53:35

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#45 2009-03-23 18:33:30

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

#46 2009-03-23 18:35:30

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

Re: Admin Side Theming! (r3149)

Yes. You are quite sure that you pulled the very latest development state from SVN, aren’t you?

Offline

#47 2009-03-23 18:59:17

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

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

#48 2009-03-23 19:17:10

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,324
Website Mastodon

Re: Admin Side Theming! (r3149)

Sorry, no idea. “I’m a PC, you’re a Mac”. Wrong religion…

Offline

Board footer

Powered by FluxBB