Version: 1.00, by Natch
Developer Last Online: Apr 2022
Version: 3.0.3
Rating:
Released: 08-02-2004
Last Update: Never
Installs: 16
No support by the author.
What this does: creates a Navigation menu (best as a left or right side block) which is populates automagically by the custom pages you have inserted into your CMPS. It should only show the user the pages that they have permissions to view.
Step 1: create and upload a new module modules/navmenu.php with the contents
PHP Code:
<?
// edit this var if you wish a custom name for your homepage link
$homepage_name = $vboptions[hometitle];
// end var editing
$nav_menus = $DB_site->query("SELECT pageid,name,title,userperms FROM " . TABLE_PREFIX . "adv_pages");
while($nav_menu = $DB_site->fetch_array($nav_menus))
{
$title = ($nav_menu['pageid']==1) ? $homepage_name : $nav_menu['title'];
$groupperms = explode(",",$nav_menu['userperms']);
$membrperms = fetch_membergroupids_array($bbuserinfo);
foreach($membrperms as $usergroup)
{
if(in_array($usergroup,$groupperms) && ($pagename != $nav_menu['name']))
{
$bgclass = exec_switch_bg(1);
$pagename = $nav_menu['name'];
eval('$pages_menubits .= "' . fetch_template('adv_portal_pagesmenubits') . '";');
}
}
}
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_pagesmenu') . '";');
?>
Step 2: Create a new template adv_portal_pagesmenu with the contents:
Step 3: Create a new template adv_portal_pagesmenubits with the contents:
Code:
<tr>
<td class="$bgclass" style="text-align:right">
<span class="smallfont">
<!-- edit this entry to alter the index.php if your cmps portal has a different filename -->
<a href="$vboptions[homeurl]/index.php?$session[sessionurl]<if condition="$pagename!=home">$vba_options[portal_pagevar]=$pagename</if>" title="link to $title page">$title</a>
</span>
</td>
</tr>
Step 4: Create a new CMPS module, with the following settings (other than the defaults): Module Title: Page Navigation File To Include: navmenu.php Templates used: adv_portal_pagesmenu, adv_portal_pagesmenubits
HTH y'all I like it
Demo <= this shows only one link available due to Guest permissions
Login with test/testicular to see the menu populate with extra pages
EDIT:// Altered the module; if you have installed this prior to now, please update the contents of your module with the edited one above.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
As soon as you start talking arrays i get scared, has anybody attempted to modify this script to work with submenu's or anybody out there that cares to give it a go...
This hack seems to be perfect for my site except that every time I set the module to be active in the left column, it changes my entire page to be one wide column. This baffles me because when I view the source code I see that the td width for this column is still intact at 175 pixels.
I am not sure where to change the code to fix this. Has anyone else had this problem or know what I am doing wrong?