Recent Topics

Show only active Subcategories

Started by on Mar 07, 2005 – Contents updated: Mar 07, 2005

Mar 07, 2005 18:00    

Hai

i have searched but nothing found ;-(

i want display only the active subcategories ... is there a way to make that ???

thanx for helping me
makese

Mar 08, 2005 03:52

makese,

I would propose that ANYTHING is possible. However, the reason you probably haven't found much on this subject is that it isn't a very straightforward modification.

First, you would have to define "active" and I see one of two ways ... either a certain number of posts within a time period - or - just ANY post within a time period.

But you said active subcategories. So there are no posts in the main categories? Are there subcategories within the subcategories, or is it simply a 2-level category tree? (i.e. Main 1, which has sub1a and sub1b, Main2 which has sub2a, sub2b, sub2c). THis may have some bearing on the general methodology.

I could see that you would need to write some php to define a date range. (i.e. - get today's date, subtract a week/14days or whatever you deem necessary for being "active"). Then a SQL query, which would require a JOIN statement to get the evo_categories table talking to the evo_posts categories, so that you could get posts with a post_issue_date inside the date range and (b) COUNT the posts within that range for each subcategory (if that's part of your criteria).

The files that you would probably need to modify include the _categories.php file in your particular skins directory (and maybe a file of the same name in the directory right above that, depending on how your _categories.php file is constructed). That will be evident by looking at the first one. And a core file - _functions_cats.php, in the b2evocore folder.

Keep in mind that in one of your _categories.php files, you will see the following:

/*
* WARNING: the category list is displayed recursively.
* This is a little tricky. Don't modify below unless you really know what you're doing!
*/

I don't mean to put you off. I DO want to let you know that I'm sure it's possible and if you're a php/SQL dude, point you in the right direction. However, changing the order of the category listing & coming up with a method of defining a unique class name for each category (so I can format my entries by category) is about as deep into categories as I have gotten.

Perhaps someone here with more experience has a more intimate knowledge of monkeying with those recursive cat displays lists can help you more.

Good luck.

Mar 09, 2005 21:12

soory my english is not the best ;-)

what i only want is that when i have in the categories verry much sub categories like this:

cat1
-sub1a
-sub1b
cat2
-sub2a
-sub2b
-sub2c
cat3
-sub3a
-subsub3a
-subsub3b
cat4

that the output is like that (when i klick on cat3 ):
cat1
cat2
cat3
-sub3a
cat4

and when i klick on catsub3a:
cat1
cat2
cat3
-sub3a
-subsub3a
-subsub3b
cat4

i understand php (just theory) but i dont find a way in the _category.php .. so i need a function how make that

thanx makese
(i mean i have a style see who make that [but forgot where there was] .. that where a start ;-) )

Mar 13, 2005 18:36

hai

i have make that .. yeah .. was simple with css visibility: hidden;

first you must take the _categories.php in the _root the the your _categories.php in the skin folder and copy the _root code into the skin code and delte the inlcude ....

now you can search for some on like that

if( in_array( $cat_ID, $cat_array ) )
		{	// This category is in the current selection


and modefy something ...

if( in_array( $cat_ID, $cat_array ) )
		{	// This category is in the current selection
		 	echo "*";
		echo '<a href="'.url_add_param( get_bloginfo('blogurl'), 'cat='.$cat_ID ).'">->'.format_to_output($cat['cat_name'], 'htmlbody').'</a> ';
		
		}else{
		
		echo '<a href="'.url_add_param( get_bloginfo('blogurl'), 'cat='.$cat_ID ).'" class="hide">'.format_to_output($cat['cat_name'], 'htmlbody').'</a> ';
		}


i have give the link a css class "hide"
like that ...
.hide {
visibility: hidden;
font-size: 0px;

or better ..
ul ul .hide {
visibility: hidden;
font-size: 0px;

it works ... ;-)

thanx makese

Mar 13, 2005 19:22

damned .. it was a good start but the result was no what i want ....

now when the user is in a subsub category the other subroot failed

... i want display the wohle pfad to the aktive category with the aktuel subcat and the wohle root withou subcat

i hope that is better understand

thnax
makese

Mar 14, 2005 03:25

I'm working through your english here ... which, I must admit, is WAY better than my (whatever language you speak ;) )

You know, it sounds as though you want a CSS active, nested sub-list display.

There are a number of sites that discuss this as an option. One of my favorite is at http://css.maxdesign.com.au

Have a look there and maybe you will find what you are looking for. Here's one that may be close to what you're thinking - [url=http://css.maxdesign.com.au/listamatic2/vertical11.htm]"Pop-open List"[/url]

Hope this helps.

-Scott


Form is loading...

Build your own site! – This forum is powered by b2evolution CMS, a complete engine for your website.