Users cannot change themes Users cannot change themes
 

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

Main Menu

Users cannot change themes

Started by triangular, November 17, 2005, 02:14:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

triangular

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

Stramm


triangular


Stramm

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

triangular

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?

Abbas Ali

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
Chief Geek at Ranium Systems

triangular

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