Hi all, Any thoughts on how to count the number of images / photos each advert has, to then be shown in showlistings.tpl EG: This advert as 10 photos any help REALLY appreciated Thank Jason.
You would just need to query the DB table for the count of rows for the listing id in a plugin. I could see how this would be very handy, so I went ahead and made the plugin! The plugin, simply returns the integer number of pics (including 0). Use it like any other plugin and use $entry.id for the lid like this in your showlistings(2).tpl file and any text that you want to display before and after the plugin call: Example might be used after the actual thumbnail pic on a new line <div style="width:100%;text-align:center;font-weight:bold;"> {total_pics lid=$entry.id} pics </div>
Mike what can I say, thanks for going that extra mile for me, and I hope other people can use this as well. Mike your a star, thank you very much.
Uh oh, Freeze! I can see it now... Code: {total_pics lid=$entry.id assign="pics"} {if $pics==0} <strong>{$owner} is so LAME<br /> He didn't upload any pics!!!</strong> {else} <br />There are $pics pics. {/if}