Page 1 of 7 123 ... LastLast
Results 1 to 10 of 63
  1. #1
    Join Date
    Aug 2007
    Location
    UK
    Posts
    66
    Plugin Contributions
    0

    Default Sidebox Anywhere mod - Please Help

    I downloaded the Searchbox Anywhere mod and installed it yesterday.

    The instructions seem to be a little vague to me. Can anuone help me get this onto a page and in working order too please.

    Code:
    USAGE INSTRUCTIONS:
     *   1. Upload this single_sidebox.php file to the same folder as your Zen Cart files.
     *   2. On a PHP page where you desire to show Zen Cart sidebox content, insert the following code:
     *        $zcSBmodule = 'name.php';  // name of sidebox or centerbox to be displayed (see filenames in the /includes/modules/sideboxes folder) (if not set, uses "whats_new.php")
     *        $zcSBlayout = 'left';      // 'left' or 'right' sidebox template style (if not specified, uses 'left')
     *        require ("path/to/zencart/single_sidebox.php");
    Now can someone tell me what format the require ("path/to/etc should be?

    Also when I put it into a page all that is displayed is the text quoted above.

    Could someone help with the correct coding to have this displaying correctly?
    The pages I am looking to insert this too are all similar. The code ends and thats where i want this box displayed then, at the end of the page.

    Also would it be possible to have this displayed using HTML or BBC for use in forum boards and as part of an affiliate programme?

    Thanks
    Rob

  2. #2
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Sidebox Anywhere mod - Please Help

    Haven't installed this Mod myself, but your 'path/to/etc' would probably be something like:

    includes/templates/tjrwatches/sideboxes/single_sidebox.php

    If you haven't one already, you will need to create the 'sideboxes' dir.

    You cannot use BBC code but should be no problems with HTML.

  3. #3
    Join Date
    Aug 2007
    Location
    UK
    Posts
    66
    Plugin Contributions
    0

    Default Re: Sidebox Anywhere mod - Please Help

    Thanks for the reply.

    But how do I then insert it into a page so that it displays correctly?

    EDITED TO ADD: I have added the whole file so you can see what i have missed (no doubt i have missed alot :$)

    Code:
    <?php
    /**
     * single_sidebox.php used to display a Zen Cart sidebox on some external resource
     *
     * @package general
     * @copyright Copyright 2003-2008 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: single_sidebox.php 2008-01-03 01:01:18Z drbyte $
     */
    /*
     *   USAGE INSTRUCTIONS:
     *   1. Upload this single_sidebox.php file to the same folder as your Zen Cart files.
     *   2. On a PHP page where you desire to show Zen Cart sidebox content, insert the following code:
     *        $zcSBmodule = 'name.php';  // name of sidebox or centerbox to be displayed (see filenames in the /includes/modules/sideboxes folder) (if not set, uses "whats_new.php")
     *        $zcSBlayout = 'left';      // 'left' or 'right' sidebox template style (if not specified, uses 'left')
     *        require ("includes/templates/tjrwatches/sideboxes/single_sidebox.php");
     *
     *
     *   DEFAULTS:
     *   $zcSBmodule = (if not set, uses "whats_new.php")
     *   $zcSBlayout = (optional) (if not specified, uses 'left')
     *   $zcSBwidth  = (optional) If not specified, uses Zen Cart store defaults
     *
    */
    /******************** SINGLE_SIDEBOX.PHP SCRIPT CODE ********************/
    /*
     * Determine working directory
     */
      $startingDir = getcwd();
      $zcDir = realpath(dirname(__FILE__));
      chdir($zcDir);
    	define('STRICT_ERROR_REPORTING', false);
    /*
     * Set default image dir, which overrides the usual Zen Cart settings in case the working dir is not the same
     */
    //  define('DIR_WS_IMAGES', $zcDir . '/images/');
    /**
     * Load common library stuff 
     */
      require('includes/application_top.php');
    
     /**
      *   module and layout determination
    	*/
      if (!isset($zcSBmodule)) $zcSBmodule = (isset($_GET['module'])) ? zen_db_input($_GET['module']) : 'whats_new.php';
      if (!isset($zcSBcolumn)) $zcSBcolumn = (isset($_GET['layout'])) ? zen_db_input($_GET['layout']) : 'left';
      if (!isset($zcSBwidth)) $zcSBwidth  = (isset($_GET['width'])) ? zen_db_input($_GET['width']) : 0;
      if (substr($zcSBmodule, -4) != '.php') $zcSBmodule .= '.php';
      $column_width = (int)$zcSBwidth;
      if ($column_width == 0) $column_width = ($zcSBcolumn == 'right') ? COLUMN_WIDTH_RIGHT : COLUMN_WIDTH_LEFT;
      $column_box_default = ($zcSBcolumn == 'right') ? 'tpl_box_default_right.php' : 'tpl_box_default_left.php';
    
    /**
     * Load required functions and processing to generate the output:
     */
      $language_page_directory = DIR_WS_LANGUAGES . $_SESSION['language'] . '/';
      $box_id = zen_get_box_id($zcSBmodule);
    /**
     * Cycle through possible override options, first for sideboxes, and then for modules if no matching sidebox found
     */
      $paths_to_try = array();
      $paths_to_try[] = DIR_WS_MODULES . 'sideboxes/' . $template_dir . '/' . $zcSBmodule;
      $paths_to_try[] = DIR_WS_MODULES . 'sideboxes/' . $zcSBmodule;
      $paths_to_try[] = DIR_WS_MODULES . $template_dir . '/' . $zcSBmodule;
      $paths_to_try[] = DIR_WS_MODULES . $zcSBmodule;
      $found_object = false;
      for ($i=0, $n=sizeof($paths_to_try); $i < $n; $i++) {
        if ( file_exists($zcDir . '/' . $paths_to_try[$i]) ) {
          $found_object = true;
          require($paths_to_try[$i]);
          break;
        }
      }
    /**
     * If nothing found yet, assume regular template
     */
      if (!$found_object && file_exists($template->get_template_dir($zcSBmodule, DIR_WS_TEMPLATE, 'index', 'templates') . '/' . $zcSBmodule)) {
        require($template->get_template_dir($zcSBmodule, DIR_WS_TEMPLATE, 'index', 'templates') . '/' . $zcSBmodule);
      } else if (isset($list_box_contents) && is_array($list_box_contents)) {
        require($template->get_template_dir('tpl_columnar_display.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_columnar_display.php');
      }
    /**
     * Load general code which runs before page closes
     */
      require(DIR_WS_INCLUDES . 'application_bottom.php'); 
      chdir($startingDir);
    ?>
    Last edited by TJR Stores; 7 Jan 2008 at 02:04 PM.

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Sidebox Anywhere mod - Please Help

    For output of desired Text, create a file (example: zcSidebox.php) and upload it here:
    /includes/modules/sideboxes/zcSidebox.php

    To output the Sidebox on your desired page(s) you insert this code wherever you want, in the other PHP script:

    $zcSBmodule = 'zcSidebox.php';

  5. #5
    Join Date
    Aug 2007
    Location
    UK
    Posts
    66
    Plugin Contributions
    0

    Default Re: Sidebox Anywhere mod - Please Help

    Thank you for the reply.

    What do I put in this new file i created?
    Do I need to put anything in it?

  6. #6
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default Re: Sidebox Anywhere mod - Please Help

    What you put in the other PHP file should include both lines.

    $zcSBmodule = 'zcSidebox.php';
    require("/home/yourID/public_html/includes/templates/tjrwatches/sideboxes/single_sidebox.php");

    In the above example, you would put normal HTML code in the 'zcSidebox.php' file. Do not put in full page code.

    i.e
    Do not put:
    <html
    <head
    <body

    </body
    </html

    Only put in HTML code for what you actually want displayed. Be it a Table, Div, etc.

  7. #7
    Join Date
    Aug 2007
    Location
    UK
    Posts
    66
    Plugin Contributions
    0

    Default Re: Sidebox Anywhere mod - Please Help

    Hi. I am sorry but i am just not understanding anything that you are saying to me.

    You are saying to use

    $zcSBmodule = 'zcSidebox.php';
    require("/home/yourID/public_html/includes/templates/tjrwatches/sideboxes/single_sidebox.php");

    and yet in the file it says...

    On a PHP page where you desire to show Zen Cart sidebox content, insert the following code:
    * $zcSBmodule = 'name.php'; // name of sidebox or centerbox to be displayed (see filenames in the /includes/modules/sideboxes folder) (if not set, uses "whats_new.php")
    * $zcSBlayout = 'left'; // 'left' or 'right' sidebox template style (if not specified, uses 'left')
    * require ("includes/templates/tjrwatches/sideboxes/single_sidebox.php");
    Bolding mine.

    Thats what is confusing me. Also the extra page I had to create.

    The code to use in the other outside file.

    Everything I have tried so far has resulted in just the code being displayed and not the side box as it should do.

    If someone could explain it simply or even crete this mod so it is not so confusing please.

    Thanks
    Rob

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Sidebox Anywhere mod - Please Help

    I'm sure Rob means well. I'm not sure he's taking you entirely in the right direction though. (This mod itself is not a sidebox, which is how he was treating it. It's used to "display" a sidebox's normal content, but not on a usual Zen Cart page.)

    But, more information from you is needed. *Where* are you wanting to use this? On what kind of page?
    This tool is written to be implemented as PHP code, not as an SSI or HTML addon.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Aug 2007
    Location
    UK
    Posts
    66
    Plugin Contributions
    0

    Default Re: Sidebox Anywhere mod - Please Help

    Yes I am sure Rob did mean well and I thank him for trying to help me with this.

    The page would vary as I would like to use this as part of my affiliates so the code would need to be in HTML.

    PLUS...

    I would like to add it into a PHP page. Again the pages will vary.

    It would be better if there was a way to just have a sidebox displayed anywhere I want it too with less hassle. (For those like me that are not good at php)

    If you could tell me exactly what is needed from me for you to help me I can get right onto getting that information.

    Thanks
    Rob

  10. #10
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Sidebox Anywhere mod - Please Help

    Do you have a PHP page where you want to use this?
    If so, where is it?
    Is it a single php file, or is a part of a larger CMS system somewhere on your site?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 7 123 ... LastLast

Similar Threads

  1. SideBox Anywhere Help
    By Ampboy in forum Addon Sideboxes
    Replies: 4
    Last Post: 5 Sep 2011, 07:28 PM
  2. not getting anywhere PLEASE HELP! ! !
    By mindapolis in forum General Questions
    Replies: 9
    Last Post: 14 Dec 2010, 06:34 PM
  3. More than One Sidebox Anywhere Mod
    By HDuane in forum All Other Contributions/Addons
    Replies: 12
    Last Post: 10 Jan 2010, 12:41 AM
  4. Error when calling Sidebox Anywhere Mod
    By Jerry5763837 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 12 Dec 2009, 03:51 AM
  5. Please anybody please help with Scrolling Sidebox Mod. in IE8
    By hcd888 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 2 Oct 2009, 03:42 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