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

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Posts
    6
    Plugin Contributions
    0

    Default More than One Sidebox Anywhere Mod

    When I attempt to place more than one ZC sidebox in a non-ZC page using Sidebox Anywhere, only the first one shows up. Is it possible to use the same single_sidebox.php file for more than one sidebox? Could I possibly be looking at a PHP issue instead?

    Thanks for any help,

    Duane

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

    Default Re: More than One Sidebox Anywhere Mod

    I expect you would have to clone all the single_sidebox.php files into single_sidebox2.php and related filenames etc., along with defines and possibly sql queries... There are other threads about cloning sideboxes, and the steps are probably applicable to your case.

  3. #3
    Join Date
    Dec 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: More than One Sidebox Anywhere Mod

    Quote Originally Posted by gjh42 View Post
    I expect you would have to clone all the single_sidebox.php files into single_sidebox2.php and related filenames etc., along with defines and possibly sql queries... There are other threads about cloning sideboxes, and the steps are probably applicable to your case.
    This was my plan "b." Thanks for your direction.

    Duane

  4. #4
    Join Date
    Dec 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: More than One Sidebox Anywhere Mod

    Quote Originally Posted by gjh42 View Post
    I expect you would have to clone all the single_sidebox.php files into single_sidebox2.php and related filenames etc., along with defines and possibly sql queries... There are other threads about cloning sideboxes, and the steps are probably applicable to your case.
    Well, Glenn.

    I've cloned single_sidebox.php file into single_sidebox2.php. But it appears that I cannot execute both on the same page. In fact the second one eliminates my footer. I would like the page to include both categories and featured products. Right now it is only executing the categories:

    http://rapicom.net/test.html

    My goal is to have it look like http://rapicom.net.

    My code snippets appear in the left column and underneath the content of the center column. Here they are respectively:

    <?php
    $zcSBmodule = 'ch_categories.php';
    $zcSBlayout = 'left';
    require ("/[REMOVED BY DUANE]/single_sidebox.php");
    ?>

    <?php
    $zcSBmodule = 'featured.php';
    $zcSBlayout = 'left';
    require ("/[REMOVED BY DUANE]/single_sidebox2.php");
    ?>

    I really don't have a firm grasp on executing PHP within a page; so it could be my oversight more than anything else.

    All help is much appreciated,

    Duane

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

    Default Re: More than One Sidebox Anywhere Mod

    You may need to alter these variable names as well to avoid conflicts, both in your page file and in the single_sidebox2 file(s).

    <?php
    $zcSBmodule2 = 'featured.php';
    $zcSBlayout2 = 'left';
    require ("/[REMOVED BY DUANE]/single_sidebox2.php");
    ?>

  6. #6
    Join Date
    Dec 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: More than One Sidebox Anywhere Mod

    Quote Originally Posted by gjh42 View Post
    You may need to alter these variable names as well to avoid conflicts, both in your page file and in the single_sidebox2 file(s).
    Still not working...I've tested my changes with the sidebox2 alone and it worked. Here's the changed code on test.html:

    <?php
    $zcSBmodule2 = 'featured.php';
    $zcSBlayout2 = 'left';
    require ("/[REMOVED BY DUANE]/single_sidebox2.php");
    ?>

    Here's the single_sidebox2.php file:

    /******************** SINGLE_SIDEBOX.PHP SCRIPT CODE ********************/
    /*
    * Determine working directory
    */
    $startingDir2 = getcwd();
    $zcDir2 = realpath(dirname(__FILE__));
    chdir($zcDir2);
    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($zcSBmodule2)) $zcSBmodule2 = (isset($_GET['module'])) ? zen_db_input($_GET['module']) : 'whats_new.php';
    if (!isset($zcSBcolumn2)) $zcSBcolumn2 = (isset($_GET['layout'])) ? zen_db_input($_GET['layout']) : 'left';
    if (!isset($zcSBwidth2)) $zcSBwidth2 = (isset($_GET['width'])) ? zen_db_input($_GET['width']) : 0;
    if (substr($zcSBmodule2, -4) != '.php') $zcSBmodule2 .= '.php';
    $column_width = (int)$zcSBwidth2;
    if ($column_width == 0) $column_width = ($zcSBcolumn2 == 'right') ? COLUMN_WIDTH_RIGHT : COLUMN_WIDTH_LEFT;
    $column_box_default = ($zcSBcolumn2 == '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($zcSBmodule2);
    /**
    * 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 . '/' . $zcSBmodule2;
    $paths_to_try[] = DIR_WS_MODULES . 'sideboxes/' . $zcSBmodule2;
    $paths_to_try[] = DIR_WS_MODULES . $template_dir . '/' . $zcSBmodule2;
    $paths_to_try[] = DIR_WS_MODULES . $zcSBmodule2;
    $found_object = false;
    for ($i=0, $n=sizeof($paths_to_try); $i < $n; $i++) {
    if ( file_exists($zcDir2 . '/' . $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($zcSBmodule2, DIR_WS_TEMPLATE, 'index', 'templates') . '/' . $zcSBmodule2)) {
    require($template->get_template_dir($zcSBmodule2, DIR_WS_TEMPLATE, 'index', 'templates') . '/' . $zcSBmodule2);
    } 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);
    ?>

    Thank for the help so far.

    Duane

  7. #7
    Join Date
    Dec 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: More than One Sidebox Anywhere Mod

    Would this thread be better off in a different ZC forum? Should I move it?

    Thanks,

    Duane

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

    Default Re: More than One Sidebox Anywhere Mod

    Quote Originally Posted by HDuane View Post
    When I attempt to place more than one ZC sidebox in a non-ZC page using Sidebox Anywhere, only the first one shows up. Is it possible to use the same single_sidebox.php file for more than one sidebox?
    It wasn't designed with that in mind.
    Having it run a 2nd time will trigger numerous internal duplication problems and thus likely many PHP errors, which probably cause the page to stop drawing at the point where the 2nd box is expected to appear.

    It will have to be fully rewritten to make it show twice on the same page.
    .

    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
    Dec 2009
    Posts
    6
    Plugin Contributions
    0

    Default Re: More than One Sidebox Anywhere Mod

    Quote Originally Posted by DrByte View Post
    It will have to be fully rewritten to make it show twice on the same page.
    Is there any chance of that happening? Or is there another direction I could try?

    Thanks for the insight,

    Duane

  10. #10
    Join Date
    May 2008
    Posts
    261
    Plugin Contributions
    0

    Default Re: More than One Sidebox Anywhere Mod

    Hi,

    Don't you think it is so stupid to delete my post?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Sidebox Anywhere mod - Please Help
    By TJR Stores in forum Addon Sideboxes
    Replies: 62
    Last Post: 28 Dec 2011, 09:19 PM
  2. Error when calling Sidebox Anywhere Mod
    By Jerry5763837 in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 12 Dec 2009, 03:51 AM
  3. Replies: 13
    Last Post: 28 Mar 2008, 11:30 PM
  4. How do I put more than one product in a What's New sidebox?
    By mattkevan in forum Basic Configuration
    Replies: 9
    Last Post: 15 Jul 2007, 02:33 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