PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2007-10-12 21:24:44

archmage
Member
Registered: 2007-10-12
Posts: 17

Setting active tab or page

I am a rather large newbie to PHP in general, so excuse my ignorance.  I have a site that I want to use PunBB for the forums as well as a "portal" page.  I have the forum part set up for the most part.  One thing that is driving me insane though is my inability to find out how to create a custom CSS styled menu that will be on both the portal page and the forums page, have the "active" tab/page highlighted (via CSS), as well as take advantage of the users logged in status (i.e., they see the profile, logout tabs when logged in, etc.).  I did find this page on how to set the CSS for the active page, however I can't figure out how to add this type of stuff in the middle of the function that generates the navlinks.

http://www.sebastiansulinski.co.uk/web_ … button.php

I see this on several other PunBB sites so it is obviously possible, but for the life of me I cannot find squat on how to do it.  Please keep in mind that I just started doing PHP about a week ago and am very frustrated at this point.  There is a lot of information floating around here, but it seems very difficult to find.  Any help is deeply appreciated.  Thanks in advance.
--
archmage

Offline

 

#2 2007-10-12 22:06:03

quaker
Member
From: Bama,USA
Registered: 2006-02-22
Posts: 1064
Website

Re: Setting active tab or page

this might be a good place to start..
http://www.punres.org/desc.php?pid=440

a tab mod

in the css and _cs it is the #brdmenu that u can mod for different effects.


for the active tabs. u will have to add some extra code to the functions.php where the links are.
just compare the $link structure in the functions.php and to the active tabs script on that website.
see how u can combine then into it.
i hope that helps alittle bit.


Q

Last edited by quaker (2007-10-12 22:11:36)


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#3 2007-10-12 22:19:44

archmage
Member
Registered: 2007-10-12
Posts: 17

Re: Setting active tab or page

Wow, that was entirely too easy.  Just CSS.  Many thanks good quaker.  You are truly the man.

/bow

Offline

 

#4 2007-10-12 22:20:36

quaker
Member
From: Bama,USA
Registered: 2006-02-22
Posts: 1064
Website

Re: Setting active tab or page

instead of #mainnav u can change those css to #brdmenu sorta just replace everthing to brdmenu and play with the functions.php make a backup copy of the functions.php just in case..haha....

Q


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#5 2007-10-12 22:26:03

archmage
Member
Registered: 2007-10-12
Posts: 17

Re: Setting active tab or page

Since I seem to have you on the line here, I don't suppose you know how to fix this quirk?  I can't seem to change the name/title on the forums tab.  It right now is "Index" as seen here.

$links[] = '<li id="navindex"><a href="link">'.$lang_common['Index'].'</a>';

If I change it to say 'Forum', the text disappears from the menu bar at render time.  I am going to be using a portal page is the home/news page, so I'd prefer this to read as 'Forum'.

Thoughts?
--
archmage

Offline

 

#6 2007-10-12 22:29:23

quaker
Member
From: Bama,USA
Registered: 2006-02-22
Posts: 1064
Website

Re: Setting active tab or page

$links[] = '<li id="navforum"><a href="forum.php">'.$lang_common['Forum'].'</a>';
$links[] = '<li id="navindex"><a href="link">'.$lang_common['Index'].'</a>';

since the forum is in the lang files u just simple replace anything there from index to forum that how i add my forum links instead of going threw the admin-options add links
login ur site go to administration
next go to options towards the bottom u will see how to add links to the menu form there. but i always hard code the links straight to the functions.php ....

Q


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#7 2007-10-12 22:31:13

quaker
Member
From: Bama,USA
Registered: 2006-02-22
Posts: 1064
Website

Re: Setting active tab or page

for none links u can do this...
$links[] = '<li><a href="link.php">'.'Index'.'</a>';

and they will show up!


what i mean is if the links are not listed in the lang file then u can simply do this above to add links..
Q

Last edited by quaker (2007-10-12 22:32:17)


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#8 2007-10-12 22:37:52

quaker
Member
From: Bama,USA
Registered: 2006-02-22
Posts: 1064
Website

Re: Setting active tab or page

im always learning new stuff as i go along. i finally broke down and coded my first index mod. and it seem very good.

example : http://bunpai.com


just ask the Q ill try to help or find the answer...

Q


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

#9 2007-10-12 22:41:53

archmage
Member
Registered: 2007-10-12
Posts: 17

Re: Setting active tab or page

Wow, man you are putting on a clinic here!  smile

Okay, new question.  Everything you've shown me is dead-on.  Now, my link in the menu bar says 'Forum' (woot!), but the active tab CSS no longer fires.  Here's how I have it in the style sheet (example).

#punindex #brdmenu li#navindex a, #punforum #brdmenu li#navforum a {style;}

All the others still work just fine.  How do I make PunBB recognize the http://URL/forums/index.php as 'punforum'?

You are brilliant man.

Offline

 

#10 2007-10-13 00:36:00

archmage
Member
Registered: 2007-10-12
Posts: 17

Re: Setting active tab or page

Hmm.  Well, some progress on this.  If I rename forum/index.php to forum/forum.php then the CSS takes.  However, this breaks all the redirects such as when you logout or back in. 

Also, for my home page (the portal page), I'd like it to be named 'News' on the tab instead of 'Index'.  Is there a way to do this?

Offline

 

#11 2007-10-13 13:00:23

quaker
Member
From: Bama,USA
Registered: 2006-02-22
Posts: 1064
Website

Re: Setting active tab or page

can u provide a link to the site?
the index is the main url for the forum. u would have to undo the renaming part to get it to recognize the as punforum.
i would look at the tab.css if u used that and make sure that it coded to ur spec. and check the link menu in the functions to add that code form the site to get it to use the active tab system.
i have created several different frontpage mods do display different stuff. one site that is heavy moded  and i really need to work on the menu bars is example:http://modelcrowd.com i ported the style over from wordpress theme and made my own menu bar for it. i seperated the navbar and the sidebar menu to display certain links which im not finished with it..lol.

ill try to look at making the tab and functions.php for the active tabs.
email me the links and if u got msn or aim or yahoo id.


Q


My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.