Zen Cart Logo
Forums / Addon Sideboxes / Put A Zc Sidebox On A Page Outside Zc?

Put A Zc Sidebox On A Page Outside Zc?

Views: 21,138

Results 41 to 60 of 68
15 Jun 2007, 1:21 PM
#41
briohny12 avatar

briohny12

New Zenner

Join Date:
Jun 2007
Posts:
48
Plugin Contributions:
0

Put A Zc Sidebox On A Page Outside Zc?

You're a legend! Thank you so much. I was nearly ripping my hair out. Problem solved. All good and sorted. :clap:Yippee!!!!!!!!!!!!!!!!!!!!!!!

16 Jun 2007, 5:44 AM
#42
drbyte avatar

drbyte

Sensei

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

Re: Put A Zc Sidebox On A Page Outside Zc?

Frankly, IMO, the styles should be inserted in your page's main CSS file, and NOT inside the PHP file used for displaying the sidebox.

20 Jun 2007, 9:22 PM
#43
millyncrafts avatar

millyncrafts

New Zenner

Join Date:
May 2007
Posts:
2
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

I haven't figured out the correct way to change the paths to /boutique in the application b thingy page. Help?

9 Aug 2007, 12:00 PM
#44
tonibarcelona avatar

tonibarcelona

Inactive

Join Date:
Feb 2007
Location:
Barcelona
Posts:
200
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

For all of you that still haven´t knowing how to insert a sidebox into an excternal page, finally i have had succes calling the Dr. Byte´s single_sidebox.php from an iframe, and all works fine!! Now i only must configure css style.

8 Sep 2007, 6:26 PM
#45
instantok avatar

instantok

New Zenner

Join Date:
Sep 2007
Posts:
6
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

So there are a few threads about this and none (that I have read) seem to answer the question completely, how can this mod be changed to support adding a sidebox to a page in the directory above the ZC install? I've done it by loading a sidebar via AJAX but would like to avoid a javascript or iframes solution.

Any tips?

10 Sep 2007, 4:13 AM
#46
tjazzvibe avatar

tjazzvibe

New Zenner

Join Date:
Sep 2007
Posts:
6
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

i tried the single_sidebox script above. my store is in /store directory so it's one level down. as long as i put the page calling this script in the /store folder i'm ok. but if put the page calling the script outside of the /store folder let's say here
-> '/at_the_top' <-- nothing works.

i assume i understand why. the location of my page has changed and is outside or the /store folder. so that means all the zen cart vars and functions relative to my /store are broken now. i guess they rely on a path that the calling script is from..... something like that (dizzy).

is there any way of tricking the /store/side_box_script.php into thinking it's being called by a document inside of the /store folder? i was playing around with the $_SERVER vars but nothing worked there. i don't think setting my include paths because i'd have to set them for every folder in zen cart and then strip all the extra path stuff of in the requires.

if it's possible is seems like i have to trick this script into thinking the file calling it is in the same folder as the store. is there a way to trick this page?

whew hope i'm clear.

maybe there's another script i can use?

thanks,
tony

10 Sep 2007, 11:27 PM
#47
drbyte avatar

drbyte

Sensei

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

Re: Put A Zc Sidebox On A Page Outside Zc?

