Welcome to Geeklog, Anonymous Monday, December 05 2022 @ 06:32 am EST

Geeklog Forums

Why doesn't this work?


Status: offline

Jefficus

Forum User
Chatty
Registered: 05/26/04
Posts: 59
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:
Text Formatted Code
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?
This has been an opinion, brought to you by the fine people at Jefficus World.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
I'm curious why you would just not set your preferred theme in your account preferences?
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Jefficus

Forum User
Chatty
Registered: 05/26/04
Posts: 59
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.
This has been an opinion, brought to you by the fine people at Jefficus World.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.

Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Jefficus

Forum User
Chatty
Registered: 05/26/04
Posts: 59
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.
This has been an opinion, brought to you by the fine people at Jefficus World.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Jefficus

Forum User
Chatty
Registered: 05/26/04
Posts: 59
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.
This has been an opinion, brought to you by the fine people at Jefficus World.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.
Geeklog components by PortalParts -- www.portalparts.com
 Quote

Status: offline

Euan

Forum User
Full Member
Registered: 04/22/02
Posts: 292
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.

-- Heather Engineering
-- No job too small
 Quote

Santorres

Anonymous
worried


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.....
 Quote

ironmax

Anonymous
Quote by Santorres: Can you explain me how to do it. I would like everyone to see al the same theme.



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

All times are EST. The time is now 06:32 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content