Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: different themes for anon & loggid in users?  (Read 3843 times)

0 Members and 1 Guest are viewing this topic.

water

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
[Solved]: different themes for anon & loggid in users?
« 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
« Last Edit: August 02, 2004, 09:07:24 am by GauGau »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: different themes for anon & loggid in users?
« Reply #1 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

water

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: different themes for anon & loggid in users?
« Reply #2 on: August 02, 2004, 07:51:11 am »

worked perfedtly, thanks  :D

:water

artistsinhawaii

  • VIP
  • Coppermine addict
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 856
    • evj art and photography
Re: [Solved]: different themes for anon & loggid in users?
« Reply #3 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
Logged
Learn and live ... In January of 2011, after a botched stent attempt, the doctors told me I needed a multiple bypass surgery or I could die.  I told them I needed new doctors.
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 20 queries.