Thread: blank sidebox

Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Join Date
    Nov 2007
    Posts
    7
    Plugin Contributions
    0

    Default blank sidebox

    Hi

    Im using the blank sidebox mod. I want to put this PHP into my sidebox and in one of my divs but i cant! Anyone have any ideas?

    Cheers

    PHP Code:
    <?php
        $header_cart 
    "<div id='header_cart'>"
      if (
    $_SESSION['cart']->count_contents() > 0) {
      
    $header_cart .= '<ul>' "n";
        
    $products $_SESSION['cart']->get_products();
        for (
    $i=0$n=sizeof($products); $i<$n$i++) {
          
    $header_cart .= '<li>';

          if ((
    $_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $header_cart .= '<span class="cartNewItem">';
          } else {
            
    $header_cart .= '<span class="cartOldItem">';
          }

          
    $header_cart .= $products[$i]['quantity'] . BOX_SHOPPING_CART_DIVIDER '</span><a class="font_green" href="' 

    zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' $products[$i]['id']) . '">';

          if ((
    $_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $header_cart .= '<span class="cartNewItem">';
          } else {
            
    $header_cart .= '<span class="cartOldItem">';
          }

          
    $header_cart .= $products[$i]['name'] . '</span></a></li>' "n";

          if ((
    $_SESSION['new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            
    $_SESSION['new_products_id_in_cart'] = '';
          }
        }
        
    $header_cart .= '</ul>' "n";
      } else {
        
    $header_cart .= '<div id="cartBoxEmpty">' BOX_SHOPPING_CART_EMPTY '</div>';
      }

      if (
    $_SESSION['cart']->count_contents() > 0) {
        
    $header_cart .= '<hr />';
        
    $header_cart .= '<div class="cartBoxTotal">' $currencies->format($_SESSION['cart']->show_total()) . '</div>';
    //    $header_cart .= '<br class="clearBoth" />';
      
    }

    $header_cart .= "</div>";
    echo 
    $header_cart;  ?>

  2. #2
    Join Date
    Jun 2005
    Location
    Cheney WA
    Posts
    1,134
    Plugin Contributions
    0

    Default Re: blank sidebox

    You're saying that you can't, what happens when you try it?

    Make sure you're in source code mode when working with the editor.

  3. #3
    Join Date
    Nov 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: blank sidebox

    Thankyou for replying.

    I am editing tpl_blank_sidebox.php in macromedia dreamweaver. My file is edited as below and i keep getting an unexpected t_string on line 108.

    PHP Code:
    <?php
    /**
     * blank sidebox - allows a blank sidebox to be added to your site
     *
     * @package templateSystem
     * @copyright 2007 Kuroi Web Design
      * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: blank_sidebox.php 2007-05-26 kuroi $
     */

      
    $content '';
      
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">';

      
    // Replace the text and HTML tags between the apostophes on lines 19 and 20.
      // Use as many or as few lines using this model as you need for your custom content.
      // If you have a multilingual site define your text in the languages/YOUR_LANGUAGE/extra_definitions/blank_sidebox_defines.php and include it as shown in line 19.
      // If your site is monolingual, you can put the text right here as shown on line 20 (and nobody will know!)
      
    $content .= '';
      
    $content .= '
    <head>
    <style type="text/css">

    body {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:10px;
    }

    h1 {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:16px;
    }

    p {
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:10px;
    }

    #sidecont{
    width:190px;
    margin:0px;
    }

    #cathed{
    height:25px;
    margin:auto;
    background:url(http://computech-pcs.co.uk/images/t6.gif);
    width:190px;
    }

    #splitter {
    border-left:1px solid #CCCCCC;
    border-right:1px solid #CCCCCC;
    height:5px;
    }

    #catcont {
    border-left:1px solid #CCCCCC;
    border-right:1px solid #CCCCCC;
    }

    #footer {
    border-left:1px solid #CCCCCC;
    border-right:1px solid #CCCCCC;
    background-color:#336699;
    height:2px;
    }

    #contholder {
    margin:auto;
    width:150px;
    border-bottom:1px dashed #CCCCCC;
    padding:5px;
    }

    #cattitle {
    margin-top:8px;
    border-left:1px solid #CCCCCC;
    border-right:1px solid #CCCCCC;
    }

    #cathed2{
    height:25px;
    margin:auto;
    background:url(http://computech-pcs.co.uk/images/t6.gif);
    width:190px;
    }

    .count {
    color:#FF6600;
    }



    </style>
    </head>

    <body>

    <div id="sidecont">
        <div id="cathed"></div>
        <div id="splitter"></div>
        <div id="catcont">
            <div id="contholder"><table width="150" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
        <?php
        $header_cart = "<div id='
    header_cart'>"; 
      if ($_SESSION['
    cart']->count_contents() > 0) {
      $header_cart .= '
    <ul>' . "n";
        $products = $_SESSION['
    cart']->get_products();
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          $header_cart .= '
    <li>';

          if (($_SESSION['
    new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            $header_cart .= '
    <span class="cartNewItem">';
          } else {
            $header_cart .= '
    <span class="cartOldItem">';
          }

          $header_cart .= $products[$i]['
    quantity'] . BOX_SHOPPING_CART_DIVIDER . '</span><class="font_green" href="' 

    . zen_href_link(zen_get_info_page(
    $products[$i]['id']), 'products_id=' . $products[$i]['id']) . '">';

          if (($_SESSION['
    new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            $header_cart .= '
    <span class="cartNewItem">';
          } else {
            $header_cart .= '
    <span class="cartOldItem">';
          }

          $header_cart .= $products[$i]['
    name'] . '</span></a></li>' . "n";

          if (($_SESSION['
    new_products_id_in_cart']) && ($_SESSION['new_products_id_in_cart'] == $products[$i]['id'])) {
            $_SESSION['
    new_products_id_in_cart'] = '';
          }
        }
        $header_cart .= '
    </ul>' . "n";
      } else {
        $header_cart .= '
    <div id="cartBoxEmpty">' . BOX_SHOPPING_CART_EMPTY . '</div>';
      }

      if ($_SESSION['
    cart']->count_contents() > 0) {
        $header_cart .= '
    <hr />';
        $header_cart .= '
    <div class="cartBoxTotal">' . $currencies->format($_SESSION['cart']->show_total()) . '</div>';
    //    $header_cart .= '
    <br class="clearBoth" />';
      }

    $header_cart .= "</div>";
    echo $header_cart;  ?>
        </td>
      </tr>
     
     </table></div>


    </div>
        
        <div id="splitter"></div>
        <div id="footer"></div>
    </div>

    </body>
    </html>
    '
    ;

      
    $content .= '</div>';
    ?>

  4. #4
    Join Date
    Nov 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: blank sidebox

    come on someone must have a solution for this i have seen php in loads of these mods

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: blank sidebox

    Your PHP code is basically just a clone of the standard Zen Cart shopping cart sidebox with the gift vouchers code left out. If that's the only change you want to make, why not just comment out that code in the standard box?

    The only other significant difference that I could see was that you have replaced the "\n" (new lines for formating your HTML) with "n" which will appear as output on your on your visitors' screens.

    Why doesn't what you've done work? That's because your <?php tag that tells your server that this is where the PHP begins, is part of a string and therefore not recognised. You need a single apostrophe immediately before it to terminate the string and then a semi-colon to end that assignment, before you start your PHP.

    Then you would need to make all the assignments within your PHP to $contents and not $header_cart, though you could just concatonate the two instead of echoing $header_cart (which is premature for a sidebox).

    I've no idea why you're trying to put all this into a singe-celled table. That's just unnecessary, inflexible, makes for poor accessibility and will complicate future maintenance or changes.

    Then you need to get those header and body tag pairs out. You've clearly just copied a whole page from Dreamweaver, but your Zen Cart page will already have those page-level tag pairs, adding another set in a sidebox will break your page.

    Finally, all that CSS, some of which isn't relevant to the HTML that you're generating, but which will affect the rest of your site, should be removed to an external stylesheet which, with the right naming convention, can simply be placed in your template's css folder and it will be loaded automatically and correctly.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #6
    Join Date
    Nov 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: blank sidebox

    Its cuz i want my own image for the sidebox header i cannot do this without using the blank sidebox mod.

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: blank sidebox

    FAQ entry for using your own images for sidebox headers. Or if that's not exactly what you want, this FAQ entry, although for footers, would work equally well for headers
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Nov 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: blank sidebox

    Hi thanks for trying to help but i want a different image for each sidebox not just for left and right.

  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: blank sidebox

    Then you would simply use the specific CSS IDs for each of the sideboxes rather than the generic classes for the all the right and left boxes ......
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Nov 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: blank sidebox

    ok, what is the css id's for...

    catergories
    sponsors
    new products
    and shopping cart

    cheers

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v150 Blank Sidebox Blank Page after adding code for livechat software
    By whatisthat456 in forum Basic Configuration
    Replies: 8
    Last Post: 3 May 2012, 10:40 AM
  2. Blank Sidebox, no borders or header, just blank
    By chris32882 in forum General Questions
    Replies: 16
    Last Post: 3 Dec 2009, 06:22 PM
  3. Flash hack&blank sidebox = blank page
    By AmandaGero in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Apr 2009, 06:19 PM
  4. Blank Sidebox
    By Sturmgeschutz in forum Basic Configuration
    Replies: 2
    Last Post: 28 Sep 2008, 04:24 PM
  5. Blank Sidebox Mod - remove a blank sidebox
    By PJD in forum Basic Configuration
    Replies: 4
    Last Post: 14 Mar 2008, 02:09 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR