Support Forums

Getting this code for categories to work

This is a discussion on Getting this code for categories to work within the Technical Support forums, part of the Technical Support Forums category; What version of 68 Classifieds are you running? Example: V4.1.10 Developer What template are you using? Custom Made template (but ...


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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 08-23-2010, 09:56 AM   #1
Customer
 
Join Date: Aug 2010
Posts: 100
Rep Power: 4
T0m1 is on a distinguished road
Default Getting this code for categories to work

What version of 68 Classifieds are you running?
Example: V4.1.10 Developer

What template are you using?
Custom Made template (but already tested on default)


Please describe in detail the issue you are having:
I have been digging and trawling through the forums as I am wanting to achieve something in particular.
On my site I intend to have my main categories withs ub categories, as an example;

Household Furnishing
--Kitchen Appliances (*)
--Bedroom Furniture (*)
--Flooring (*)
--Others (*)

Cars, Motorbikes & Vehicles
--Cars (*)
--Motorbikes (*)
--Commercial Vehicles (*)

Now I want people to be able to choose and list items in the sub categories (marked with a * ) but not in he main categories. This I can do already by turning "Allow Ads" to No from yes.
But I want to list and paginate all entries from all its sub cats within the main category. The idea being is that people have to navigate back and forth less, every listing is shown easily but further drill down is possible (by navigating into a sub category).

I have found this thread How to show listings in sub-categories? Which gives me a sort of fix.

Eric mentioned to replace this code
Code:
$options['section']=$sec;
in the category.php file with this code
Code:
$arr_childs = array((int)$sec);
$Categories->get_ids($arr_childs);
$options['arr_childs']=$arr_childs;
This does indeed work in that it will take entries from the subcategories and list these nicely. If I then turn "Allow Ads" to No this code obviously stops working because that section is wrapped (as Eric mentioned) in an if statement

if($showlistings=="Y")

Eric suggested perhaps changing this to

if($showlistings=="Y" || $showlistings=="N")

Now this does again allow the output of listings BUT it shows every listing held int he database and not only those from the subcateogries within the current main category.

Any help would be greatly appreciated.

Many thanks,
__________________
Tom.

68c Developer v4.1.10 - Very Custom Template
MySQL v5.0.91-community <-> PHP v5.2.13 <-> Apache v2.2.15

Experience is the name we give to our mistakes
T0m1 is offline   Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does the {if} work damiun Technical Support 12 08-05-2009 02:10 PM
Does Maffo's Location mod work with the US zip code module from 68 classifieds? fendter Technical Support 1 07-23-2008 07:32 AM
Are we able to charge certain categories and keep other categories free? Success Technical Support 5 04-02-2008 05:49 PM
Static Categories and Sub-categories list Tim_A Technical Support 0 06-08-2007 09:41 AM
Will this work? ropingtony Pre Sales Questions 4 07-19-2006 11:02 AM


All times are GMT -4. The time now is 02:28 AM.


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