Support Forums

Displaying all subcats ads under main cat

This is a discussion on Displaying all subcats ads under main cat within the Templates, HTML, CSS, and Design Help forums, part of the General category; I would like to state my current version just so this clarify's the possibilities. V4.2.2. Developer. Basically what I am ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 04-07-2011, 03:11 PM   #1
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default Displaying all subcats ads under main cat

I would like to state my current version just so this clarify's the possibilities. V4.2.2. Developer.

Basically what I am looking for is to display all the subcats listings on my main cat, e.g. Vehicles -> Cars, Trucks, etc. Since I restricted people from adding their ads under the main cat and skip the sub cats, this gives me 0 ads under my vehicles category. Simply to add simplicity for users that are not looking for something in particular, I wanted to make this available to them.

In simplified terms, I do not want people posting under the main cat but I want to display all the ads of its subcats under the main cat. (Not sure if that help lol)

Where should I start? Are there resources out there that can help me accomplish this? Is there simply one line that I must change or perhaps change something in a plugin?

Thanks.

Last edited by EnergyFreak; 04-07-2011 at 03:14 PM.
EnergyFreak is offline   Reply With Quote
Old 04-07-2011, 03:49 PM   #2
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default

Search the forum. There are several threads about how to do this with developer version by modifying category.php. Some may now be out of date but I do remember one thread which gave the solution to do just what you are seeking to do.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 04-07-2011, 06:36 PM   #3
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default

I found some of the code from Eric on the forum, He posted this solution a while back:

To show all listings open category.php and find:
$showlistings='N';

Change to:
$showlistings='Y';

Find:
$options['section']=$sec;
Change to:
if(isset($sec)) {
$options['section']=$sec;
}

Last edited by EnergyFreak; 04-08-2011 at 05:49 PM.
EnergyFreak is offline   Reply With Quote
Old 04-08-2011, 05:49 PM   #4
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default

This code works, although it does not for me because I do not let anyone post in the main cats, they have to post in the sub-cats, therefore this code makes the main cats display all the ads from every cat onto each main cat.

Can this code be changed to my needs?

Last edited by EnergyFreak; 04-08-2011 at 06:00 PM.
EnergyFreak is offline   Reply With Quote
Old 04-08-2011, 06:37 PM   #5
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,310
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I would try this:
PHP Code:
if(isset($sec) && $sec XX) {
$options['section']=$sec;

$sec = XX <-- replace XX with the category id for your category

Dont forget to add inline comments on ALL MODIFICATIONS that you make to make it easier to identify before you upgrade in the future.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out

Last edited by Mike-N-Tosh; 04-08-2011 at 06:58 PM.
Mike-N-Tosh is offline   Reply With Quote
Old 04-08-2011, 07:17 PM   #6
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,145
Rep Power: 68
John Snyder is a jewel in the rough
Default

Here is a bit of untested/unsupported code to get you started in the right direction.

open category.php

add in on line 80 (since you don't want to allow ads it won't show ads)

PHP Code:
$showlistings "Y"
below on line 92:

find:

PHP Code:
$options['section'] = $sec
change to:

PHP Code:
//$options['section'] = $sec;
 
$arr_childs = array();
 
$Categories->get_ids(array($sec));
 
$options['arr_childs'] = $arr_childs
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 04-11-2011, 10:05 PM   #7
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default

@ John Snyder. The code works and displays all the ads of the child categories under the main category, except that, now the child categories do the same and display all the ads of that category as well. Instead of displaying only the child category ads. Oh and thanks for the input!
EnergyFreak is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Categories and subcats on home page sbhkma Templates, HTML, CSS, and Design Help 8 04-02-2010 01:53 PM
If no subcats damiun Customizations 7 12-01-2009 01:20 PM
How can I show more than 3 subcats on the frontpage? michael Technical Support 5 04-17-2007 03:15 PM
Adding Subcats to category page (Browse) garysr Templates, HTML, CSS, and Design Help 2 06-08-2006 12:50 PM


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


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