Back to vBulletin 3.0 Add-Ons

vBa CMPS: Dynamic Navigation menu - all your Custom CMPS Pages
Mod Version: 1.00, by Natch

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 16
Released: 03 Aug 2004 Last Update: Never Downloads: 2
Not Supported  

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:
Code:
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
 <tr>
  <td class="tcat">
    <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('cmps_pagesmenu')"><img id="collapseimg_cmps_pagesmenu" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_cmps_pagesmenu].gif" alt="" border="0" /></a>
    <span class="smallfont"><strong>$vba_options[portal_blockbullet] Navigation</strong></span>
  </td>
 </tr>
</thead>
<tbody id="collapseobj_cmps_pagesmenu" style="$vbcollapse[collapseobj_cmps_pagesmenu];text-align:$stylevar[left]">
$pages_menubits
</tbody>
</table>
<br />
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

http://www.mobileforces.org/ <= 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.

Download

No files for download.

Similar Mods

Add-On Releases vBadvanced CMPS Navigation v1.11 Modification Graveyard
vBA CMPS Cleaner Site Navigation - CSS Driven Rollovers vBulletin 3.5 Template Modifications

vblts.ru supports vBulletin®, 2022-2024