coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: triangular on November 17, 2005, 02:14:59 PM

Title: Users cannot change themes
Post by: triangular on November 17, 2005, 02:14:59 PM
If I log into the Admin account, I can set the theme that everyone will see if I do it from the configs panel. However, I have enabled the theme list and if I'm not logged in as Admin (if I'm any visiter to the gallery) and I attempt to change themes from the drop-down list, I only received a page with "an unexpected error...parse error...". I think others have seen this. I have run accross a few suggestions to fix this but have not found my solution. Changing the theme system wide from the config panel does not produce an error for any theme chosen, and displays correctly for all, but trying to switch the themes outside the config panel always produces the same error.

Thank you,

Christian
Title: Re: Users cannot change themes
Post by: Stramm on November 17, 2005, 03:45:04 PM
post a link please
Title: Re: Users cannot change themes
Post by: triangular on November 17, 2005, 04:10:12 PM
Sure. You can check it out right here: http://gallery.myadventurouslife.com/
Title: Re: Users cannot change themes
Post by: Stramm on November 17, 2005, 04:42:28 PM
I've never had php running as a cgi... can't give you an advice. Switching to the Apache module would solve your probs I guess
Title: Re: Users cannot change themes
Post by: triangular on November 17, 2005, 04:57:46 PM
Sorry, I'm really new at this. Switching to Apache mode, is that something I have to do system wide on my site, or per MySQL database, or what? I'm not sure where I find this flag. Can you give me a hint about this?
Title: Re: Users cannot change themes
Post by: Abbas Ali on November 17, 2005, 05:00:50 PM
Try this (Not sure whether this will work for you or not, just a wild guess ;) )

Edit include/functions.inc.php

Replace (in function themeSelect)


$cpgCurrentTheme = $_SERVER["SCRIPT_NAME"]."?";


with


$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
foreach ($possibilities as $test){
if (isset($_SERVER[$test]) && preg_match('/([^\/]+\.php)$/', $_SERVER[$test], $matches)){
$PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $matches[1];
break;
}
$PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = '';
}
// get the current theme
//get the url and all vars except $theme
$cpgCurrentTheme = $PHP_SELF."?";


Thanks to Nibbler for above code.

Abbas
Title: Re: Users cannot change themes
Post by: triangular on November 17, 2005, 05:31:50 PM
Abbas, thank you very much. I'm very impressed, because that worked beautifully! Find>Replace>No Fuss! I am not a php coder, and now it's even more mysterious, but there must be a magic in there somewhere. Again, thank you...seriously!

Christian