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
  #12  
Old 08-03-2004, 05:15 PM
Silverdawn222 Silverdawn222 is offline
 
Join Date: Jun 2003
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

Can't seem to visit that thread, even when I register... But thanks.
Reply With Quote
  #13  
Old 08-03-2004, 06:38 PM
House_of_Crazed House_of_Crazed is offline
 
Join Date: May 2004
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, same here.

I suspect that Boofo will verify people as being members here since he is also a Moderator here and I'm sure he has the capability of seeing if they are verified & etc...

HoC
Reply With Quote
  #14  
Old 08-04-2004, 01:13 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Natch how to get the result of links in the centerblock as in your example?
Reply With Quote
  #15  
Old 08-04-2004, 09:15 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure I understand the question - there's nothing in my hack that is not in standard CMPS - it's just Custom Pages - I am just parsing the adv_pages table for userperms and pages and outputting an array of links...
Reply With Quote
  #16  
Old 08-04-2004, 11:44 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then i hope you specify the use of this function a bit better because when i add urls in the template they all open in blanc pages, not in the center block. Maybe i'm missing something.
Reply With Quote
  #17  
Old 08-04-2004, 11:56 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You don't add URL's in the template ... that's the whole point!

1. Do you have the CMPS installed?
2. Do you have any custom pages installed?

You can install this, leave the DEFAULT templates, and you will have a navigation menu with all your custom CMPS pages added.

If you want to add new links to this (NOT SUPPORTED - this is not the point of this hack), you will need to ensure they have target="_parent" in the <a href definition or you will open links in new pages (as per the default vB behaviour...
Reply With Quote
  #18  
Old 08-04-2004, 12:14 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

DMPS? You mean CMPS.... It looks i have to look more often on the vbadvanced homepage
Reply With Quote
  #19  
Old 08-04-2004, 01:53 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have a serious question?
Reply With Quote
  #20  
Old 08-04-2004, 01:59 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes i have. Now this is installed i can't see how to create new links to it that open content in centerblocks as on your example site.
Reply With Quote
  #21  
Old 08-04-2004, 02:58 PM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I suggest you read the manual for CMPS - in your CMPS admin cp you have the facility to "Create Page" - this will call on a new template, or simply a construction based on the modules you have already installed ...

Well if you create a template and add that intothe page definition up the top there,m then that tempalte's contents will go intothe place of the "Custom PAge Content" module in the center at the top of your custom page ...

Make sense ?

Now I had heaps of content from my old vBindex install - I just used those templates for my custom pages - I have customised this hack to not list all the custom pages - I have about 50 extra pages that are linked behind the "Tutorials" vB dropdown menu - this menu is populated automagically using a different script I dev'ed up. So my version of this has an extra bit that adds AND !strstr("tut-",$pagename) to the determination of the items for the menu so that these aren't displayed in the NAvigation menu - but that's just for me - you can see far more Custom Page content by looking at the Tutorials menu...

I hoppe that makes things a bit clearer.
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:48 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.04560 seconds
  • Memory Usage 2,316KB
  • 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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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