Support Forums

subcategory count question

This is a discussion on subcategory count question within the Technical Support forums, part of the Technical Support Forums category; I know this has been asked before, but I want to see if anyone has come up with a solution ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 08-05-2009, 10:10 AM   #1
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 15
MrGForce is on a distinguished road
Smile subcategory count question

I know this has been asked before, but I want to see if anyone has come up with a solution yet.

I only have around 60 subcategories total. On my front page I tell the program to just list the parent categories with the total of all ads in their respective parent categories. That works fine.

I also have just the parent categories showing when you click on the "Browse" link. I did this by remarking out the line in the browse.tpl file that displays the sub-categories also. Then when you click on any of the main categories, it shows the sub-cats under that parent with all the sub-cat totals next to each. So it's picking that info up somewhere.

So how can I get these sub-cat totals to show up when you click on the "Browse" link if I un-remark that line in the browse.tpl file so it shows the parent and all of it's subs with their respective totals?

I believe the sql info is gotten by the includes/classes/kernel/Category.php file, but can't figure out how to make that code include the sub-cat totals when displaying them under the main cats. It only seems to want to display those totals when you're not displaying parent category names.

I believe the code that would do the counting is under the ......

function getSubCategoriesList in the Category.php file

Can someone help with this?

Thanks.



.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Old 08-05-2009, 12:54 PM   #2
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 think this is what you are after. Inside getSubCategoriesList:
Code:
if($Core->settings['showTotal']=='Y')
                {
                    $arr_childs = array($rs['id']);
                    $this->get_ids($arr_childs);
                    $cat[$i]['total']=$this->get_count($arr_childs);
                }
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline  
Old 08-05-2009, 02:53 PM   #3
Customer
 
MrGForce's Avatar
 
Join Date: May 2009
Posts: 241
Rep Power: 15
MrGForce is on a distinguished road
Default

Hi Eric;

But how would I add that info to the browse.tpl file to make it also pick up those totals along with the total for the whole category?

.
__________________
MrGForce

Currently running 68Classifieds v4.1.5 Developer Edition ... Purple Template
MrGForce is offline  
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display a count of the number of ads in a category j890432m Technical Support 12 07-15-2008 04:19 PM


All times are GMT -4. The time now is 01:22 PM.


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