This is a discussion on How to show the number of listings in subcategories? within the v4 Modules / Modifications forums, part of the Help & Support category; Does anyone know? or has anyone done this? is it possible? #1. How to show the number of listings in ...
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Does anyone know? or has anyone done this? is it possible?
#1. How to show the number of listings in subcategories? #2. How to make subcategories be displayed 1 per line, not all in 1 line? Like so: Autos (15) -> Honda (5) -> Nissan (5) -> Toyota (5) This is what I got so far Autos (15) Honda Nissan Toyota ... Please help, thank you so much Last edited by AHTOXA; 09-07-2008 at 03:54 PM. |
|
#2
|
||||
|
||||
|
#1 is not currently possible.
#2 is possible but would require the developer edition. You would need to alter the getSubCategoriesList in the Categories class.
__________________
Eric Barnes 68 Classifieds Developer Please do not send me a private message asking for support. Instead use these open forums or our ticket system. Customer Area | Issue Tracker | Documentation | Submit a Ticket | Twitter |
|
#3
|
|||
|
|||
|
I do have the Developer v4, can you please be more specific on how and what to alter?
Thanks |
|
#4
|
||||
|
||||
|
For [2]:
Go to includes>classes>kernel>Categories.php and insert a <br /> where shown. I've also the increased limit to 99 to ensure all subcats are displayed. -------------------------------------------------- function getSubCategoriesList($parent, $limit=99) { global $db; $add_cats=''; $sSQL2 = "SELECT id,name,slug,image,cLink FROM ".PREFIX."categories WHERE parent_id = ".$parent." AND display<>'N' ORDER BY cORDER DESC, name ASC LIMIT ".$limit; $result2=$db->query($sSQL2); while($rs=$result2->fetch()) { if($rs['cLink']<>"") { $add_cats.='<a href="'.$rs['cLink'].'">'.htmlspecialchars($rs['name']).'</a><br />'; } else { $slug = ( empty($rs['slug']) ) ? $rs['id']: $rs['slug']; $add_cats.='<a href="category.php?cat='.$slug.'">'.htmlspecialcha rs($rs['name']).'</a><br />'; } } if($add_cats=="") { $sub=htmlspecialchars($rs['description']); } else { $sub='<div class="small">'.$add_cats . LANG_DOT_DOT_DOT.'</div>'; } return $sub; } --------------------------------------------------------
__________________
v4.09 Developer MKClassifieds "All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642) |
|
#5
|
|||
|
|||
|
thanks Michael, it works perfect!
let me know if you hear someone was able to show number of listings for each subcategory |
|
#6
|
||||
|
||||
|
Just and FYI, This used to be a standard feature a couple versions ago but doing all those worthless database queries really slows things down so most ended up disabling it.
__________________
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 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
#7
|
|||
|
|||
|
I'm new to 68Classifieds so you'll have to forgive me if there is a point I am missing out.
Sounds easy. Add a "counter" field to the categories table, then use one of the two following options ; or better, mix both. 1. Modify all files that add/edit/delete/expire ad posts to update the corresponding "counter" field. 2. Add a cron job to update the "counters". Finally, update the templates accordingly. Thoughts anyone? |
|
#8
|
||||
|
||||
|
Sure, that would work and technically speaking likely pretty easy to do however it would invloved modifying quite a few files so the question then becomes is it worth the time?
The next question is when an a new version of 68c comes out and one of your modded files changes you have to transfer over you shanges for the counter column, so does the extra work in managing this "feature" worth it? Not for me personally.
__________________
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 68 Classifieds Important Links Customer Area | Issue Tracker | Knowledge Base | User Manuals |
|
#9
|
|||
|
|||
|
Sure.
Nonetheless, you could stick only with the cron job and the "counter" field. When upgrading, you would only have to worry about the "counter" field (and not modified files). Of course, a custom module would be in charge of "filling in" the "counter" fields, so an upgrade would not require modifying any files (unless the upgrade requires all modules to change their behaviour, which would impact all modules and not only this one). This solution was especially ment to address the "worthless database queries". I suppose caching those database queries would also leverage the impact of these "worthless queries". 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?" Finally, can you think of any other simple solution ? Just my two cents worth... |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hide Address and Phone Number in Listings | goin4savvy | v4 Questions & Support | 2 | 06-18-2008 06:10 PM |
| How to show listings in sub-categories? | ksuralta | v4 Questions & Support | 16 | 04-28-2008 02:08 PM |
| Not all listings show when I "search listings" | gabs | v3.1 Questions & Support | 6 | 12-29-2006 12:34 PM |
| Showing the number of ads in subcategories on main page | pat01 | v3.1 Modules & Modifications | 6 | 07-19-2006 05:24 PM |
| Show Top Listings On Home Page | zman78 | HTML, CSS, and Design Help | 3 | 04-21-2006 05:32 AM |