Support Forums

How to show the number of listings in subcategories?

This is a discussion on How to show the number of listings in subcategories? within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Originally Posted by jonathan.melnick Also, I would expect this feature to be part of the core. Each and every client ...


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

Reply
 
Thread Tools Display Modes
Old 06-01-2009, 02:04 PM   #11
curmudgeon
 
Join Date: Mar 2006
Posts: 5,416
Rep Power: 139
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by jonathan.melnick View Post
Also, I would expect this feature to be part of the core. Each and every client for which I have had to implement classifieds has requested this feature. If they want it, anything is worth it. I really don't see myself telling them: "Well, it's possible, but it makes my job a lot harder, so if you don't mind, we'll skip that one, ok?"
My stance has nothing to do with the difficulty in performing the task. It has to do with practicality. In IT the customer IS NOT always right. They hired you because you were the expert, which to me means that you should not only be able to accomplish what they ask BUT you should also be able to explain to them the ramifications of doing what they ask. This isnt about avoiding a time consuming task, its about doing the right thing, educating the client and not just taking their money for something they ask for because they ask for it.

As for it being built into the core, some people have hundreds of categories, I know a few with a couple thousand. This means to get a count of the number of ads in a cat, every category would need to be queried. Why add hundreds of additional database queries to a page load? Is displaying the number of ads in a category that important? Whats the benefit?

If a category has no ads and your worried about people clicking on it and not seeing anything then perhaps they should spend more time on site marketing so there are ads on their site to look at.


Quote:
Originally Posted by jonathan.melnick View Post
Finally, can you think of any other simple solution ?
The simplest solution would be to edit the getSubCategoriesList function and add an additional query for each cat to get a count of records and then display it with the category name.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 06-01-2009, 02:12 PM   #12
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,489
Rep Power: 136
Eric Barnes is just really nice Eric Barnes is just really nice
Default

I am just picking up on this thread but from reading it if this is a must I would go with a module and then hook into the cron job to update a new category table field for the number of listings. This is ran once daily and unless you are getting hundreds of new ads a day I don't think it would really hurt to show a number that may be less. I for one have never visited a site that showed a number and then went and actually counted to make sure it was right.

When the script generates the number of listings it creates a LOT of over head. The way it is setup it starts with the parent and then loops through all the children to get the total number in the parent and all children. So with lots of categories it can force your site to a crawl.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 06-01-2009, 02:35 PM   #13
Just get on with it!
 
michael's Avatar
 
Join Date: Jan 2007
Location: Milton Keynes, England
Posts: 507
Rep Power: 36
michael is just really nice michael is just really nice
Default

Larry, Eric, thanks for the insight. Content to let this go.
__________________
M Michael
V4.2.3 Developer - Sigma Template


"All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642)
michael is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show listings in sub-categories? ksuralta Technical Support 19 03-12-2009 03:22 AM
Hide Address and Phone Number in Listings goin4savvy Technical Support 2 06-18-2008 06:10 PM
Show Top Listings On Home Page zman78 Templates, HTML, CSS, and Design Help 3 04-21-2006 05:32 AM


All times are GMT -4. The time now is 04:49 AM.


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