Page 1 of 2 12 LastLast
Results 1 to 10 of 63

Hybrid View

  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
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Sidebox Anywhere mod - Please Help

    You haven't said "where" you intend to use it.
    I have no idea what exactly you're trying to do at this point.

    It's already been stated that the Sidebox Anywhere mod is written to be used on PHP pages, not HTML pages. It is a PHP script. It is called from within existing PHP scripts. A simple PHP "require" command is all that's needed.

    Quote Originally Posted by TJR Stores View Post
    The instructions seem to be a little vague to me.
    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?
    Translation:
    1. Upload the single_sidebox.php file, as instructed, to the same folder as your Zen Cart files. Make no changes to it.

    2. On a PHP page ... ie: one that has a .php extension, (not a .html extension), insert the 3 lines of code shown. Usually this would be an existing PHP page on your site.

    3. the "path/to/zencart/" would be the server's filesystem path to your Zen Cart store, such as /home/yourname/public_html/store/

    Quote Originally Posted by TJR Stores View Post
    Can anuone help me get this onto a page and in working order too please.
    Sure.
    1. Upload single_sidebox.php as instructed.
    2. Create a call_my_sidebox.php file in your /public_html/ folder.
    3. Put this in it, making appropriate edits to suit your server:
    Code:
    <?php
      $zcSBmodule = 'whats_new.php';
      $zcSBlayout = 'left';
      require ("/home/tjrstores_user_name/public_html/zencart/single_sidebox.php");
    ?>
    4. Run the file in your browser: www.tjrstores.com/call_my_sidebox.php
    Your Zen Cart whats-new sidebox content will show up in the browser.
    .

    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.

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

    Default Re: Sidebox Anywhere mod - Please Help

    Thank you fr the clear instruction.

    Maybe a slight update to the file in the downloads section to avoind this in future could be a good idea..?

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

    Default Re: Sidebox Anywhere mod - Please Help

    OK I got it working on its own separate page, thank you DrByte for that.

    My question is what code do I need to insert it in this section of the page...

    Code:
      <div align="center"><a href="rss_feed.php"><img src="themes/<?=$setts['default_theme'];?>/img/system/rss.gif" border="0" alt="" align="absmiddle"></a></div>
    HERE IS WHERE I WANT TO INSERT THE SIDEBOX
          <div><img src="themes/<?=$setts['default_theme'];?>/img/pixel.gif" width="180" height="1"></div></td>
       <td width="100%">
    This piece of code is related to this website www.iwacstores.com/testsite/index.php

    and will place it under the RSS Auctions image on the left hand side.

    BUT I also would need to know if the code used would be suitable to use on any page, as most are similar to this one.

    Thanks
    Rob

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

    Default Re: Sidebox Anywhere mod - Please Help

    Wouldn't let me edit the post for some reason..

    would like to add in http://www.tjrstores.com/new_stock.php which is the link to how the side box is displayed.

 

 
Page 1 of 2 12 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