 | |  | | | ReviewPost How do I...? Wondering how to do something in ReviewPost? |
December 13th, 2005, 10:42 AM
|
#1 (permalink)
| | Member Verified Customer
Join Date: Sep 2003 Location: W.Yorkshire UK
Posts: 94
| Index, Random, Most Popular Thumb 'alt' title?
Ok, this particular thing is doing my head in, i've looked all over the templates and files and can not for the life of me figure out where it is...
Say you have a random product or most popular product with an image, which is displayed on the the main index and on the cateogry pages and on the product page in the sidebar and underbar cells.
Say for example that the name of the actual image file is example.jpg, so when you hover over this random product on any of these pages it shows you the alt tag example.jpg.
I don't want it to do that, I want to use an alternate alt tag, e.g. $title so that it shows the title of the product and not the name of the picture.
How can I do this, or mores to the point, where the heck is the bit of code for this, so that I could do it myself even?
|
| |
December 13th, 2005, 10:55 AM
|
#2 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
The code is in pp-inc.php get_imagethumb function
if ( file_exists( $filepath ) ) {
$imgtag = "<img border=\"0\" $imgsize src=\"$fileurl$rand\" alt=\"$bigimage\" />";
but we do not pass title in that function
|
| |
December 13th, 2005, 10:58 AM
|
#3 (permalink)
| | Member Verified Customer
Join Date: Sep 2003 Location: W.Yorkshire UK
Posts: 94
| Quote: |
Originally Posted by Chuck S The code is in pp-inc.php get_imagethumb function
if ( file_exists( $filepath ) ) {
$imgtag = "<img border=\"0\" $imgsize src=\"$fileurl$rand\" alt=\"$bigimage\" />";
but we do not pass title in that function | Thanks, I think I may have already changed that. No wonder it isn't showing if it doesn't get parsed though, lol.
Ok - "Goes off to get $title to work for it now that he know's the bit of code he's working with"
Thanks. |
| |
December 13th, 2005, 11:02 AM
|
#4 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
Yep you need to modify the function to pass $title
maybe in pp-inc.php
function get_imagethumb( $bigimage, $thecat, $theuser, $approved, $nocache=0, $avatar=0, $thumbw=0, $thumbh=0 , $title ) {
then in pp-inc.php display_gallery function
$pimgtag[$count] = get_imagethumb( $features['bigimage'], $features['cat'], $features['userid'], 1 , 0, 0, 0, 0, $features['title'] );
|
| |
December 13th, 2005, 11:05 AM
|
#5 (permalink)
| | Member Verified Customer
Join Date: Sep 2003 Location: W.Yorkshire UK
Posts: 94
| Quote: |
Originally Posted by Chuck S Yep you need to modify the function to pass $title
maybe in pp-inc.php
function get_imagethumb( $bigimage, $thecat, $theuser, $approved, $nocache=0, $avatar=0, $thumbw=0, $thumbh=0 , $title ) {
then in pp-inc.php display_gallery function
$pimgtag[$count] = get_imagethumb( $features['bigimage'], $features['cat'], $features['userid'], 1 , 0, 0, 0, 0, $features['title'] ); | Ok, i'll give that a shot before trying anything else, after all you are the pro when it comes to these products, anything to save me some work. |
| |
December 13th, 2005, 11:06 AM
|
#6 (permalink)
| | Photopost Developer Verified Customer
Join Date: Jun 2002 Location: Abingdon,MD
Posts: 71,698
|
Haven't tested it  Just a thought off the top of my head
|
| |
December 13th, 2005, 11:09 AM
|
#7 (permalink)
| | Member Verified Customer
Join Date: Sep 2003 Location: W.Yorkshire UK
Posts: 94
| Quote: |
Originally Posted by Chuck S Haven't tested it  Just a thought off the top of my head | lol, that's ok, part of the fun of coding is trying these things out and getting them to work, if they don't straight away. |
| |
December 13th, 2005, 11:17 AM
|
#8 (permalink)
| | Member Verified Customer
Join Date: Sep 2003 Location: W.Yorkshire UK
Posts: 94
| Quote: |
Originally Posted by Chuck S function get_imagethumb( $bigimage, $thecat, $theuser, $approved, $nocache=0, $avatar=0, $thumbw=0, $thumbh=0, $title ) { | Not bad at all for off the top of your head.
2 characters away from perfect first time. Quote: |
function get_imagethumb( $bigimage, $thecat, $theuser, $approved, $nocache=0, $avatar=0, $thumbw=0, $thumbh=0, $title=1 ) {
| And now it works perfectly. |
| |
December 13th, 2005, 11:31 AM
|
#9 (permalink)
| | Member Verified Customer
Join Date: Sep 2003 Location: W.Yorkshire UK
Posts: 94
| Quote: |
Originally Posted by Detomah And now it works perfectly.  | ok, nearly perfect. >.< lol
I noticed that it showed certain images up with the alt tag 0 so i've changed that code from $title=0 to $title="" and all is fine now.
It now shows the name of the product for those that hvae one directly attached and nothing for those with no title attached to them, such as category thumbs.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Rate This Thread | Linear Mode | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -5. The time now is 10:51 PM. | |