Re: Additional Image Titles support
I am testing out this mod and have run into a snag and I think it's with my confusion over how to specify the folder and file path.
My additional image exists here:
/images/silks/silk-custom_01.jpg
Can you tell me how this file should be referenced in the additional_image_titles_defines.php ? I am a bit confused over the use of underscores in the included examples in relation to the folder and filename. I've tried:
ADDIMG_SILKS_SILK-CUSTOM_01_jpg
ADDIMG_SILKS_SILK_CUSTOM_01_jpg
ADDIMG_SILKS_SILK-CUSTOM_01.jpg
Whatever I am doing wrong, it is disabling my entire site. After uploading the two files and I do a refresh on my site, it won't load and goes completely blank. When viewing page source, it's completely blank. Every page on the site exhibits this behavior until I delete the additional_image_titles_defines.php file.
---UPDATE---
I just tested again, but didn't edit the additional_images_titles_defines.php file. I just uploaded the includes folder (and renamed modules\your_template to my custom template) with the included examples and it still disables my entire site. :dontgetit
Re: Additional Image Titles support
As the readme says, replace all / . and - characters with _ in the defines. I did not mention explicitly, though the example shows, that you need to use all upper case letters.
ADDIMG_SILKS_SILK_CUSTOM_01_jpg
will not work; it needs to be
ADDIMG_SILKS_SILK_CUSTOM_01_JPG
Do you know what version of PHP your host uses? There is no good reason that the unedited files should crash your site, except that the mod uses the PHP function ereg_replace(), which I understand is deprecated in PHP 5.3 and will cause a problem with any script that uses it.
If that is the case, you may be able to change ereg_replace to preg_replace in the code; I have not yet checked on the syntax to see whether there is any difference in usage between the two functions. I will get back on this, and if necessary, release a new version of the mod to account for the PHP situation.
Re: Additional Image Titles support
Zen Cart 1.3.8a (all security patches)
PHP 5.2.11
MySQL 5.0.81
I just tried again with the corrected define (ADDIMG_SILKS_SILK_CUSTOM_01_JPG) and the site still goes completely blank on refresh.
I also changed ereg_replace to preg_replace in additional_images.php.
Re: Additional Image Titles support
So it's not the PHP version... have you downloaded a new copy of the mod? Perhaps a file got corrupted when unzipping or something.
Re: Additional Image Titles support
I just deleted my local copy of the mod and re-downloaded it.
Same issue. I guess there must be something quirky then with my host provider setup.
Re: Additional Image Titles support
Sorry you still have a problem, but I can't think of anything else that could be responsible...
Re: the PHP 5.3 deprecated function issue, you can just change ereg_replace to preg_replace and it will work fine - in fact, faster than before by an amount only detectable in mass repetitions. Preg_replace is much more powerful and flexible as well, but can still be used in the same basic fashion.
Re: Additional Image Titles support
I found the issue and fixed it.
I installed the debug error logging utility and got these results:
Code:
PHP Parse error: syntax error, unexpected '}' in /includes/languages/english/extra_definitions/additional_image_titles_defines.php on line 6
I looked on line 6 and it's:
Code:
define ('ADDIMG_TEXT_TOP','true'};//change to false to put text below images
In additional_image_titles_defines.php, I changed the } to a )
The } was in the original file. So, anyone else that happens to run into the same problem as I did, change:
Code:
('ADDIMG_TEXT_TOP','true'}
to
Code:
('ADDIMG_TEXT_TOP','true')
Re: Additional Image Titles support
This typo/bug is addressed in posts 12 & 13 above; I apparently never uploaded the fixed (v1.1) zip to Free Addons back in July. I am uploading it now (v1.2) along with a couple of other improvements.
Re: Additional Image Titles support
Glenn, this is an excellent mod. Very cool. Thank you for putting this together.
Re: Additional Image Titles support
I am back! ;) I downloaded your latest v1.2
Question, this should work for pre-PHP 5.3 right?
I don't receive any errors and my site appears to function normally (no blank pages), but there are no image titles on the images I defined using v1.2. If I copy over version 1.0 (with the bracket fix) back the image titles work.