
Originally Posted by
izonmedia
This sounds like the meat of the problem. I have not edited these files. When I downloaded the contribution and decompressed it, I found a readme.txt file with 3 simple instructions, none of which mentions editing these files. .
You are correct. The readme is over simplified and does not include the code snippets which were merged into the core Zen Cart files provided in the mod package. (Unfortunately the developer assumes you will on your own compare the provided files with your installed versions. But many new to Zen Cart just blindly upload. This is why it is is best practice for developers to document such code snippets in the mod readme...but some mod developers are in just too much of a rush or just forget or just don't care).
At any rate this mod works with Zen Cart 1.37 but it has NOT been updated for Zen cart 1.37. Compare with the ZC 1.37 core files and you will observe differences in ZC 1.37 version of /includes/modules/additional_images.php that do not show up in the mod version of the same file.
Note the Lightbox 1.3 mod was last updated over six months ago, well before the release of ZC 1.37. Hopefully Alex will take this in consideration with next update.
So I just compared the two core ZC files provided in the Zen Lightbox 1.3 mod distribution with the Zen Cart 1.37 version core files.
My findings:
(1) \includes\templates\YOUR-TEMPLATE-FOLDER\templates\tpl_modules_main_product_image.php
in the mod package is still current with ZC 1.37
Code:
* @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $
(2) But I cannot say the same for:
\includes\modules\YOUR-TEMPLATE-FOLDER\additional_images.php
Latest Zen Cart 1.37 version:
Code:
* @version $Id: additional_images.php 5369 2006-12-23 10:55:52Z drbyte $
Older IH2 version in Zen Lightbox:
Code:
* @version $Id: additional_images.php,v 1.3 2006/05/01 12:20:31 tim Exp $
(keep in mind that cboylan integrated code from the last version of ImageHandler 2 into the Lightbox version of the file. Last version of IH2 was released in the early days of ZC 1.3x and the IH2 mod is no longer developed by the author).
Comparing this file I noted one specific line is for Lightbox and all the other changes are for IH2.
In the latest ZC 1.37 version of the file multiple instances of the ereg_replace() function has been replaced by str_replace() function.
For example, the following:
PHP Code:
$products_image_base = ereg_replace($products_image_extension . '$', '', $products_image);
Was changed in Zen Cart 1.37 to :
PHP Code:
$products_image_base = str_replace($products_image_extension, '', $products_image);
If you want to understand why see:
See http://us2.php.net/ereg_replace
http://us2.php.net/str_replace
So for this specific file if you don't use IH2 (and it appears you don't) it might be best to just open a copy of the default ZC 1.37 core version (if you have no other edits) and edit the one line difference yourself and then upload.
For the future I think it best if the lightbox mod was released in two separate versions, one for base Zen Cart and another for IH2 (just include alternative files in the same package but in different option directories, and also document the different code snippets in readme).
Also I am uncertain if non-IH2 users need to upload
includes/functions/extra_functions/zen_image_lightbox_IH2_url.php
It appears it is only needed for IH2 installs but I myself use IH2 so I have file uploaded.
I suspect some of this stuff may have been previously documented further back in this thread. Search on cboylan for more info.
As a reminder for all...
I'm not saying that uploading those files is your current issue (and it is likely not) but any time you install a mod you should not overwrite core files or upload overrides, without first checking if those files provided in the mod match your Zen Cart version. That applies to Lightbox also.
And before overwriting you should check to see if you will be overwriting files you have previously edited/customized.
Install a compare/merge tool (e.g. WinMerge or BeyondCompare) to compare the mod files with the Zen Cart core versions and also compare with the back ups of your versions (before you uploaded the mod versions).
Woody
Bookmarks