Different themes for registered users and guests Different themes for registered users and guests
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Different themes for registered users and guests

Started by UnluckyAlf, September 24, 2005, 10:10:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

UnluckyAlf

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

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.

UnluckyAlf

I think I have it working now.
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.