Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBa CMPS: Dynamic Navigation menu - all your Custom CMPS Pages Details »»
vBa CMPS: Dynamic Navigation menu - all your Custom CMPS Pages
Version: 1.00, by Natch Natch is offline
Developer Last Online: Apr 2022 Show Printable Version Email this Page

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:
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

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.

Comments
  #2  
Old 08-03-2004, 01:24 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't belong to the hack but: Which journal script are you using? Looks nice
Reply With Quote
  #3  
Old 08-03-2004, 01:37 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found on www.bearfacts2.com - Boofo's site - they are working on it over there

OblivionKnight, sabert00the, Bane and Boofo (hope I didn't leave anyone out)
Reply With Quote
  #4  
Old 08-03-2004, 01:52 PM
Silverdawn222 Silverdawn222 is offline
 
Join Date: Jun 2003
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Loving this hack! Also, regarding the Journal hack on the site you mentioned: don't see it. Can you tell me where to look?
Reply With Quote
  #5  
Old 08-03-2004, 02:41 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-03-2004, 03:07 PM
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Posts: 893
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yup, nice hack and nice journal too....
Reply With Quote
  #7  
Old 08-03-2004, 03:56 PM
weirdpixels's Avatar
weirdpixels weirdpixels is offline
 
Join Date: Aug 2003
Location: England
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack!
*clicks install
Reply With Quote
  #8  
Old 08-03-2004, 04:53 PM
Silverdawn222 Silverdawn222 is offline
 
Join Date: Jun 2003
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fix works, thanks. Also, I still don't see the journal. I know that's not what this thread is for, but I'm really wondering.
Reply With Quote
  #9  
Old 08-03-2004, 04:54 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@Silverdawn222
http://www.bearfacts2.com/forums/showthread.php?t=804
Reply With Quote
  #10  
Old 08-03-2004, 05:15 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:40 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06677 seconds
  • Memory Usage 2,301KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete