Author |
Message |
ThePiston
Worker


Joined: Dec 22, 2004
Posts: 135
|
Posted:
Mon Oct 03, 2005 12:52 pm |
|
For come reason my users' custom theme is not working in the "Your Account" module only... works in all others. I just upgraded from 76v2.8 to 76v3.1. Anyone have any ideas? |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Mon Oct 03, 2005 1:56 pm |
|
It would help if you would explain what my users' custom theme is not working in the "Your Account" module only means  |
|
|
|
 |
ThePiston

|
Posted:
Mon Oct 03, 2005 2:49 pm |
|
I have only 2 themes on my site... XP-Olive is for the visitors and I set all of the members to XP-Silver. This way you know when you are logged in and when you are not because of the color change. This worked perfectly in v2.8 but after the 3.1 patch - it still works, but not in the "Your Account" module. It stays in the default "XP-Olive" theme even though I am logged in as a user who's custom theme is XP-Silver. Anything having to do with the "Your Account" module, (even logging out of admin) shows the site's default Olive theme. There must be something in the index file that is preventing the custom theme from showing up? |
|
|
|
 |
chatserv
Member Emeritus

Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Mon Oct 03, 2005 7:59 pm |
|
Post your get_theme function from mainfile.php |
|
|
|
 |
ThePiston

|
Posted:
Mon Oct 03, 2005 8:37 pm |
|
this is directly from the 3.1 mainfile.phpCode:function get_theme() {
global $user, $userinfo, $Default_Theme, $name, $op;
if (isset($ThemeSelSave)) return $ThemeSelSave;
if(is_user($user) && ($name != "Your_Account" && $op != "logout")) {
getusrinfo($user);
if(empty($userinfo['theme'])) $userinfo['theme']=$Default_Theme;
if(file_exists("themes/".$userinfo['theme']."/theme.php")) {
$ThemeSel = $userinfo['theme'];
} else {
$ThemeSel = $Default_Theme;
}
} else {
$ThemeSel = $Default_Theme;
}
static $ThemeSelSave;
$ThemeSelSave = $ThemeSel;
return $ThemeSelSave;
}
|
|
Last edited by ThePiston on Mon Oct 03, 2005 8:40 pm; edited 1 time in total |
|
|
 |
Raven

|
Posted:
Mon Oct 03, 2005 8:39 pm |
|
That code goes in mainfile.php not Your_Account/index.php. It would kill the page because you are redeclaring the function which PHP does NOT allow. |
|
|
|
 |
ThePiston

|
Posted:
Mon Oct 03, 2005 8:41 pm |
|
yeah, caught that.... oops. I thought he meant post the code to the account/index file. I took it out and posted it above. noob, sorry |
|
|
|
 |
chatserv

|
Posted:
Mon Oct 03, 2005 9:43 pm |
|
If using GT NextGen change the get_theme function to:
Code:function get_theme() {
global $user, $userinfo, $Default_Theme, $name, $op;
$queryString = strtolower($_SERVER['QUERY_STRING']);
if(is_user($user) && ($name != "Your_Account" && ($op != "logout" || stripos_clone($queryString,'logout')))) {
if (isset($ThemeSelSave)) return $ThemeSelSave;
$user2 = base64_decode($user);
$user2 = addslashes($user2);
$t_cookie = explode(":", $user2);
if(empty($t_cookie[9])) $t_cookie[9]=$Default_Theme;
if(file_exists("themes/".$t_cookie[9]."/theme.php")) {
$ThemeSel = $t_cookie[9];
} else {
$ThemeSel = $Default_Theme;
}
} else {
$ThemeSel = $Default_Theme;
}
static $ThemeSelSave;
$ThemeSelSave = $ThemeSel;
return $ThemeSelSave;
}
|
else change it to:
Code:function get_theme() {
global $user, $userinfo, $Default_Theme, $name, $op;
if(is_user($user) && ($name != "Your_Account" OR $op != "logout")) {
if (isset($ThemeSelSave)) return $ThemeSelSave;
$user2 = base64_decode($user);
$user2 = addslashes($user2);
$t_cookie = explode(":", $user2);
if(empty($t_cookie[9])) $t_cookie[9]=$Default_Theme;
if(file_exists("themes/".$t_cookie[9]."/theme.php")) {
$ThemeSel = $t_cookie[9];
} else {
$ThemeSel = $Default_Theme;
}
} else {
$ThemeSel = $Default_Theme;
}
static $ThemeSelSave;
$ThemeSelSave = $ThemeSel;
return $ThemeSelSave;
}
|
|
Last edited by chatserv on Mon Oct 03, 2005 11:35 pm; edited 1 time in total |
|
|
 |
ThePiston

|
Posted:
Mon Oct 03, 2005 11:07 pm |
|
sorry Chat, neither one worked. thanks for trying though. |
|
|
|
 |
chatserv

|
Posted:
Mon Oct 03, 2005 11:20 pm |
|
Retry the second code, i updated it after testing it on a site without GT. |
|
|
|
 |
ThePiston

|
Posted:
Tue Oct 04, 2005 7:43 am |
|
holy crap it worked... thank yo uso much, that was starting to drive me nuts... whoo hoo |
|
|
|
 |
chatserv

|
Posted:
Tue Oct 04, 2005 8:08 am |
|
|
|
 |
Raven

|
Posted:
Wed Mar 08, 2006 8:29 am |
|
This has been fixed in RavenNuke76 v2.02.02 CVS w/o checking the module name. That should not need to be done - it's too restrictive. These should be universal modules/code. |
|
|
|
 |
|