FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » [Solved] category and header.tmpl
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
[Solved] category and header.tmpl [message #31964] Sun, 28 May 2006 14:13 Go to next message
DiliaK is currently offline  DiliaK   France
Messages: 24
Registered: May 2006
Location: Villeurbanne, France
Karma: 0
Junior Member

Hello,

I would like to put a link on header that appears only when a specified category is choosen.
I tried lot of functions but i don't it appears that i don't understand the FUD code yet Wink .

How should i do this ?


Pat.
http://www.fudforum.fr
Il faut être con pour vivre avec les cons. J'ai essayé, on peut.
San Antonio.

[Updated on: Mon, 29 May 2006 15:27]

Report message to a moderator

Re: category and header.tmpl [message #31965 is a reply to message #31964] Sun, 28 May 2006 15:35 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The simplest way to do it would be to include a small PHP file inside the header, the job of the file would be to determine the category being viewed at this time. This can be done by looking @ the category id, forum id, message id or topic id being currently viewed.

FUDforum Core Developer
Re : category and header.tmpl [message #31966 is a reply to message #31964] Sun, 28 May 2006 15:53 Go to previous messageGo to next message
DiliaK is currently offline  DiliaK   France
Messages: 24
Registered: May 2006
Location: Villeurbanne, France
Karma: 0
Junior Member

Yes, it is that i tried to do without any success.
I tried to make an
<?if ($cat_id = "1"){
required info;
}
?>


Pat.
http://www.fudforum.fr
Il faut être con pour vivre avec les cons. J'ai essayé, on peut.
San Antonio.
Re: Re : category and header.tmpl [message #31972 is a reply to message #31966] Mon, 29 May 2006 00:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
cat_id variable is not always available, you need to check for values passed via GET/POST and use them to identify the desired category.

FUDforum Core Developer
Re : category and header.tmpl [message #31980 is a reply to message #31964] Mon, 29 May 2006 10:53 Go to previous messageGo to next message
DiliaK is currently offline  DiliaK   France
Messages: 24
Registered: May 2006
Location: Villeurbanne, France
Karma: 0
Junior Member

Yes! Thank you for your help.

Pat.
http://www.fudforum.fr
Il faut être con pour vivre avec les cons. J'ai essayé, on peut.
San Antonio.
Re : category and header.tmpl [message #31982 is a reply to message #31964] Mon, 29 May 2006 15:26 Go to previous messageGo to next message
DiliaK is currently offline  DiliaK   France
Messages: 24
Registered: May 2006
Location: Villeurbanne, France
Karma: 0
Junior Member

Found.

It will be possible to make header and footer look as we want.
Calling css id for example.
One header and footer look per category is possible with it.

header.tmpl sample example:
<? 
# I search category 1 :
    
if ($_GET['cat'] == '1') {
echo "  That i want to do or appear on header if category == 1 ";
}
else {
echo " That i want if this is an other category or main page. ";
}
?> 


Don't forget to rebuild theme Wink


Pat.
http://www.fudforum.fr
Il faut être con pour vivre avec les cons. J'ai essayé, on peut.
San Antonio.
Re : [Solved] category and header.tmpl [message #31994 is a reply to message #31964] Tue, 30 May 2006 05:47 Go to previous messageGo to next message
DiliaK is currently offline  DiliaK   France
Messages: 24
Registered: May 2006
Location: Villeurbanne, France
Karma: 0
Junior Member

Not solved entierely...
When we go in cat it works because the cat id is on url but when we go on threads or topics it is not working anymore because the cat id is not on url.

Searching ...


Pat.
http://www.fudforum.fr
Il faut être con pour vivre avec les cons. J'ai essayé, on peut.
San Antonio.
Re: Re : [Solved] category and header.tmpl [message #32007 is a reply to message #31994] Tue, 30 May 2006 23:38 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
In those cases you need to take the message or thread id and resolve them to a forum, from which you can fetch the category id.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: PATH_INFO theme option
Next Topic: How to import a theme ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 23:23:20 GMT 2024

Total time taken to generate the page: 0.02600 seconds