Support Forums


Go Back   68 Classifieds Forums > Help & Support > v4 Questions & Support

 
LinkBack Thread Tools Display Modes
Old 05-06-2009, 06:27 AM   #1
Member
 
 
Join Date: Jan 2009
Location: England
Posts: 42
Rep Power: 2
jason1971 is on a distinguished road
Default Count and show number of listings in showlistings.tpl

Hi all,

What im looking to acheive is at the top of the showlistings.tpl page, to show the number of items within that chosen category.

So it would read something like: There are 56 caravans for sale

Any pearls of wisdom welcome

Many Many thanks in advance

Jason
__________________
v4.0.9 Hosted
jason1971 is offline   Reply With Quote
Old 05-06-2009, 08:39 AM   #2
Moderator
 
 
Join Date: Mar 2006
Posts: 4,151
Rep Power: 102
Lhotch is just really niceLhotch is just really nice
Default

You should be able to use the smarty vaariable {$numrows} in the showlistings.tpl
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old 05-07-2009, 12:51 AM   #3
Member
 
 
Join Date: Jan 2009
Location: England
Posts: 42
Rep Power: 2
jason1971 is on a distinguished road
Default

Many Thanks Larrry
__________________
v4.0.9 Hosted
jason1971 is offline   Reply With Quote
Old 05-07-2009, 03:29 AM   #4
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 709
Rep Power: 18
bowers01 is on a distinguished road
Default

Quote:
Originally Posted by Lhotch View Post
{$numrows}
Thats what i use but does anyone know how to make it show something like this
Quote:
Showing 10-20 of 45 Listings
Thanks,
Nick
__________________
Nick Bowers
68c v4.09 Developer
bowers01 is offline   Reply With Quote
Old 05-07-2009, 08:26 AM   #5
Moderator
 
 
Join Date: Mar 2006
Posts: 4,151
Rep Power: 102
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by bowers01 View Post
Thats what i use but does anyone know how to make it show something like this


Thanks,
Nick
There is a smarty var called {$pageNum} as well which displays the page you are on.

If you have your site to display 10 ads per page then you should be able to do some basic math to display what you want.

if you on the second page....

pagenum times 10 should give you the starting ad number

{$pageNum * 10} would give you the number 20. You probably need to add some logic to detrmine if you on the first page though otherwise ti will say showing 10-10.

add 10 to the above math to get page displayed max ad number

{$pageNum *10+10}

BUT what if you are on page 4 and have only 45 ad? It would say 40-50 of 45 so you need to do some more math to check the values.


Showing
{if $pageNum =="1"}
{$pageNum}
{else}
{$pageNum * 10}
{/if}
-
{if $pageNum *10+10 > $numrows}
{$numrows}
{else}
{$pageNum *10+10 }
{/if}
of
{$numrows}
listings.

The above isnt testd but should give you a start.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Lhotch is offline   Reply With Quote
Old Yesterday, 03:00 AM   #6
Genius At Work
 
bowers01's Avatar
 
Join Date: May 2008
Location: Geelong, Victoria, Australia
Posts: 709
Rep Power: 18
bowers01 is on a distinguished road
Default

This seems to work well.
Code:
Showing 
{if $pageNum =="1"}
{$pageNum} - 15
{else}
{$pageNum*15-15} - 
{/if}
{if $pageNum =="1"}
{else}
{if $pageNum*15 > $numrows}
{$numrows} 
{else} 
{$pageNum*15+15-15 } 
{/if} 
{/if}
of 
{$numrows} 
listings.
__________________
Nick Bowers
68c v4.09 Developer
bowers01 is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show the number of listings in subcategories? AHTOXA v4 Modules / Modifications 8 11-16-2008 03:28 PM
How to display a count of the number of ads in a category j890432m v4 Questions & Support 12 07-15-2008 03:19 PM
Removing number of listings in home.tpl.php SkGold v3.1 Modules & Modifications 8 12-20-2006 10:04 PM
Show customers URL on showlistings.tpl.php marketingsolutions v3.1 Questions & Support 0 11-01-2006 08:38 PM
Display Total Number of Listings Eric Barnes v3.0 Questions & Support 2 03-30-2006 02:29 PM


All times are GMT -4. The time now is 03:18 AM.


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