|
|
#1 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Rep Power: 4 ![]() |
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 02:54 PM. |
|
|
|
|
|
#2 |
|
68 Classifieds Staff
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,020
Rep Power: 116 ![]() |
#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 | 68C Mods | Submit a Ticket | 68 @ Twitter | My Modules |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Rep Power: 4 ![]() |
I do have the Developer v4, can you please be more specific on how and what to alter?
Thanks |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jan 2007
Posts: 365
Rep Power: 19 ![]() |
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; } --------------------------------------------------------
__________________
M Michael V4.1.3 Developer - 3 Column Default Template "All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642) |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Rep Power: 4 ![]() |
thanks Michael, it works perfect!
let me know if you hear someone was able to show number of listings for each subcategory |
|
|
|
|
|
#6 |
|
Coder
Join Date: Mar 2006
Posts: 4,442
Rep Power: 108 ![]() ![]() |
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.
|
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Nov 2008
Posts: 2
Rep Power: 0 ![]() |
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 |
|
Coder
Join Date: Mar 2006
Posts: 4,442
Rep Power: 108 ![]() ![]() |
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. |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Nov 2008
Posts: 2
Rep Power: 0 ![]() |
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... |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Jan 2007
Posts: 365
Rep Power: 19 ![]() |
It's been a little while and I was wondering if anyone has successfully addressed the posters opening question; "How to show the number of listings in subcategories?"
I understand Larry's concerns over the "worthless database queries" but if you don't display categories on your home page then it's loading will not be delayed right? Once a user clicks 'Browse' to category.php I would just like them to avoid clicking on empty category links and be shown nothing for their effort. This certainly isn't a high priority, just kinda hoping . . .
__________________
M Michael V4.1.3 Developer - 3 Column Default Template "All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642) Last edited by michael; 06-01-2009 at 07:14 AM. Reason: clarification |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to show listings in sub-categories? | ksuralta | v4 Questions & Support | 19 | 03-12-2009 02:22 AM |
| Hide Address and Phone Number in Listings | goin4savvy | v4 Questions & Support | 2 | 06-18-2008 05:10 PM |
| Not all listings show when I "search listings" | gabs | v3.1 Questions & Support | 6 | 12-29-2006 11:34 AM |
| Showing the number of ads in subcategories on main page | pat01 | v3.1 Modules & Modifications | 6 | 07-19-2006 04:24 PM |
| Show Top Listings On Home Page | zman78 | HTML, CSS, and Design Help | 3 | 04-21-2006 04:32 AM |