Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Why no support on this site - Sidebox image size question - need help please

Why no support on this site - Sidebox image size question - need help please

Locked

Views: 8,799

Results 21 to 31 of 31
This thread is locked. New replies are disabled.
17 Aug 2006, 1:50 AM
#21
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Why no support on this site - Sidebox image size question - need help please

Thinking that this MAY be related to the problem we were writing about in the other thread last night to which no one would respond

This is our setup

We have the two sites running on a Windows Box with MYSQL

The problem we were seeing at 1st as that the image was not showing up at all as when checking the image it was calling it from the jlaforums.com domain instead of the jlaenterprises.net domain

All the other links were being called correctly pointing to www.jlaenterprises.net

To solve this we created a virtual directory in IIS for the jlaforums.com site that pointed to our zen cart directory on the server

once we did that, the images started appearing but under www.jlaforums.com/jladirect/images

jladirect is the name of the virtual directory we created.

In the config file we added jladirect just before /images

We used a separate config file for these boxes

17 Aug 2006, 2:10 AM
#22
drbyte avatar

drbyte

Sensei

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

Re: Why no support on this site - Sidebox image size question - need help please

JLA:

// $Id: tpl_whats_new.php,v 1.1.2.2 2005/05/21 21:05:42 tim Exp $
You're using the ImageHandler mod, and attempting to run it from a remote call?
Sorry ... I just may have to pass the buck here.
Take out the image-handler and then maybe things will work... since, as I mentioned, making the change from constants to specific values works fine on a fresh untouched install.

JLA:

Thinking that this MAY be related to the problem we were writing about in the other thread last night to which no one would respondAnd you wonder why anybody would respond when you're talking about a complex configuration as you've described?

Sounds like you've got enough hacked changes that it's gonna be an interesting journey to track down what's causing this. Esp on older code.
Hopefully you find a simple fix for it.

17 Aug 2006, 2:33 AM
#23
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Ok, I might be able to make this simple

Lets back up

The original problem we had with the code you provided for using boxes outside of zen was doing this

No image would appear though the rest of the items and an image placeholder would show

The product links and new products link pointed to our zen domain but the image was pointing to jlaforums.com/images instead of jlaenterprises.net/images

This is due to the config file not allowing to specify the domain but only /images and it just takes the domain you are operating in and pops that in

how can you change the config file we are using (we copied it and using a separate one for this test) to say hey ...... look at http://www.jlaenterprises.net/images instead of just /images and pop in the domain being called from?

17 Aug 2006, 2:36 AM
#24
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

The config file originally had this

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', '/');

