(Applies to: all versions of FusionBB)
Creating a Menu Item
Please Note:
templates/fusionbb/header_left.php is the header template included and used when you have a left sidebar
templates/fusionbb/footer_right.php is the template file included and used when you have a right sidebar..
templates/fusionbb/header_both.php is the template included and used for the main portal..
Step 1)
In includes/common.php
find:
// Setup the main index link
list($tabopen,$tabclose) = $this -> createNavTab('mainindex');
$template->setTemplateVar("MAININDEX","$tabopen<a href='{$conf['portal_url']}/index.php?$FBB_SESS'>{$lang_str['MAIN']}</a>$tabclose");
Add your nav link as such:
$this->createNavTabSub('mymenu',"<a href='{$conf['home_url']}/myscript1.php?$FBB_SESS'>MENUOPTION1TITLE</a>");
$this->createNavTabSub('mymenu',"<a href='{$conf['home_url']}/myscript2.php?$FBB_SESS'>MENUOPTION2TITLE</a>");
$this->createNavTabSub('mymenu',"<a href='{$conf['home_url']}/myscript3.php?$FBB_SESS'>MENUOPTION3TITLE</a>");
list($tabopen,$tabclose) = $this->createNavTab('mymenu');
$template->setTemplateVar("MYMENU","$tabopen{MYMENUTITLE}$tabclose");
Now, from the above, you get two variables:
MYMENU and mymenu
Step 2)
In templates/header_left.php
find:
<!--MEMBERS-->
and under it place:
<!--MYMENU-->
and also find:
<!--members_sub-->
and place below it:
<!--mymenu_sub-->
That will create a menu with a submenu called games with those things listed below it.
- If you just want to add a link and not a menu:
in common.php
list($tabopen,$tabclose) = $this -> createNavTab('MYLINK');
$template->setTemplateVar("MYLINK","$tabopen<a href='{$conf['portal_url']}/mypage.php?$FBB_SESS'>MYLINKTITLE</a>$tabclose");
and then in header_left.php
find:
<!--MEMBERS-->
and under it place:
<!--MYLINK-->
and also find:
<!--members_sub-->
and place below it:
<!--mylink_sub-->
- To line things up correctly, you need to make sure you placed the submenu item in the correct location in the header_left.php (if using left sidebar, for instance).
In other words, find
<!--MEMBERS-->
and place your menu there as so:
<!--MEMBERS-->
<!--MYLINK-->
and then find (also in header_left.php)
<!--members_sub-->
and place your submenu there
<!--members_sub-->
<!--mylink_sub-->
This is how it lines up correctly: for instance, if you put
<!--mylink_sub-->
<!--members_sub-->
the mylink submenu would line up under members menu
and the members submenu would line up under the My Link menu.