Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Different themes for registered users and guests  (Read 4158 times)

0 Members and 1 Guest are viewing this topic.

UnluckyAlf

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Different themes for registered users and guests
« 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.
« Last Edit: September 25, 2005, 12:48:44 pm by TranzNDance »
Logged

UnluckyAlf

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Different themes for registered users and guests
« Reply #1 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.