Hi, I am wanting to display a thumbnail in the userbrowelisting.tpl page but using {debug} the pictures are not made available. How would I go about doing that? It is a bit of a pain going though the listings once you have a few. Cheers, Nick
Found this in my archives...hopefully it will work ************************************************* Add thumbnail to userbrowselistings.tpl ************************************************* includes/classes/kernel/Listings.php Line: 682 Find: $row['expirationTime'] = strtotime($row['expiration']); Just below this line, add: $row['image']=$this->getListingSingleImage($row['id']); Approx Line: 654 Find: $sSQL = "SELECT id,title,section,price,display,hitcount,dateadded,expiration,orderID,oType,oStatus,oProductID," Add featured as below: $sSQL = "SELECT featured,id,title,section,price,display,hitcount,dateadded,expiration,orderID,oType,oStatus,oProductID," (as of 4.2.4 use l.featured,l.pBold,l.pHighlighted etc...) ************************************************* And then something like this in your template file: <a href="viewlisting.php?view={$entry.id}"> {if $entry.image != ""} <img src="thumbs/small_{$entry.image}"> {else} <img src="path-to/nophotosmall.gif"> {/if} </a>
You don't need the part that refers to the "$sSQL =..." that is something completely different and is not needed to get your images. You only need to add the line: $row['image']=$this->getListingSingleImage($row['id']); <-- This does it's own query to get your image and adds it to the listings array Then add the code in your template file where you want the image displayed.