forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: UnluckyAlf on September 24, 2005, 10:10:53 pm

Title: Different themes for registered users and guests
Post by: UnluckyAlf on September 24, 2005, 10:10:53 pm
I'm looking to have different themes for registered users and guests (non-registered users).  My Coppermine is integrated with phpBB and uses that memberlist and usergroups, I've removed the facility for guests to register.

I want guests to come from a another site I have and only have limited viewing and a different banner graphic.

I've tried using this in include/init.inc.php:
http://forum.coppermine-gallery.net/index.php?topic=8449.0

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

if (!file_exists("themes/{$CONFIG['theme']}/theme.php")) $CONFIG['theme'] = 'guests';
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'];
}
}

I've created a new theme called guests, which is a copy of subsilver but with a different banner graphic and the links don't go back to index.php but to my user gallery.  The files amended are theme.php and template.html.

Any help would be appreciated, thanks, Alf.
Title: Re: Different themes for registered users and guests
Post by: UnluckyAlf on September 25, 2005, 12:36:18 pm
I think I have it working now.
Code: [Select]
if (USER_ID) {
$theme='subsilver';
      require "themes/subsilver/theme.php";
      $THEME_DIR = "themes/subsilver/";
} else {

$theme='guests';
      require "themes/guests/theme.php";
      $THEME_DIR = "themes/guests/";

// 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'];
}
}
Cheers, Alf.