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.
Upfdated to get rid of a small bug: if you are getting multiple instances of each item for users who are in more than one usergroup, please update your module with the module code in the first post.
woow this is one step further to get a function i once mentioned...links that open content in the centerblock and in that content a respond/comment field on newsitems from external cms progs.