Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

How to check current category?

Aloittaja Elmacik, joulukuu 11, 2005, 08:08:25 IP

« edellinen - seuraava »

Elmacik

For example I want to display some special things when the user is in "bla bla" category..
How to check it ?
Very clumsily I tried:
if ($context['boards']['id'] == 1)
Didnt work..
Home of Elmacik

Thantos

When on the message index:
$context['linktree'][1]['name'] will get you the category name
if you need the id:
$catid = explode('#', $context['linktree'][1]['url']);
$catid = $catid[1];

Elmacik

MikeMill,
Thanks a lot but I asked the question wrong I think.. Sorry.
I wanted to do it for a spesific board (and not a category)

For example if the user is in board 3, he/she will see something like "you are viewing board 3"
Home of Elmacik

Thantos


Elmacik

Thanks MikeMill..
But I couldnt achieve to check it :(
if ($context['current_board']['id'] == 3) echo 'bla bla bla';

Whats wrong with it then?
Home of Elmacik

Thantos

if ( $context['current_board'] == 3 )

Elmacik

What do I get wrong? I had tried it but didnt work.. Now its ok.. How stupid I am >:(
MikeMill, thanks a lot..
Home of Elmacik

Advertisement: