Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    14
    Plugin Contributions
    0

    Default Side Box anywhere HELP please

    Hi All,

    I have been trying to get the add on Sidebox anywhere to work, i can call the php file single_box from inside zc and it work

    However the file that i use to call it from outside zencart doesnt call it.

    I have tried everything, i really need help with this, followed all threads and instructions on it, cant work out why its doesnt work.

    Is it some security control issue or something else? Please help

    This below is call_my_sidebox.php

    <?php
    $zcSBmodule = 'whats_new.php';

    $zcSBlayout = 'left';

    define('DIR_WS_IMAGES', 'http://www.cgautoupholstery.com/public_html/cart/images/');

    require ("http://www.cgautoupholstery.com/public_html/cart/single_sidebox.php");


    ?>
    And below is single_box php

    <?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 ("path/to/zencart/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);
    ?>

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Side Box anywhere HELP please

    Set the full path to your application_top.php file for:
    Code:
    require('includes/application_top.php');
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Dec 2010
    Posts
    14
    Plugin Contributions
    0

    Default Re: Side Box anywhere HELP please

    Hi Ajeh,

    Thank you for your reply,

    I have tried that several times, i have changed it to -


    Still not working and now when i call the file single_sidebox.php inside zencart it doesnt work there either

    Calling the file call_my_sidebox.php doesnt not working either

    Must be a reason, i have tried simple php codes outside of zencart to make sure php works outside of zencart..which it does

    Im not that savvy with php coding but willing to try anything to get it to work, i tried yesterday for around 5 hours

    Do you have any other ideas as to why

  4. #4
    Join Date
    Dec 2010
    Posts
    14
    Plugin Contributions
    0

    Default Re: Side Box anywhere HELP please

    oops that quote didnt work however i changed it to full path and yes not working

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Side Box anywhere HELP please

    You need the path to your home directory such as:
    Code:
      require('/home/yourusername/public_html/yourdirectory_ifused/includes/application_top.php');
    Look in your file:
    /includes/configure.php

    and you will see defined for:
    DIR_FS_CATALOG
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Dec 2010
    Posts
    14
    Plugin Contributions
    0

    Default Re: Side Box anywhere HELP please



    Thank you thank you thank you Ajeh

    Its working, i was following the wrong path, hopefully this post will help others that may need it!

 

 

Similar Threads

  1. v151 Help re-sizing my side box...pretty please!
    By PearceStephens in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Nov 2012, 02:19 PM
  2. Can't Get Side Box Anywhere to work
    By tracib in forum Addon Sideboxes
    Replies: 9
    Last Post: 9 Jan 2012, 08:50 PM
  3. Blank SIde BOx Problem Please help
    By jeffhardy in forum General Questions
    Replies: 0
    Last Post: 16 Oct 2008, 12:57 PM
  4. Side Box Anywhere mod
    By sjemms in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 1 Feb 2008, 07:42 AM
  5. Side Box Anywhere & Specials
    By sjemms in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 30 Dec 2007, 12:41 PM

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