define('DIR_WS_IMAGES', '/images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
define('DIR_WS_BLOCKS', DIR_WS_INCLUDES . 'blocks/');
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

We mapped a virtual directory in IIS for the nonzen domain called jladirect and pointed it to the zen directory on the server and changed the config file to this

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', '/');

define('DIR_WS_IMAGES', 'jladirect/images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
define('DIR_WS_BLOCKS', DIR_WS_INCLUDES . 'blocks/');
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

So the ? would be...how do you change this to tell it to point to https://www.jlaenterprises.net/images when calling instead of /images and pop in the domain from the domain that it is being called from as it was doing originally. This would allow us to get rid of the virtual directory and probably solve the image size problem.

17 Aug 2006, 4:42 PM
#25
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Would someone please be able to provide some further help here?

Perhaps Linda or someone more familar with the Zen Code?

Thank You

17 Aug 2006, 4:48 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Why no support on this site - Sidebox image size question - need help please

As you are not using just Zen Cart code and it is not an up to date version of Zen Cart, but rather an old, out of date version plus an add-on that could be causing this, perhaps you should post a Commercial Help Wanted ...

It is going to take more than guessing and hands on review of the site would be faster and easier to do ...

17 Aug 2006, 5:00 PM
#27
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Hi Linda - thanks for responding

Actually, we are just using Zen Cart code (with image handler) and the code provided by Dr Byte to display sideboxes on external pages.

The only code on the external page is just the snip that calls the one file that was created by Dr Byte placed in the Zen Directory. The rest is the Zen Cart code and even do to the version of the Zen files - there should be no reason why this portion of our questions should not have a fairly simple (yet not known to us) answer

So, I guess I will try to back this up and lets forget about all the other parts of this problem that might be affected by what you were suggesting.

The issue is this

When the box was called from the jlaforums site using the snip and file provided by Dr. Byte - it would call the box data with no problem

  1. The data would show
  2. The links to the product and new products were correct pointing to the correct pages on the jlaenterprises.net domain

There was one problem though. The images were not showing

  1. When right clicking on the image placeholder, it was showing jlaforums/images... instead of jlaenterprises.net/images...

When looking at the config file in Zen, we found that this is the place the code is taking direction from to call images for the side box

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
// these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
define('DIR_WS_CATALOG', '/');

define('DIR_WS_IMAGES', '/images/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
define('DIR_WS_BLOCKS', DIR_WS_INCLUDES . 'blocks/');
define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

So the only question here is how do you tell this portion of the config file in Zen

define('DIR_WS_IMAGES', '/images/');

and instead when pulling the image of just popping in the domain from where the code is being called from to be able to manually specify that you need to look for images at jlaenterprises.net/images

We tried changing this line to

define('DIR_WS_IMAGES', 'jlaenterprises.net/images/');

and the result when right clicking on the picture was showing it was attempting to look for the pictures at

http://www.jlaforums.comjlaenterprises.net/images...

If you can help us out with this answer, I think it might solve all the other problems we were speaking of regardless of the image handler mod, etc..

P.S. All our private messages were deleted from our previous conversations prior to you changing your forums. So I sent you an e-mail two days ago for an upgrade quote to which I haven't heard back from you.

Thank You for your help

17 Aug 2006, 6:29 PM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Why no support on this site - Sidebox image size question - need help please

I will try to get back to you tonight about the upgrade ... not enough hours in the day ... :cry:

17 Aug 2006, 7:10 PM
#29
drbyte avatar

drbyte

Sensei

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

Re: Why no support on this site - Sidebox image size question - need help please

The use of my code to call sidebox display from outside Zen Cart is dependent on working with resources entirely within the same domain as your Zen Cart shop.

If you wish to use it outside that context, you will need to alter the code, mostly in includes/functions/html_output.php, which draws the image using zen_image(), so that it looks for the image at the physical location specified by your internal server share in order to read the physical file and determine its contents, dimensions, etc, and then alter the output portion of the same function so that it grabs the real image from yet another domain.

The DIR_WS_IMAGES constant will need to be adjusted to something like:
define('DIR_WS_IMAGES', 'http://yourothersite.com/images/');

and then you'll need to add another constant for the physical share/folder path available to the function, and have it use that for locating and reading the file.

Oh, and, you'll need to make sure you don't bust it for your regular functionality, outside the sidebox.

17 Aug 2006, 7:50 PM
#30
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

DrByte:

The use of my code to call sidebox display from outside Zen Cart is dependent on working with resources entirely within the same domain as your Zen Cart shop.

If you wish to use it outside that context, you will need to alter the code, mostly in includes/functions/html_output.php, which draws the image using zen_image(), so that it looks for the image at the physical location specified by your internal server share in order to read the physical file and determine its contents, dimensions, etc, and then alter the output portion of the same function so that it grabs the real image from yet another domain.

The DIR_WS_IMAGES constant will need to be adjusted to something like:
define('DIR_WS_IMAGES', 'http://yourothersite.com/images/');

and then you'll need to add another constant for the physical share/folder path available to the function, and have it use that for locating and reading the file.

Oh, and, you'll need to make sure you don't bust it for your regular functionality, outside the sidebox.

What we did not to bust the functionality is to make copies of the referenced files (app top/bottom - config, etc) and reference those files in the appropriate places.

This way these boxes are working independently from the main installation of Zen.

I just tried adding the http://www.jlaenterprises.net to the /images and that fixed that one issue

Could have swore I did that before ... so that portion is worked. I will look at the html files and see what it is you are talking about.

Thanks

17 Aug 2006, 9:08 PM
#31
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

AH!!! Success

You were right about changing the HTML output file

I think what we did was a bit on the crude side to start but we are going through the application top, config, html output and other related files to strip out all of the functions that are not needed for displaying these sideboxes on sites OUTSIDE of your zen cart.

With these changes you can display your sideboxes anywhere.

The crude change we made was

in the html output file we took this code

// proportional images
$image_size = @getimagesize($src);
// fix division by zero error
$ratio = ($image_size[0] != 0 ? $width / $image_size[0] : 1);
if ($image_size[1]*$ratio > $height) {
$ratio = $height / $image_size[1];
$width = $image_size[0] * $ratio;
} else {
$height = $image_size[1] * $ratio;
}

  $image .= ' width="' . $width . '" height="' . $height . '"';
} else {
   // override on missing image to allow for proportional and required/not required
  if (IMAGE_REQUIRED == 'false') {
    return false;
  } else {
    $image .= ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '"';
  }
}

if (zen_not_null($parameters)) $image .= ' ' . $parameters;

$image .= ' />';

return $image;

}

and changed it to

// proportional images
$image_size = @getimagesize($src);
// fix division by zero error
$ratio = ($image_size[0] != 0 ? $width / $image_size[0] : 1);
if ($image_size[1]*$ratio > $height) {
$ratio = $height / $image_size[1];
$width = $image_size[0] * $ratio;
} else {
$height = $image_size[1] * $ratio;
}

  $image .= ' width=35 height=28"';
} else {
   // override on missing image to allow for proportional and required/not required
  if (IMAGE_REQUIRED == 'false') {
    return false;
  } else {
    $image .= ' width=35 height=28"';
  }
}

if (zen_not_null($parameters)) $image .= ' ' . $parameters;

$image .= ' />';

return $image;

}

This now made the images for that particular sidebox at the top of JLA FORUMS at 35X28 instead of 100X80 (Allows us to fit into a 468X60 banner.

We will start a thread on the 2nd part for displaying multiple items in a sidebox.

Also, if anyone wants once we have stripped everything out of all of the files we are using, we can do a contribution for those who want to use this new functionality.

Dr. Byte - THANK YOU for your help!