Results 1 to 10 of 393

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Just to complete the code review please see the add for colors.css

    Code:
    /* Background Layout (Smart Background app - added 12142008)*/
    #logoWrapper { background-image: url(../images/smartbg.jpg); background-repeat: no-repeat; }
    .smartBG_aboutus #logoWrapper { background-image: url(../images/smartbg_aboutus.jpg); background-repeat: no-repeat; }
    
    #navMain.login { background-image: url(../images/topmenubg_login.jpg); background-repeat: no-repeat; }
    #navMain.noLogin { background-image: url(../images/topmenubg.jpg); background-repeat: no-repeat; }
    .smartBG_aboutus #navMain.login { background-image: url(../images/topmenubg_login_aboutus.jpg); background-repeat: no-repeat; }
    .smartBG_aboutus #navMain.noLogin { background-image: url(../images/topmenubg_aboutus.jpg); background-repeat: no-repeat; }
    See also change in code in layout.css
    Code:
    /* Changed logowrapper and move part to colors.css  - smartbackground application */
    #logoWrapper { width: 100%; height: 153px; position: relative; }
    /* end change */

  2. #2
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    OK, found one problem - It is the problem we are having with the use of jpg and gif for our images.

    I just came to the realization that in colors.css we were using jpg for the login/logout images and we should be using gif. So, I corrected that problem and we now have the correct image on the home page etc.

    Corrected login/logout jpg to gif to match image files.
    Code:
    #navMain.login { background-image: url(../images/topmenubg_login.gif); background-repeat: no-repeat; }
    #navMain.noLogin { background-image: url(../images/topmenubg.gif); background-repeat: no-repeat; }
    .smartBG_aboutus #navMain.login { background-image: url(../images/topmenubg_login_aboutus.gif); background-repeat: no-repeat; }
    .smartBG_aboutus #navMain.noLogin { background-image: url(../images/topmenubg_aboutus.gif); background-repeat: no-repeat; }
    However, we still do not see the new images for the about_us page. We get the same images as the home page.

    Sawhorse

  3. #3
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Later I found a similar problem in tpl_main_page.php but no change was seen in image for about_us page. Home page remained unchanged. I changed (about line 92) 'topmenubg_login.jpg' to gif and 'topmenubg.jpg' to gif.

    Corrected login/logout jpg to gif to match image files.
    PHP Code:
        <!-- begin top navigation -->    

    <?php

         
    if (STORE_STATUS == '0' and !$_SESSION['customer_id']) { 

                
    $menubg 'topmenubg_login.gif';

         } else {

                
    $menubg 'topmenubg.gif';

         } 

    ?>

  4. #4
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    While I was on the about_us page using Firebug I saw

    <body id="aboutusBody" class="smartBG"> but the images were not correct for the about_us page.

    Sawhorse

  5. #5
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    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:

    Quote Originally Posted by gjh42 View Post
    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

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Smart Backgrounds support

    You do have the about us image in the right place with the right name:
    /includes/templates/Series_12_Horses/images/smartbg_aboutus.jpg

    so we need to find out why it is not getting that info. Add a debug line to tpl_main_page.php:

    echo 'body: ' . $body_id . ' file search: ' . DIR_WS_TEMPLATE_IMAGES . 'smartbg_' . $current_page_base . '.jpg';

    in this section
    PHP Code:
    } else { //add _ and page base to classname only if page bg image exists
      $smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartbg_' . $current_page_base . '.jpg'))?'_' . $current_page_base:''; //default/home page classname will be just .smartBG, and filename smartbg.jpg
    }// /Smart Backgrounds?>
    <body id="<?php echo $body_id 'Body'?>" class="smartBG<?php echo $smart_image;?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'?>>
    to get this:
    PHP Code:
    } else { //add _ and page base to classname only if page bg image exists
      $smart_image = (file_exists(DIR_WS_TEMPLATE_IMAGES . 'smartbg_' . $current_page_base . '.jpg'))?'_' . $current_page_base:''; //default/home page classname will be just .smartBG, and filename smartbg.jpg
    }
    echo 'body: ' . $body_id . ' file search: ' . DIR_WS_TEMPLATE_IMAGES . 'smartbg_' . $current_page_base . '.jpg';
    // /Smart Backgrounds?>
    <body id="<?php echo $body_id 'Body'?>" class="smartBG<?php echo $smart_image;?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'?>>

  7. #7
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: Smart Backgrounds support

    Yes, I do have the about us image in the right place with the right name:/includes/templates/Series_12_Horses/images/smartbg_aboutus.jpg

    I have added the debug line to tpl_main_page.php

    Sawhorse

    P.S. Now what happens? I have never done this?
    Last edited by Sawhorse; 16 Dec 2008 at 12:59 AM.

 

 

Similar Threads

  1. Adding Image Map to header with Smart Backgrounds
    By cspan27 in forum Addon Templates
    Replies: 16
    Last Post: 25 Jul 2009, 01:14 AM
  2. smart backgrounds
    By Glendon in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 11 Sep 2008, 04:49 PM
  3. Backgrounds
    By v.kirk in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 23 Jun 2006, 06:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg