On an earlier post you suggest.
PHP Code:
<?php if ($_SESSION['customer_id']) {
$menubg = 'topmenubg_';
} else {
if (STORE_STATUS == '0') {
$menubg = 'topmenubg_login_';
} } ?>
<?php //Smart Backgrounds - for foreground logo - 20081212
$smart_image = '';
$unique_ezpages = true;//change to false to not have diff bg for each ezpage
if ($current_page_base == 'index' or $current_page_base == 'product_info') { //change filename to $menubg and top cat id only if cat image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . $menubg . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]) . '.gif'))?$menubg . str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath] . '.gif'):'.gif';
} elseif ($current_page_base == 'page' and $unique_ezpages == true) { //change filename to $menubg_page and ez-page id only if ez-page image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . $menubg . 'page' . $_GET[id] . '.gif'))?$menubg . 'page' . $_GET[id] . '.gif':'.gif';
} else { //change filename to $menubg and pagename only if page image exists
$smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . $menubg . $current_page_base . '.gif'))?$menubg . $current_page_base . '.gif':'.gif'; //default/home page image will be as defined ($menubg.gif)
}// /Smart Backgrounds
$menubg .= $smart_image;?>
Later:

Originally Posted by
gjh42
PHP Code:
<?php if ($_SESSION['customer_id']) {
$menubg = 'topmenubg.jpg';
} else {
if (STORE_STATUS == '0') {
$menubg = 'topmenubg_login.jpg';
} }
?>
I am not sure this logic will always do what you want.
If there is a logged-in customer, you get 'topmenubg.jpg'.
Otherwise if store status is 0 (regular store), you get 'topmenubg_login.jpg'.
If store status is anything else, you get no background image at all.
Try a strict either/or:
PHP Code:
<?php
if (STORE_STATUS == '0' and !$_SESSION['customer_id']) {
$menubg = 'topmenubg_login.jpg';
} else {
$menubg = 'topmenubg.jpg';
}
?>
The only time you want the login bg is if it is a regular store with no logged-in customer.
Now scrap the filenames so the stylesheet can handle all the permutations. Build a class name instead, and add that to the #navMain div:
PHP Code:
<?php
if (STORE_STATUS == '0' and !$_SESSION['customer_id']) {
$menuclass = 'login';
} else {
$menuclass = 'noLogin';
}
?>
<div id="navMain" class="<?php echo $menuclass;?>">
If you look in my tpl_main_page.php (about line 94) you will see that I only have the later code with the change from jpg to gif.
[quote=gjh42;656150][php]
Try a strict either/or:
PHP Code:
<?php
if (STORE_STATUS == '0' and !$_SESSION['customer_id']) {
$menubg = 'topmenubg_login.jpg';
} else {
$menubg = 'topmenubg.jpg';
}
?>
I think maybe we may need to look at this area of the code.
Sawhorse