Zen Follower
- Join Date:
- Nov 2009
- Location:
- North Bendigo, VIC, Australia
- Posts:
- 157
- Plugin Contributions:
- 0
Image Titles Support Thread
Thank-you.
That helped solve that issue.
Kind Regards
Views: 28,613
Zen Follower
Thank-you.
That helped solve that issue.
Kind Regards
Zen Follower
Hi,
I want to use a transparent .png file instead of a .gif file, as well ... the gif file looks like crap lol
Can I just go in and change all the instances of .gif to .png in your files?
Thanks!
Joanne
Black Belt
That should work fine. Let me know how you make out. As I update my mods, I am moving to settable image extensions so the filetype only needs to be defined once, or where practical, can be set at runtime.
Zen Follower
Yep, it worked :D
You can check out my store here http://www.joannes-digital-designs.com
Thanks,
Joanne
Zen Follower
LOL, I'm sorry, I was supposed to have posted this in the Image Handler thread, so sorry!!
New Zenner
Can this add-on be used to change the title text of the categories on the main pages?
(Similar to the product titles - but for the categories preceding these)
Black Belt
Not currently, but it should be fairly easy to add the functionality to the category/subcategory listing page using the same kind of code as the product info page uses.
New Zenner
I downloaded the ...2_0beta.zip file you attached in the other thread.
Uploaded it to my site per your 2.0 read me.
I get a ```
Parse error: syntax error, unexpected ';', expecting ')' in ...... /includes/modules/classic/category_row.php on line 42
When I brought up the file, line 42 looks like ```
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . (title_image_exists($categories->fields['categories_name'], 'categoryname' . $categories->fields['categories_id']) . '</a>');
I count 4 opening parens, and only 3 closing parens.
I am not enough of a programmer to know where to put the 4th closing parens.
Or am I counting it wrong?
Suggestions?
Jim
New Zenner
Can't find the edit button, maybe too much time has elapsed?
Any way, I got it fixed, the last line that ends
'<a>');
should be changed to
'<a>'));
Great MOD, thanks for your work.
Jim
New Zenner
Can't find the edit button, maybe too much time has elapsed?
Any way, I got it fixed, the last line that ends
'<a>');
should be changed to
'<a>'));
Great MOD, thanks for your work.
Jim
Black Belt
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.
New Zenner
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/showthread.php?p=891966#post891966
No harm no foul if you don't have time.
Black Belt
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.
Black Belt
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.
Zen Follower
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.
Black Belt
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:```php
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;
}
Name the images like centerboxhead-specials-month.gif (all lowercase).
Black Belt
If you replace this section of specials_index.phpphp 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; } with this```php
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;
}
Zen Follower
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!
Black Belt
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.
Zen Follower
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).
Tell staff why this post should be reviewed.