Forums / Addon Sideboxes / I don't get any content using Sidebox Anywhere

I don't get any content using Sidebox Anywhere

Views: 4,163

Results 1 to 20 of 22
11 Oct 2011, 10:16 PM
#1
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

I don't get any content using Sidebox Anywhere

I don't get any output when I use Sidebox Anywhere.

I am on Zen Cart 1.3.8 and Sidebox Anywhere 1.3.8
My php info is at http://www.lynnsfood.com/phpinfolynn.php

both single_sidebox.php and categories_single_sidebox.php are in the root directory of my zen cart store along with index.php,etc. I've posted both of them below. I was using echo to try to see where I was getting in the code.

Here is the single_sidebox.php code:```php

<?php echo "Beginning of Single in LynnsFood" /** * 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 [url]http://www.zen-cart.com/license/2_0.txt[/url] 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']) : 'categories.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); ?>

Here is the calling code in a php file here:
<http://www.lynnsfood.com/categories_single_sidebox.php>

```php
<?php
echo "Top of categories_single_sidebox.php";
$zcSBmodule = "categories.php";
$zcSBlayout = "left";   
require ('single_sidebox.php');
echo "Got to end of single";

/*
 *   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:

 *
 *
 *   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
 *   
*/

?>

http://www.zen-cart.com/forum/showthread.php?t=187145

zen-cart-v1.3.9h

11 Oct 2011, 10:44 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: I don't get any content using Sidebox Anywhere

breauxlg:

I am on Zen Cart 1.3.8 and Sidebox Anywhere
The FIRST and MOST IMPORTANT thing to do before you do ANYTHING else, is upgrade the site to the latest version of Zen Cart.
You should NOT be using v1.3.8 due to the well-published security problems it has.
Plus, v1.3.8 doesn't work on PHP 5.3, which you're running.

.
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.

12 Oct 2011, 3:04 PM
#3
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

Sorry, I am actually on 1.3.9h. I didn't do the version lookup before. I did just now and I am current.

zen-cart-v1.3.9h

12 Oct 2011, 3:56 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: I don't get any content using Sidebox Anywhere

.
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.

12 Oct 2011, 5:54 PM
#5
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

Not getting any debug log in /cache. No zero length files.

zen-cart-v1.3.9h

12 Oct 2011, 5:57 PM
#6
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

I do get the first echo - echo "Top of categories_single_sidebox.php";, so I am at least hitting that php file. I am not getting the echo from the top of the single_sidebox.php file, so I don't know if it's a path thing or what. I just can't figure it out.

zen-cart-v1.3.9h

12 Oct 2011, 6:13 PM
#7
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

If I remove all of the code except the echo from the single_sidebox.php file, I do get the echo and I get the bottom echo from categories_single_sidebox.php. So it doesn't look like a path issue unless the code inside the single_sidebox.php needs for it to be in some folder other than the web root folder.

zen-cart-v1.3.9h

12 Oct 2011, 6:21 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: I don't get any content using Sidebox Anywhere

single-sidebox expects to be located in the same folder as your store's main index.php file.```

  • USAGE INSTRUCTIONS:
    1. Upload this single_sidebox.php file to the same folder as your Zen Cart files.

.
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.

12 Oct 2011, 6:23 PM
#9
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

I can't find out where to enable debugging in 1.3.9h either.

zen-cart-v1.3.9h

12 Oct 2011, 6:24 PM
#10
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

DrByte:

single-sidebox expects to be located in the same folder as your store's main index.php file.```

  • USAGE INSTRUCTIONS:
    1. Upload this single_sidebox.php file to the same folder as your Zen Cart files.

Okay, that's where I have it.

zen-cart-v1.3.9h

12 Oct 2011, 6:31 PM
#11
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

I've write-enabled the /cache folder to allow debugging. Re-tried the single_sidebox.php and still get a blank page and not debugging log.

zen-cart-v1.3.9h

12 Oct 2011, 6:32 PM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: I don't get any content using Sidebox Anywhere

breauxlg:

I can't find out where to enable debugging in 1.3.9h either.
As the article says, it's enabled by default.

But your problems appear to be external to that. You're going to need to test each line to find out where things are breaking.

However, I suspect that what you're after isn't the same as what this tool is designed to give you. I fail to see the purpose in what you're doing in the first place.

.
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.

12 Oct 2011, 6:35 PM
#13
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

I want to be able to put an iFrame on another web site that displays my product categories outside of my Zen Cart site. I have the categories_single_sidebox.php in my site right now for testing, since I could not get it to work from the other site.

zen-cart-v1.3.9h

12 Oct 2011, 7:01 PM
#14
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

OK. When I remove all the code from single_sidebox.php except for the Echo, it runs and finishes. As soon as I add the first line, it hangs. This is what it looks like right now and it hangs:

<?php echo "Beginning of Single in LynnsFood" /* * Determine working directory */ $startingDir = getcwd(); ?>

zen-cart-v1.3.9h

13 Oct 2011, 3:50 AM
#15
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

Got it. Syntax error. Thanks for everything.

zen-cart-v1.3.9h

13 Oct 2011, 4:09 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: I don't get any content using Sidebox Anywhere

Glad you got it sorted out.

.
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.

14 Oct 2011, 10:30 PM
#17
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

DrByte,
Thanks. Now I have another couple of questions I can't find the answer to. The sidebox is showing on my external website in an iframe, but the style is not following from my Zen Cart site. Also, when I click on the category, it opens the Zen Cart category page inside of the iFrame. I'd like to get the style applied in the iFrame and I'd like to open the category page in a new window when clicked. Should I move this question to another thread?
Thanks again,
Lynn

zen-cart-v1.3.9h

15 Oct 2011, 1:43 PM
#18
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

Dr. Byte,
I found this thread with the solution to my style question (http://www.zen-cart.com/forum/showthread.php?t=84792) but there doesn't seem to be an answer to my open link in new page question.
Thanks,
Lynn

zen-cart-v1.3.9h

17 Oct 2011, 2:55 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: I don't get any content using Sidebox Anywhere

You still haven't answered the "why are you doing this?" question I posted earlier.

Since you're doing this in an iFrame, which we always recommend against, anytime someone clicks the link generated by the ZC code, the iframe will simply be updated with the new content based on the link clicked. If you want to change that, you will have to find yourself a way to force the clicked link to "break out" of the frame. You might try googling for javascript tricks that could allow for that.

An additional significant challenge you may run into is that changing any code to allow for this on the Zen Cart side will affect the normal operation of the Zen Cart pages, unless you build additional custom code for the external site to identify itself as external and make it generate links differently for external site calls vs normal links for regular ZC store site pages/visitors.

.
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.

17 Oct 2011, 12:44 PM
#20
breauxlg avatar

breauxlg

New Zenner

Join Date:
Jun 2010
Location:
New Iberia, LA
Posts:
50
Plugin Contributions:
0

Re: I don't get any content using Sidebox Anywhere

As for why I'm doing this, I have a customer who wants a specific look and feel to their home page that I cannot produce from Zen cart. They want specific things in specific places and an iframe of product categories(they just want a box - they don't know what an iframe is.) What I did wind up doing is creating a copy of tpl_categories.php and categories.php where I added target="_blank" to the generated links. I call the categories_new_page.php from the single_sidebox.php module which uses the tpl_categories_new_page.php. It's working now, but it definitely wasn't an easy thing for me to figure out. You can see a test site that jumps to the zen site in a new page at https://www.iberiarental.com. The links aren't to their zen cart, just another one I have set up.
Thanks for your time.
Lynn

zen-cart-v1.3.9h