forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: water on August 01, 2004, 01:56:18 pm

Title: [Solved]: different themes for anon & loggid in users?
Post by: water on August 01, 2004, 01:56:18 pm
i'm considering coppermine for a site where the anon users should see a totally different theme than the logged in users.

is it possible to have different themes for anon & logged in users in coppermine?

:water
Title: Re: different themes for anon & loggid in users?
Post by: Casper on August 01, 2004, 02:57:44 pm
Untested but should work;

Open include/init.inc.php, and find;

Code: [Select]
if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";
// Process language selection if present in URI or in user profile or try
// autodetection if default charset is utf-8
if (!empty($HTTP_GET_VARS['lang'])) {
    $USER['lang'] = $HTTP_GET_VARS['lang'];
}

Replace it with;

Code: [Select]
if (USER_ID) {
 $theme='hardwired';
       require "themes/hardwired/theme.php";
       $THEME_DIR = "themes/hardwired/";
} else {

if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'classic';
require "themes/{$CONFIG['theme']}/theme.php";
$THEME_DIR = "themes/{$CONFIG['theme']}/";
// Process language selection if present in URI or in user profile or try
// autodetection if default charset is utf-8
if (!empty($HTTP_GET_VARS['lang'])) {
    $USER['lang'] = $HTTP_GET_VARS['lang'];
}
}

This will make logged on users see the hardwired theme, and others the default.
Alter this to what you want.
Title: Re: different themes for anon & loggid in users?
Post by: water on August 02, 2004, 07:51:11 am
worked perfedtly, thanks  :D

:water
Title: Re: [Solved]: different themes for anon & loggid in users?
Post by: artistsinhawaii on November 25, 2005, 12:32:23 am
This doesn't seem to work for cpg1.4x, however, there is a simpler fix for 1.4x users.

In login.php and logout.php search for the line:

Quote
$referer = 'index.php

replace with:

Quote
$referer = 'index.php?theme=yourtheme"

Where the theme for the registered/logged in user is different from the logged out user.

I did this for a site where none of the coppermine menus show up unless someone logs in first.
I simply created two identical themes, then removed the  {SYS_MENU} {SUB_MENU}
and {ADMIN_MENU} calls from the logged out theme's template.html.

NOTE: This probably doesn't have to return to index.php, you could probably send it off to some other file in your cpg setup - though I haven't tried that  8). 

Dennis