Just add this at the top of the single_sidebox code quoted earlier:```
$startingDir = getcwd();
$zcDir = realpath(dirname(FILE));
chdir($zcDir);
define('DIR_WS_IMAGES', $zcDir . '/images/');

15 Sep 2007, 8:34 PM
#48
instantok avatar

instantok

New Zenner

Join Date:
Sep 2007
Posts:
6
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

Hey DrByte, does this fix apply to the issue of putting a sidebox a directory up or does it apply to the image path issues some others were having? is there a way to apply this fix to everything so the sidebox can live a directory up? thanks for your help.

15 Sep 2007, 11:34 PM
#49
drbyte avatar

drbyte

Sensei

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

Re: Put A Zc Sidebox On A Page Outside Zc?

instantok:

Hey DrByte, does this fix apply to the issue of putting a sidebox a directory up or does it apply to the image path issues some others were having? is there a way to apply this fix to everything so the sidebox can live a directory up? thanks for your help.

It should address both.

Packaged module including the above extra code can be found here:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=79

16 Sep 2007, 3:28 PM
#50
instantok avatar

instantok

New Zenner

Join Date:
Sep 2007
Posts:
6
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

Thanks DrByte. That works. There was a missing semicolon at the end of line 33 in case anyone is getting that error.

I have it working on a bare bones php page with nothing else on it but for some reason when I include it on a Textpattern page i get an error:

Fatal error: Call to a member function on a non-object in /full/path/removed/for/privacy/shop/includes/classes/db/mysql/query_factory.php on line 105

You've already provided a great help to me so I hate to ask for more, but do you have any ideas as to what sorts of things could be causing the error? I have basic php knowledge but pretty much nothing when it comes to databases.

thanks.

17 Sep 2007, 6:40 PM
#51
drbyte avatar

drbyte

Sensei

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

Re: Put A Zc Sidebox On A Page Outside Zc?

instantok:

I have it working on a bare bones php page with nothing else on it but for some reason when I include it on a Textpattern page i get an error:

Fatal error: Call to a member function on a non-object in /full/path/removed/for/privacy/shop/includes/classes/db/mysql/query_factory.php on line 105

...

do you have any ideas as to what sorts of things could be causing the error? I have basic php knowledge but pretty much nothing when it comes to databases.

It's not a database problem. It's likely a PHP variable conflict problem ... I suspect that your Textpattern uses $db as a variable somewhere, which is conflicting with the Zen Cart variables? Or maybe some other path definition is having a conflict.
I'm not sure really, as I don't use Textpattern for anything.

19 Sep 2007, 12:36 PM
#52
instantok avatar

instantok

New Zenner

Join Date:
Sep 2007
Posts:
6
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

cool. thanks for the ideas. hopefully i can figure out some sort of workaround.

thanks again for all your help.

1 Oct 2007, 4:15 PM
#53
cyberespia avatar

cyberespia

New Zenner

Join Date:
Apr 2007
Posts:
3
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

NO work for me

my file nuevos.php:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="catalogo/includes/templates/classic/css/stylesheet.css" />
</head>

<body>
  <?php 
  $zcSBmodule = 'whats_new.php';
  $zcSBlayout = 'left';
  require ('catalogo/single_sidebox.php'); 
  ?>
</body>
</html>

in action: http://www.creacionesjak.com/nuevos.php

Help??

23 Oct 2007, 3:17 AM
#54
phycel avatar

phycel

New Zenner

Join Date:
Sep 2007
Location:
Daytona Beach, Florida
Posts:
21
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

MZ Rich:

i have done this on one of my pages, however, the links are fine they go to the correct place, but the product image is set from where the single_sidebox.php file is called from, ie a different domain.
is there a way to hard-code the beginning of the url into the product image so it loads correctly?

I know there is a new release of the single_sidebox.php since this guy's post -- but I am still having a problem with the images showing up.

http://subliminalscience.com/articles/hypnosis-articles.php

When looking at the properties of the image, it seems to be a bad path.
http://subliminalscience.com/home/content/s/u/b/subliminal1/html/images/inductions-deepenersDVD_cov.jpg

I have searched through the forums and can't seem to find a solution to my problem. Anyone have an idea?

Rene

23 Oct 2007, 6:15 AM
#55
phycel avatar

phycel

New Zenner

Join Date:
Sep 2007
Location:
Daytona Beach, Florida
Posts:
21
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

phycel:

I know there is a new release of the single_sidebox.php since this guy's post -- but I am still having a problem with the images showing up.

http://subliminalscience.com/articles/hypnosis-articles.php

When looking at the properties of the image, it seems to be a bad path.
http://subliminalscience.com/home/content/s/u/b/subliminal1/html/images/inductions-deepenersDVD_cov.jpg

I wanted to let everyone know I have fixed the problem. I took advantage of ob_start() and had it find the occurances of the wrong path. I added this snippet of code to the top of the hypnosis-articles.php page where I have my php requires --

<?
ob_start("FixImages");
function FixImages($buffer)
{
  return (str_replace("/home/content/s/u/b/subliminal1/html/images/", "/images/", $buffer));
}



?>

All is working well now and the code looks beautiful.
http://subliminalscience.com/articles/hypnosis-articles.php

I still love this forum and thank all you Zen Cart gurus that help us beginner coders along the way!

Rene

24 Oct 2007, 1:12 AM
#56
kaworunagisa avatar

kaworunagisa

New Zenner

Join Date:
Oct 2007
Posts:
10
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

I set up the single sidebox code just like it says to, and then got the following errors on the page in which I tried to place the sidebox.


Warning: Cannot modify header information - headers already sent by (output started at /home/path/public_html/page.php:9) in /home/path/public_html/store/includes/init_includes/init_templates.php on line 78

Fatal error: Call to a member function add_current_page() on a non-object in /home/path/public_html/store/includes/autoload_func.php on line 90

There is a session_start(); at the first line of page.php, to keep the session from within the store going, other than that there's a few include(); statements on the page, but no variables other than the ones required for the single sidebox.

So what's the deal here?

24 Mar 2008, 8:47 PM
#57
billedmunds avatar

billedmunds

New Zenner

Join Date:
Dec 2005
Posts:
52
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

I've been trying to get a random product to appear on page located one folder above Zencart using Sidebox Anywhere. I can get the product name to appear with a broken link to the image but the errors messages that appear overt he broken link read:

"Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/billedmu/public_html/test.php:8) in /home/billedmu/public_html/shop/includes/functions/sessions.php on line 108

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/billedmu/public_html/test.php:8) in /home/billedmu/public_html/shop/includes/functions/sessions.php on line 108

Warning: Cannot modify header information - headers already sent by (output started at /home/billedmu/public_html/test.php:8) in /home/billedmu/public_html/shop/includes/init_includes/init_templates.php on line 78"

My page code is a simple "<?php $zcSBmodule='iC_AthemeV1.3/random.php'; include('/home/billedmu/public_html/shop/single_sidebox.php');?>"

How do get rid of the eeror messages and will correcting them make the images appear?

The test page is located at https://www.billedmunds.com/test.php

Thanks,

Thanks,

24 Mar 2008, 9:12 PM
#58
aly22 avatar

aly22

Zen Follower

Join Date:
Feb 2008
Posts:
174
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

I know this is an old thread at this point, but I'm trying to get this to work as well.

Store is in a sub-directory: public_html/shop/
Images (obviously) are in shop/images/product

single_sidebox.php is in the public_html/shop directory

The main site is at: public_html/
where I have loaded a page: test.php

The module works great! I can see the "featured" sidebox from my store and it rotates accordingly, too!

BUT, NO IMAGES!?

When I attempt to view the image it is going to the wrong directory:
http://my_site/images/product/my_image.jpg

It needs to go to:
http://my_site/**shop/**images/product/my_image.jpg

I have tried adding the "fix" from phycel, above -- but still no luck.
I have even tried editing the image directory path in single_sidebox.php -- but no luck.

If anyone is still around this thread, I'd be quite grateful for any pointers to get this working on my main web site. :lookaroun

25 Mar 2008, 2:03 AM
#59
billedmunds avatar

billedmunds

New Zenner

Join Date:
Dec 2005
Posts:
52
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

I solved the error message problem after reading Dr. Byte's tutorial. Extra spaces was not the problem. My PHP code was inside an HTML page saved as PHP. After I deleted all the HTML (generated by Dreamweaver) the messages went away.

I now have the same problem as Aly22. No images. Let me know if you figure this one out.

Thanks,

25 Mar 2008, 3:30 AM
#60
aly22 avatar

aly22

Zen Follower

Join Date:
Feb 2008
Posts:
174
Plugin Contributions:
0

Re: Put A Zc Sidebox On A Page Outside Zc?

I've gotten nowhere :(
Are we supposed to be editing anything in the single_sidebox.php file itself?
I have exactly what you have, Bill.