Thanks for that bugfix. I have updated the zip and will post it here for a bit more testing. When I am sure it is all good, I will update the mod, and delete this when it is available in Free Addons.
Thanks for that bugfix. I have updated the zip and will post it here for a bit more testing. When I am sure it is all good, I will update the mod, and delete this when it is available in Free Addons.
Last edited by gjh42; 4 Oct 2010 at 03:03 PM.
I forgot to mention, I was so pleased to get it working, what may be another problem.
I have the boxes featured products, specials, etc turned off.
When I uploaded all files, even after it was working I got an error referring to left and right .php and special/featured.php, I just deleted them from my file structure as the help file said I could and all was well.
But you might want to check it and maybe have the file check to see if that box is turned on or not, or state in the help file not to upload those files if the related boxes are turned off.
Again Thanks
Jim
PS If you have nothing to do (Ha fat chance huh) do you know of a way to solve my ? in this thread >
https://www.zen-cart.com/forum/showt...966#post891966
No harm no foul if you don't have time.
Thanks for the note. If there is an error message, it needs to be fixed rather than turned off. I'll check those other files for the same kind of bug if relevant, and will be setting up a new test site soon so I can test things myself again.
I'm not sure why you were having problems with sidebox or centerbox titles, but I have tested the complete mod in Firefox, IE8 and IE "compatibility" and found it to work correctly.
Images for Titles v2.0 is now available in Free Addons.
Moved image replacement to function for more flexible use,
added easy image filetype define,
added image replacement for subcat names in category listing.
Base files up to date as of v1.3.9f.
Glenn,
Does v2.0 of this mod support looking up a separate image for each month, using strftime('%B') ??
I am currently using v1.2 of this mod and I had modified new_products.php to replace all references to '/centerboxhead-new.gif') with '/centerboxhead-new-' . strftime('%B') . '.gif')
This would then find the appropriate centerboxhead-new-nameofmonth.gif image file in the /buttons/english folder.
In testing v2.0 of this mod (I have a test build of an upgraded 1.3.9f site), I cannot get this functionality to work. It will not replace the centerboxhead text with an image based on current month. It appears the code has changed a bit in new_products.php and I am not sure how to tweak it.
I tried changing 'centerboxhead-new' to 'centerboxhead-new-' and also added '.gif'), but can't seem to get this to work.
NOTE:
If I add a centerboxhead-new.gif file, it replaces the text with that image just fine. It just won't recognize the other files based on the month (e.g., centerboxhead-new-September.gif).
The new version is working great for everything else (changing the category sidebox header text to image), so I know I have the mod installed correctly.
Last edited by Crunch; 30 Sep 2010 at 12:07 AM.
I didn't add the month or category image feature, because that would not find the basic (non-cat, non-dated) versions of the images for those who don't have specific ones. You should be able to make the same modification as you did previously, by editing the second parameter in the title_image_exists() function call in /includes/modules/your_template/specials_index.php:Name the images like centerboxhead-specials-month.gif (all lowercase).PHP Code:if ($specials_index->RecordCount() > 0) { //image titles - box header image if file exists
//$title = '<h2 class="centerBoxHeading">' . title_image_exists(sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')), 'centerboxhead-specials') . '</h2>';
$title = '<h2 class="centerBoxHeading">' . title_image_exists(sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')), 'centerboxhead-specials-' . strtolower(strftime('%B'))) . '</h2>';
$zc_show_specials = true;
}
Last edited by gjh42; 30 Sep 2010 at 12:22 AM.
If you replace this section of specials_index.phpwith thisPHP Code:if ($specials_index->RecordCount() > 0) { //image titles - box header image if file exists
$title = '<h2 class="centerBoxHeading">' . title_image_exists(sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')), 'centerboxhead-specials') . '</h2>';
$zc_show_specials = true;
}
it will first test for the "for month" version, then the basic version, and use whichever it finds first.PHP Code:if ($specials_index->RecordCount() > 0) { //image titles - box header image (for month) if file exists
if(title_image_exists('', 'centerboxhead-specials-' . strtolower(strftime('%B')))){
$title = '<h2 class="centerBoxHeading">' . title_image_exists(sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')), 'centerboxhead-specials-' . strtolower(strftime('%B'))) . '</h2>';
}else{
$title = '<h2 class="centerBoxHeading">' . title_image_exists(sprintf(TABLE_HEADING_SPECIALS_INDEX, strftime('%B')), 'centerboxhead-specials') . '</h2>';
}
$zc_show_specials = true;
}
I am modifying new_products.php, not specials_index.php. It looks as though it's the same fix to make the modification in the other file.
I applied your first suggested fix of commenting out the existing line and then adding the new modified line with the strtolower(strftime('%B')) added. This appears to have done the trick as the image for the month is now showing up.
Thanks for the assistance Glenn!
I noticed that after I had posted the code. I worked on the new products file, but that is much more complicated to do the full alternatives in, and I went off to bed before posting it. I'll have a version with the same flexibility as the original, using a new products for month - category image if it exists, then a new products for month image if it exists, then a new products image if it exists, then the standard text. After I check it a bit more, I will post that one.
I guess I spoke too early... Still having trouble with new_products.php.
While the fix I applied earlier (commenting out the existing line and then adding the new modified line with the strtolower(strftime('%B')) added) worked on the main page of the site (New Products of the month text is replaced with the appropriate image), I just discovered it is not working for the Category pages that have new products.
On the Category pages where it normally would show the text "New Products of the month," it now shows a hyphen and the name of the category.
So, if the category is Blue Widgets, the section where it should say "New Products of the month," will have text only that says, - Blue Widgets (and of course no image replacement).