![]() |
|
#1
|
||||
|
||||
|
Inspired by the many requests for Zachery's original navbar change and the fact that I needed something to work with vBa Gallery and vBa Links, instead of just vBa CMPS, I came up with the following....
These changes assume that you are running all of the vBa products (CMPS, Gallery, Links) but if you are not then you can just remove the code in the template as needed. For example, if you're using vBa Gallery but not vBa Links simply remove the "if" statement dealing with vba Links. ![]() Description: These changes will change your navbar to dynamically display either Home, Forum, Gallery, and Links based upon where you are. If you are in the portal you'll see "Forums Gallery Links" but if you are in the Gallery you'll see "Home Forums Links" and if you're in the forums you'll see "Home Gallery Links", etcetra. Changes: 1 file change, 1 template change Step #1 -- Modify your "cmps_index.php" file NOTE: Skip Step #1 if you are running CMPS 2.x.x or above; this change is now part of the standard installation. You may have renamed "cmps_index.php" to "index.php" or other name that best suited your needs so whatever you named the file edit it and look for... PHP Code:
PHP Code:
Step #2 -- Modify your navbar template Go into your "navbar" template and look for... PHP Code:
PHP Code:
Last edited by KW802; 07-05-2005 at 07:43 PM. |
|
#2
|
||||
|
||||
|
PS #1: If you're not familiar with modifying your templates, go into your Administrator Control Panel (ACP) --> Styles & Templates --> Style Manager --> {select your parent style} Edit Templates --> Navigation/Breadcrumb Templates --> navbar.
PS #2: If you want to see this in action, visit here and go back & forth between the home page, forums, Gallery, and Links.
|
|
#3
|
||||
|
||||
|
Sweet! Works like a charm..
Last edited by mholtum; 03-30-2005 at 05:32 PM. |
|
#4
|
|||
|
|||
|
awesome! just what I needed!
|
|
#5
|
|||
|
|||
|
Your The man
|
|
#6
|
|||
|
|||
|
I just did this:
PHP Code:
Dennis EDIT: DHO!!!! <smirk> Last edited by dsboyce8624; 05-17-2005 at 06:45 PM. |
|
#7
|
||||
|
||||
|
"Dorum's"?
|
|
#8
|
|||
|
|||
|
10q very much! work fine
|
|
#9
|
|||
|
|||
|
I'm using vBa CMPS & vBa Gallery only & this did eactly what I wanted the first time I tried it.
Can't thank you enough KW802
|
|
#10
|
|||
|
|||
|
This is what I wanted but one problem. My Gallery and links are a sub dir.
www.xxxxx.com/Forum/gallery/ & /Forum/links/' not: www.xxxxx.com/gallery Any help as to what and where I add to the template?
__________________
Curt
|
|
#11
|
||||
|
||||
|
One9er, instead of using "$vboptions[homeurl]/gallery" & "$vboptions[homeurl]/links" it'd be ""$vboptions[bburl]/gallery" & "$vboptions[bburl]/links" for you.
|
|
#12
|
|||
|
|||
|
Thanks Kevin!
__________________
Curt
|
|
#13
|
|||
|
|||
|
Quote:
|
|
#14
|
||||
|
||||
|
Minor addendum: Step #1 above is not needed if you're running CMPS 2.x now.
|
|
#15
|
|||
|
|||
|
I am a little messed up on this as I had mine installed in a directory as well.
my install is in a directory called /bulletin/ After I added this code, and changed the [homeurl] to [bburl] my home and portal links are backwards, meaning that the link to home is taking me to the forums and the link to forums is directing to the portal.. I am all messed up. Can someone take a look at my navbar and recode it to suite my needs. I would also like to keep my current "Links" Directory menu drop down and wouldn't mind including a drop down for the gallery menu as well that included the following options. Gallery >Home >Category Admin >Upload Images >10 newest images >Top rated images >Top Viewed Images Here is my current navbar code with the links dropdown already in: Code:
<script type="text/javascript">
<!--
function log_out()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
if (confirm('$vbphrase[sure_you_want_to_log_out]'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}
//-->
</script>
<!-- breadcrumb, login, pm info -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" width="100%">
<if condition="is_array($navbits)">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="bottom">
<td><a href="#" onClick="history.back(1)"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a></td>
<td> </td>
<td width="100%"><span class="navbar"><a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>
</tr>
<tr>
<td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink.gif" alt="$vbphrase[reload_this_page]" border="0" /></a> <h1 class="showthreadh1">$navbits[lastelement]</h1></td>
</tr>
</table>
<else />
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>
</td>
<if condition="$bbuserinfo['userid']">
<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">
<!--<span style="float:$stylevar[right]">[<a href="login.php?$session[sessionurl]do=logout&u=$bbuserinfo[userid]" onclick="return log_out()">$vbphrase[log_out]</a>]</span>-->
<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong><br />
<phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
<if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if>
</div>
</td>
<else />
<td class="alt2" nowrap="nowrap" style="padding:0px">
<!-- login form -->
<form action="login.php" method="post" onSubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
<tr>
<td class="smallfont">$vbphrase[username]</td>
<td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="$vbphrase[username]" onFocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
<td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />$vbphrase[remember_me]</label></td>
</tr>
<tr>
<td class="smallfont">$vbphrase[password]</td>
<td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
<td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="4" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td>
</tr>
</table>
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="forceredirect" value="1" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<!-- / login form -->
</td>
</if>
</tr>
</table>
<!-- / breadcrumb, login, pm info -->
<!-- nav buttons bar -->
<div align="center"><table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px">
<tr align="center"><if condition="$show['registerbutton']"><td class="vbmenu_control"><a href="/bulletin/register.php?$session[sessionurl]">$vbphrase[register]</a></td></if>
<if condition="THIS_SCRIPT != 'adv_index'">
<td class="vbmenu_control"><a href="$vboptions[bburl]/?$session[sessionurl]">Home</a></td>
</if>
<if condition="defined('VBA_SCRIPT')">
<td class="vbmenu_control"><a href="$vboptions[bburl]/$vboptions[forumhome].php?$session[sessionurl]">Forums</a></td>
</if>
<if condition="VBA_SCRIPT != 'gallery'">
<td class="vbmenu_control"><a href="$vboptions[bburl]/gallery/?$session[sessionurl]">Gallery</a></td>
</if>
<if condition="VBA_SCRIPT != 'links_directory'">
<td class="vbmenu_control"><a href="$vboptions[bburl]/links/?$session[sessionurl]">Links</a></td>
</if>
<td class="vbmenu_control"><a href="/bulletin/calendar.php?$session[sessionurl]">$vbphrase[calendar]</a></td>
<td class="vbmenu_control"><a href="/bulletin/forumdisplay.php?f=20&$session[sessionurl]">Contests</a></td>
<td class="vbmenu_control"><a href="/bulletin/cmps_index.php?page=shop">Shop</a></td>
<if condition="$show['popups']">
<if condition="$show['searchbuttons']">
<if condition="$show['member']">
<td nowrap class="vbmenu_control" id="navbar_activetopics"><a href="search.php?$session[sessionurl]&do=getdaily&days=1">Active Topics</a>
<script type="text/javascript">
vbmenu_register("navbar_activetopics");
</script>
</td>
</if>
<td id="navbar_search" class="vbmenu_control"><a href="search.php?$session[sessionurl]" accesskey="4">$vbphrase[search]</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script>
</td>
</if>
<if condition="$bbuserinfo['userid']">
<td id="usercptools" class="vbmenu_control"><a href="#usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></td>
</if>
<else />
<if condition="$show['searchbuttons']">
<td class="vbmenu_control"><a href="search.php?$session[sessionurl]" accesskey="4">$vbphrase[search]
</a></td>
</if>
<td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td>
<if condition="$bbuserinfo['userid']">
<td class="vbmenu_control"><a href="#" onClick="window.open('misc.php?$session[sessionurl]do=buddylist&focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td>
</if>
</if>
<if condition="$bbuserinfo['userid']">
<td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&u=$bbuserinfo[userid]" onClick="return log_out()">$vbphrase[log_out]</a></td>
</if>
<!-- Setup for drop down menu #5 in navbar -->
<td id="dropdown5" class="vbmenu_control" class="vbmenu_control" ><a href="#dropdown5">Links</a> <script type="text/javascript"> vbmenu_register("dropdown5"); </script></td>
<!-- / Setup for down menu #5 in navbar-->
<td class="vbmenu_control"><a href="http://www.automotivephoto.com/bulletin/external.php?type=rss2&forumids=5,6,11" target="_blank" class="inline-button" font-size="12"><em>RSS</em><span>2.0</span></a></td>
</tr>
</table>
</div>
<!-- / nav buttons bar -->
<br />
<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->
<if condition="$show['searchbuttons']">
<div class="vbmenu_popup" id="navbar_activetopics_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">Active Topics</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]&do=getnew">Since Last Visit</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]&do=getdaily">For Today</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]&do=getdaily&days=2">Last 2 Days</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]&do=getdaily&days=3">Last 3 Days</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]&do=getdaily&days=7">Weekly Review</a></td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]&do=getdaily&days=30">Monthly Review</a></td>
</tr>
<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
</table>
</div>
<!-- header quick search form -->
<div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$vbphrase[search_forums]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<form action="search.php" method="post">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="showposts" value="0" />
<input type="text" class="bginput" name="query" size="20" />$gobutton<br />
</form>
</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php?$session[sessionurl]" accesskey="4">$vbphrase[advanced_search]</a></td></tr>
<!-- Search Google -->
<center>
<form method="get" action="http://www.google.com/custom" target="_top">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>
<br/>
<input type="text" name="q" size="31" maxlength="255" value=""></input>
</td></tr>
<tr><td valign="top" align="left">
<input type="submit" name="sa" value="Search"></input>
<input type="hidden" name="client" value="pub-7020605514016648"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="channel" value="0197495633"></input>
<input type="hidden" name="ie" value="ISO-8859-1"></input>
<input type="hidden" name="oe" value="ISO-8859-1"></input>
<input type="hidden" name="cof" value="GALT:#00CCFF;GL:1;DIV:#FFFFFF;VLC:663399;AH:center;BGC:333333;LBGC:3B4859;ALC:FFFFFF;LC:FFFFFF;T:999999;GFNT:666666;GIMP:666666;LH:23;LW:288;L:http://www.automotivephoto.com/images/DefaultLogo.gif;S:http://www.automotivephoto.com/bulletin/cmps_index.php?;FORID:1;"></input>
<input type="hidden" name="hl" value="en"></input>
</td></tr></table>
</form>
</center>
<!-- Search Google -->
</table>
</div>
<!-- / header quick search form -->
</if>
<if condition="$show['member']">
<!-- user cp tools menu -->
<div class="vbmenu_popup" id="usercptools_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">$vbphrase[quick_links]</td></tr>
<tr><td class="vbmenu_option"><a href="faq.php?$session[sessionurl]">$vbphrase[faq]</a></td></tr>
<tr><td class="vbmenu_option"><a href="memberlist.php?$session[sessionurl]">$vbphrase[members_list]</a></td></tr>
<tr><td class="vbmenu_option"><a href="misc.php?do=bbcode">BB Code List</a></td></tr>
<tr><td class="vbmenu_option"><a href="misc.php?$session[sessionurl]do=showsmilies">$vbphrase[smilies]</a></td></tr>
<tr><td class="vbmenu_option"><a href="#" onClick="window.open('misc.php?$session[sessionurl]do=buddylist&focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>
<tr><td class="thead"><a href="usercp.php?$session[sessionurl]">$vbphrase[user_control_panel]</a></td></tr>
<if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_profile]</a></td></tr>
<tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>
<tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="subscription.php?$session[sessionurl]">$vbphrase[subscribed_threads]</a></td></tr>
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>
<if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php?$session[sessionurl]">$vbphrase[whos_online]</a></td></tr></if>
</table>
</div>
<!-- / user cp tools menu -->
</if>
<!-- / NAVBAR POPUP MENUS -->
</if>
<!-- Drop down for menu #5 in navbar-->
<div class="vbmenu_popup" id="dropdown5_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">AP Directory</a></td></tr>
<tr><td class="vbmenu_option"><a href="http://www.automotivephoto.com/bulletin/links">Links Directory</a></td></tr>
<tr><td class="vbmenu_option"><a href="http://www.automotivephoto.com/bulletin/links/misc.php?do=linktous">Link To Us</a></td></tr>
<tr><td class="vbmenu_option"><a href="http://www.automotivephoto.com/bulletin/links/addlink.php?c=">Submit a Link</a></td></tr>
<tr><td class="vbmenu_option"><a href="http://www.automotivephoto.com/bulletin/links/browselinks.php?do=newlinks">What's New</a></td></tr>
<tr><td class="vbmenu_option"><a href="http://www.automotivephoto.com/bulletin/links/search.php?">Search</a></td></tr>
</table>
</div>
<!-- / Drop down for menu #5 in navbar-->
Thanks for any help in advance. sKiz Last edited by skizzy203; 06-18-2005 at 07:44 PM. |
|
#16
|
|||
|
|||
|
bump. need a little help with this soon as my menu is a little messy now.
sKiz |
|
#17
|
|||
|
|||
|
I got everything alll squared away....
Figured out how to make dropdowns while I was at it. sKiz
|
|
#18
|
|||
|
|||
|
Found my problem - Great addition
thanks Last edited by am-fs; 06-23-2005 at 01:12 AM. |
|
#19
|
|||
|
|||
|
tnx for help people !
KW802 you open my eyes...tnx alot ! |
|
#20
|
|||
|
|||
|
kw802...
what if i am using cmps with my forums on the front page (i.e. define('VBA_PAGE', 'include'); doing define('VBA_SCRIPT', 'cmps') takes away my cmps.. thoughts please?? thx, rice |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I change this? | Execution_Style | Troubleshooting / "How do I..." Questions | 7 | 06-15-2006 03:37 AM |
| Universal Currency Converter Module | Graham | Add-On Modules & Modifications | 4 | 02-17-2005 04:44 PM |
| How do I change this | Zellbet | Troubleshooting / "How do I..." Questions | 2 | 07-18-2004 06:04 PM |