Support Forums

Display all ads and their category

This is a discussion on Display all ads and their category within the Modules / Plugins / Modifications forums, part of the Developer Forums category; I'm trying to display all ads in a category and its subcategory. In the default function getSubCategories, when we select ...


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

Reply
 
Thread Tools Display Modes
Old 08-20-2008, 09:12 PM   #1
Senior Member
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 284
Rep Power: 15
hel68c is just really nice hel68c is just really nice
Default Display all ads and their category

I'm trying to display all ads in a category and its subcategory.

In the default function getSubCategories, when we select a category, it only display the ads listings in that category. I would like to display all ads in that category and sub category. Like advanced search, if we select category we get the listings in that category and sub category but it does not display at the top the category and sub category name.

I made change In function getSubCategories and it display all ads in category and subcategory but not display category name and subcategory name

PHP Code:
I add this line -->     $cat_id=$rs['id'];
I add this line -->     $type_id="&type=$cat_id";
                    
$rs['start_link']='<a href="category.php?cat='.$slug.'">'

I add this line --> $rs['start_link']='<a href="searchresults.php?='.$type_id.'&Submit=Search">'
Sorry for my long explanation but I'm not very well in English!

Do you know where I have to change the code to have this display?
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 08-21-2008, 10:58 AM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

I think you need to edit the category.php file.

Toward the bottom find this:
$options['section']=$sec;

Then replace with:
$arr_childs = array($sec);
$Categories->get_ids($arr_childs);
$options['arr_childs']=$arr_childs;
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 08-21-2008, 11:31 AM   #3
Senior Member
 
hel68c's Avatar
 
Join Date: Jun 2008
Location: Canada, Quebec
Posts: 284
Rep Power: 15
hel68c is just really nice hel68c is just really nice
Default

Exactly what I need,

Thank you Eric!
__________________
Serge
HobbyClassified.com
V4.08 Developper, Module installed (CIV Scam Filter, Maffo Location System, Maffo News,Youtube, Seller Store)
hel68c is offline   Reply With Quote
Old 08-21-2008, 04:47 PM   #4
Senior Member
 
Join Date: Aug 2006
Posts: 122
Rep Power: 17
spaceboy is on a distinguished road
Default

For some reason this code does not work for me at all....

I am using this code:

Open category.php and locate:
$options['section']=$sec;

Replace it with:
$arr_childs = array((int)$sec);
$Categories->get_ids($arr_childs);
$options['arr_childs']=$arr_childs;

from How to show listings in sub-categories?

But this code causes all listings on my entire site to show up on both the Main Categories page and the Parent Category pages

http://abletrader.com/category.php
__________________
Lindsay

developer v3.1.5 and v4
abletrader.com
spaceboy is offline   Reply With Quote
Old 08-21-2008, 05:12 PM   #5
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

You may need to check for the $sec variable. Try this:
PHP Code:
if($sec<>'') {
$arr_childs = array($sec);
$Categories->get_ids($arr_childs);
$options['arr_childs']=$arr_childs;

__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 08-21-2008, 05:36 PM   #6
Senior Member
 
Join Date: Aug 2006
Posts: 122
Rep Power: 17
spaceboy is on a distinguished road
Default

this code gets the same results... all ads show up under main and parent category pages.

is this code working as intended for anyone else? or are others getting similar results?
__________________
Lindsay

developer v3.1.5 and v4
abletrader.com
spaceboy is offline   Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 06:01 AM.


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