Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
show only subcategories

 
Reply to topic    Forum Index » Help View previous topic
View next topic
show only subcategories
Author Message
yoshi01



Joined: 22 Jan 2006
Posts: 5
Location: germany

Post show only subcategories Reply with quote
hello out there..



before taking a detailed look on cutenews.ru now, i've used the "normal" cutenews. like all others here, some certain functions of cutenews.ru are very interesting for me, but now - as a dude of poor php-knowledge and no capabilities of russian - i'm totally stuck in the poor documentation.

searches of the english-speaking forum given no answers of my following question:





    for an actual project, for me it would be important to seperate the subcategories from categories of 1st order.



    so i would have displayed categories of 2nd order alone on a given place in template.



    also on choosing a categorie of 2nd order, then additionally categories of 3rd oder should appear, if there are some.

    furthermore i've to mention, the look&feel of this lists should be fully adjustable, shouldn't it?





like i said - unfortunately i've poor knowledge of php; cutephp did well for me 'til now.. with some switches & if/else-stuff i could handle my issues. so i would be very pleased if this could be done in cutenews.ru.



thanks in advance..

yoshi
Sun Jan 22, 2006 5:28 pm View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2818
Location: Germany

Post Reply with quote
The cn_category function is fully adjustable.



Go to plugins/etc.php and look at the cn_category function. You will notice the default values of prefix, template and level.



So instead of using cn_category(); you can use cn_category('put your prefix here', 'put your template here', 'true', '1') or something like this (I never looked at it in detail.)
Sun Jan 22, 2006 9:24 pm View user's profile Send private message
yoshi01



Joined: 22 Jan 2006
Posts: 5
Location: germany

Post Reply with quote
first let me thank you for your reply. but maybe i'm blind, cause i did some hard try&error today with this function..



FI-DD wrote:


So instead of using cn_category(); you can use cn_category('put your prefix here', 'put your template here', 'true', '1') or something like this (I never looked at it in detail.)





every change of level or something ever gave me the whole tree, what's not my intense.

could it be possible, that this isn't working proper.. as you said, never been investigating this (imo. mighty - when work) function..



wonder no one else has needs of this, what gives me the idea, i'm too dumb to understand it.. !?
Sun Jan 22, 2006 9:49 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2818
Location: Germany

Post Reply with quote
Well, the MySQL version of this script has problems with categories/subcategories by now. I hope it gets fixed in the next version. Do you use txtSQL or MySQL?
Sun Jan 22, 2006 10:37 pm View user's profile Send private message
yoshi01



Joined: 22 Jan 2006
Posts: 5
Location: germany

Post Reply with quote
uh - i forgot, sorry..

i'm using txtSql with the will to convert it to mSql in the future.
Sun Jan 22, 2006 10:58 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2818
Location: Germany

Post Reply with quote
Well, I just tested it and it is working for me.



Code:
echo cn_category('&nbsp;', '<a href="[php]cute_get_link($row, category)[/php]">{name} ([php]count_category_entry({id})[/php])</a><br />', true, 1);




Instead of

category

- sub1

-- sub2



the code above shows this:

sub1

- sub2
Mon Jan 23, 2006 2:09 pm View user's profile Send private message
yoshi01



Joined: 22 Jan 2006
Posts: 5
Location: germany

Post Reply with quote
so thank you again - i have to give it one more try.

another issue i posted above is the following - i'd like to show only this:



sub1

sub2

sub3



by choosing "sub2" for example it should appear like this:



sub1

sub2

--nested-sub2

--nested-sub2

sub3



so i only want to show categories of 2nd level. if a 2nd level is choosen, i have to switch or something to another call of the cn_category-function, to show additonally 3rd-level-categories of the choosen 2nd-level-categorie..



i tried some "gefrickel" (you're german too, right!?) with "list_cats" months ago (more than a year propably? time flies) and stopped of not enough spare and not enough "durchblick" in php..

but i think "list_cats" offered this functionality!?



usual i take phpwmcs and that works fine on this issue. but i'm searching hardly for such functions in cutenews, cause its so handy and small projects are realised fast as a lightning... and there's no need of msql of course.



damn.. do you know about a similar script which offers this function?
Mon Jan 23, 2006 2:49 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2818
Location: Germany

Post Reply with quote
I think you can use javascript and css to get results like this. Just like those menues you find everywhere.



So basically you echo out all the categories and subcategories but you hide the subcategories with display:none.

And when you click on a category the javascript changes the display:none to display:block and the subcategory appears.



So all you have to do is add some css to the cn_category_function and get some javascript which handles the showing/hiding. Pretty easy. Wink (Just a joke)





Or you just get such a menue and then you manually add the links to the subcategories. <a href="blablabla/index.php?category=2">Sub 2</a>

And in index.php you have your include code: $category = $_GET['category']; include(cutenews/show_news.php);

That's easy, seriously. Smile
Mon Jan 23, 2006 3:13 pm View user's profile Send private message
odin
Moderator


Joined: 29 Sep 2005
Posts: 138
Location: Poland

Post Reply with quote
CSS Very Happy ?



Do not use display:none. In some explorers it generates small image with red cross Smile EG: Opera ex, ff with Advance Markus Plugin, Nescape ( almost all of them ) and so on.

visibility: hidden



TADA Smile
Mon Jan 23, 2006 4:50 pm View user's profile Send private message MSN Messenger
yoshi01



Joined: 22 Jan 2006
Posts: 5
Location: germany

Post Reply with quote
odin.. dzienkuje for this hint..

even if there are 2% or less of other clients than moz 1+ and crappy ie 6+ on my serverlogs. mostly bots, i think



fi-dd..

i got this function working now - don't now if it fits exactly..

i will investigate this tonight.. thanks again.
Mon Jan 23, 2006 5:18 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.