Support Forums

Testing for pages with one advert

This is a discussion on Testing for pages with one advert within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Is there a simple piece of logic which can be applied to showlistings.tpl when there is only one advert on ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 07-23-2008, 08:09 PM   #1
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
Default Testing for pages with one advert

Is there a simple piece of logic which can be applied to showlistings.tpl when there is only one advert on the page?
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds, Matching WordPress Themes & Magento Online Stores
seymourjames is offline   Reply With Quote
Old 07-24-2008, 02:34 AM   #2
civ
Senior Member
 
civ's Avatar
 
Join Date: Mar 2006
Location: Greer, SC
Posts: 601
Rep Power: 28
civ will become famous soon enough
Default

Code:
{if $results|@count < 2}
or if you need to do something within the $results foreach loop, you can play around with this (it's an integer):

Code:
$smarty.foreach.results.total
__________________
Civ's Modules (____NOW v4 COMPATIBLE____):

Stop Incomplete Listings! (proven revenue booster!)
Scam Filter (Just say no to Nigerians!) updated
Similar Listings (keep visitors longer)
Feedback Mod (testimonial builder)
Listing Status Reminder free!

Last edited by civ; 07-24-2008 at 02:36 AM.
civ is offline   Reply With Quote
Old 07-24-2008, 03:48 AM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
Default

Many Thanks - I see it now. The reason I want to do it is because I can avoid duplicate pages being generated by showlistings. If there is only one listing it does not make sense to have sorting or if you do, I believe other text needs to be added to make the page more distinct.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds, Matching WordPress Themes & Magento Online Stores
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying my site for testing anna245 Technical Support 1 05-31-2008 02:17 PM
v4 Beta Testing Eric Barnes News & Announcements 0 01-09-2007 05:47 PM
Locked Advert Unregistered Pre Sales Questions 2 01-03-2007 05:21 PM
Removing the field that shows the number of times an advert has been viewed sporthorsebreeder v3.1 Questions & Support 2 09-18-2006 08:07 PM
Free advert for registering Maffo v3.1 Modules & Modifications 4 06-06-2006 01:40 PM


All times are GMT -4. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0