Posted on: 05/30/04 10:10pm
By: Jefficus
I'm working on a little plugin project. Nothing real fancy, but I think some of y'all will find it useful. (Not going to spill the beans until I have a beta.)
I've configured my GL site to not allow user themes. But now I want to be able to have my OWN account show a different theme so that I can play with some theme mods for my plugin.
I tried doing this in {geeklog}/config.php immediately after setting the site's default theme:
if ($_USER['username'] == 'Jefficus') {
$_CONF['theme'] = 'mynewtheme';
}
I am assuming it didn't work because the $_USER stuff hasn't been initialized yet? (I also tried
if ($_USER['uid'] == 2), with similar lack of results.
I then tried both those changes in {geeklog}/system/lib-custom.php. Still no effect. So I'm a bit stumped. Where would I apply such a change to give my account a different theme from everybody else's?
Why doesn't this work?
Posted on: 05/30/04 10:17pm
By: Blaine
I'm curious why you would just not set your preferred theme in your account preferences?
Why doesn't this work?
Posted on: 05/30/04 10:35pm
By: Jefficus
As I mentioned, I've disabled user-specific theme selection for my site. I don't want to re-enable it, because I want my visitors to all see the same style. (Call me a style-Nazi.)
But now I have this need to over-ride that restriction for just myself.
Why doesn't this work?
Posted on: 05/30/04 10:54pm
By: Blaine
Uh, ok - I missed that. I figured it was a dumb question but figured I'd ask anyways
The $_CONF['theme'] looks to be what you want to change. It's set at the top of lib-common around lines 200. Since this is executed after including in config.php, you would have to add that code you noted after this.
Now, lib-custom is a good place - at the top or bottom as that file is included at the end of lib-common so it should over-ride any setting established in lib-common.
At least thats what I'd try without doing any testing myself.
Why doesn't this work?
Posted on: 05/30/04 11:02pm
By: Jefficus
That's what I thought too. It didn't work. That's why I'm confused. I even tried dispensing with the conditional code and just hard setting (in system/lib-custom.php) $_CONF['theme'] = 'gameserver'; to see if it would change. Nope. But it changes just fine if I change the default theme in config.php - so it can't be something weird with caching.
I'm stumped.
Why doesn't this work?
Posted on: 05/30/04 11:09pm
By: Blaine
I wonder - delete your cookie that is used to hold your preferred theme or try a diff browser that does not have this cookie set.
I'd still expect the override code to take effect.
Why doesn't this work?
Posted on: 05/30/04 11:19pm
By: Jefficus
I understand your point, but it's simply not possible for it to be cookie or cache related if making the change in one line of code works, but changing a different file does not. Remember, making the change in config.php where the default is being set, works just fine. I can change the entire site to a different default theme. But I just can't override that default somewhere else.
I'm now of the opinion that I've been staring at it for too long. Time to go watch a movie or something. Tomorrow will bring it's D'oh! forehead slap in short order.
Why doesn't this work?
Posted on: 05/30/04 11:28pm
By: Blaine
Yep, well I was not digging into the code - just tossing out some ideas off the top. I usually solve my most troublesome issues in the morning in less then 5 min
I'm sure you will see it tomorrow.
Why doesn't this work?
Posted on: 05/31/04 09:18am
By: Euan
I may be a little off the mark here as I haven't looked at that code before... but if you are disabling user themes in config.php, are you perhaps hitting some override somewhere? Perhaps you have to find the bit of code where the check against the $_CONF[allow user thems or whatever this variable is called] is set?
Just a thought.
Cheers,
Euan.
Why doesn't this work?
Posted on: 07/25/04 01:00am
By: Anonymous (Santorres)
Jefficus.... As yu mentioned above, you´ve disabled user-specific theme selection for your site. Can you explain me how to do it. I would like everyone to see al the same theme.
I have looked around how to do it, but i have not found any answer. Would oyu explain me please ?
At least if i am not ablle to diable the user selection, i would like to know how can i change the default one ?
Sorry.. im such a newbie
thanx
Santorres.....
Why doesn't this work?
Posted on: 07/25/04 02:31am
By: Anonymous (ironmax)
[QUOTE BY= Santorres] Can you explain me how to do it. I would like everyone to see al the same theme.
[/QUOTE]
If you take a look at the following in your config.php file and look under optional settings...you'll find $_CONF['allow_user_themes'] = 1; Change it to 0 {ZERO}
[QUOTE BY= IronMax]
// +---------------------------------------------------------------------------+
// | SITE SETTINGS |
// | |
// | These settings help define your Geeklog site. |
// +---------------------------------------------------------------------------+
$_CONF['theme'] = 'oscommerce'; // default theme
// you shouldn't need to edit the following
$_CONF['layout_url'] = $_CONF['site_url'] . '/layout/' . $_CONF['theme'];
$_CONF['path_themes'] = $_CONF['path_html'] . 'layout/';
$_CONF['path_layout'] = $_CONF['path_themes'] . $_CONF['theme'] . '/';
// optional settings (1 = on, 0 = off)
$_CONF['allow_user_themes'] = 1;
$_CONF['allow_user_language'] = 1;
$_CONF['allow_user_photo'] = 1; // allow users to upload self-photo
// hides the list of authors from the preferences
$_CONF['hide_author_exclusion'] = 0;
[/QUOTE]