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
-
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
-
Untested but should work;
Open include/init.inc.php, and find;
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;
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.
-
worked perfedtly, thanks :D
:water
-
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:
$referer = 'index.php
replace with:
$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