vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Newbie Question - How To Add Links To The Navbar? (https://vborg.vbsupport.ru/showthread.php?t=177633)

glenbelt 04-30-2008 05:34 PM

Newbie Question - How To Add Links To The Navbar?
 
Hi there,

I've got a new style on my forum (WebChat) and I was trying to add/remove some links to the navigation bar at the top of the forum. I can go to my admin CP and find the navbar, but I don't really understand the code and don't know which bit to delete (wanted to get rid of the calendar) and I didn't know how to add a page link to an external website.

I heard that it might be easier to get a navbar mod - any idea where I can get this and how to use/install it?

Thanks for any help

Lynne 04-30-2008 05:59 PM

See these articles. They should help you out.

How To Add Additional Links To Your Navbar
How To Add Drop Down Menus To Your Navbar

glenbelt 04-30-2008 08:38 PM

Hi thanks, thats helpful, but just one problem - I don't know where to add the links. I can get to my navbar code from my admin CP but theres quite a lot of code and I'm not sure where to put the links. Also I am using a different style for my forum so I'm not sure if it would be different to the default code?

Thanks again

Lynne 04-30-2008 08:45 PM

It may be different. You can always post your navbar template here, or the part you think it is in, and tell us what you want and we can see if we can help you out.

glenbelt 05-01-2008 11:32 AM

Hi again, thanks again for the reply. Here is all of my navbar code (I was unsure as to where the links are meant to go):

Quote:

<br />

<!-- 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); return false;"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a></td>
<td>&nbsp;</td>
<td width="100%"><span class="navbar"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>
</tr>
<tr>
<td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><if condition="$_SERVER['REQUEST_METHOD'] == 'POST'"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink_$stylevar[textdirection].gif" alt="" border="0" /><else /><a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink_$stylevar[textdirection].gif" alt="$vbphrase[reload_this_page]" border="0" /></a></if> <strong>$navbits[lastelement]</strong></td>
</tr>
</table>
<else />
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" 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="$show['member']">

<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">
<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_q]">$vbphrase[private_messages_nav]</phrase></if>
<if condition="$show['pmwarning']"><br /><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
</div>
</td>

<else />

<td class="alt2" nowrap="nowrap" style="padding:0px">

<!-- login form -->
<form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
<script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
<tr>
<td class="smallfont"><label for="navbar_username">$vbphrase[username]</label></td>
<td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" 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="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td>
</tr>
<tr>
<td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td>
<td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td>
<td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" 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="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<!-- / login form -->

</td>

</if>

</tr>
</table>
<!-- / breadcrumb, login, pm info -->

<br />
<if condition="$show['forumdesc']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" width="100%"><strong>$foruminfo[title]</strong> <span class="smallfont">$foruminfo[description]</span></td>
</tr>
</table>
<br />
</if>

<!-- PAGENAV POPUP -->

<div class="vbmenu_popup" id="pagenav_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead" nowrap="nowrap">$vbphrase[go_to_page]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<form action="$vboptions[forumhome].php" method="get" onsubmit="return this.gotopage()" id="pagenav_form">
<input type="text" class="bginput" id="pagenav_itxt" style="font-size:11px" size="4" />
<input type="button" class="button" id="pagenav_ibtn" value="$vbphrase[go]" />
</form>
</td>
</tr>
</table>
</div>

<!-- / PAGENAV POPUP -->
</if>

Thanks for any help

Lynne 05-01-2008 03:29 PM

That does not look like what we need. Go to vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code, find the navbar links, and you will see the name of the template called around your part of the code. Then post the contents of that template.

glenbelt 05-01-2008 04:58 PM

Hi thanks for the help again Lynne. I found this code in my sourcecode:

Quote:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background-image:url(webchat/misc/links_bg.gif); height: 22px;">
<div class="headlinks" style="padding-left: 15px;">

<a href="index.php">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="faq.php" accesskey="5">FAQ</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="calendar.php">Calendar</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="memberlist.php">Members List</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;


<a href="search.php?do=getnew" accesskey="2">New Posts</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;
<a href="search.php" accesskey="4" rel="nofollow" id="navbar_search">Search</a> <script type="text/javascript"> vbmenu_register("navbar_search"); </script>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;

<a href="/?nojs=1#usercptools" id="usercptools">Quick Links</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;<a href="#">Advertise</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="usercp.php">UserCp</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
</div>
</td>
</tr>
</table>
What do I need to look for now in my admin CP?


Thanks again :)

Lynne 05-01-2008 05:03 PM

That is the source code, but we need the template. I posted how to turn on the option to put the template name in the source code, do that and find the template name.

markbolyard 05-01-2008 05:45 PM

I think This member has a custom style. The button code is missing from the code in the first part of this thread, which would leave me to assume it's located in another template such as the header.

glenbelt 05-01-2008 06:07 PM

Thanks for the reply again.

I did turn on the option to put the template name in the source code. I went to my admin CP and then turned on the Template Name in HTML Comments option. Then I went to my forum and viewed the source, and copied and pasted the above. Is there something that I'm not doing/doing wrong?

markbolyard 05-01-2008 06:16 PM

Would be much easier if you could post a link to your forum, or PM me a link. I'd be happy to help but playing guessing games as to where you need to make edits isn't getting us anywhere :)

glenbelt 05-01-2008 06:17 PM

Quote:

Originally Posted by markbolyard (Post 1504835)
I think This member has a custom style. The button code is missing from the code in the first part of this thread, which would leave me to assume it's located in another template such as the header.

Yes, I do have a custom style (sorry if I didn't make that clear to begin with).

So should I be looking in files other than the navbar one?


Thanks

Lynne 05-01-2008 07:26 PM

Quote:

Originally Posted by glenbelt (Post 1504859)
Thanks for the reply again.

I did turn on the option to put the template name in the source code. I went to my admin CP and then turned on the Template Name in HTML Comments option. Then I went to my forum and viewed the source, and copied and pasted the above. Is there something that I'm not doing/doing wrong?

Well, you didn't copy any of the code that shows what the template name is. If you don't want to give a link to the forum as suggeted, then you need to go find the name of the template yourself in the source code and then paste that template code here.

glenbelt 05-02-2008 08:19 AM

Thanks for the help and replies again.

My forum URL is http://www.forum-money.com/


Thanks again

Lynne 05-02-2008 03:01 PM

Your navbar links are in your header template. If you post that, and let us know what links you want removed and which you want added (and where), then I think we can help you with it. (We just need to see the part of the header up to the "<!-- / NAVBAR POPUP MENUS -->" line.)

glenbelt 05-05-2008 04:37 PM

Thanks for the reply and help again. Here is the code from the Header part of the style:

Quote:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="width: 331px;"><img src="$stylevar[imgdir_misc]/header_left.jpg" alt="" width="331" height="80" /></td>
<td style="background-image:url($stylevar[imgdir_misc]/header_bg.gif);"><div style="padding-right: 15px;" align="right"><script type="text/javascript"><!--
google_ad_client = "pub-numbersgohere";
//468x60, created 30/01/08
google_ad_slot = "7492970050";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="background-image:url($stylevar[imgdir_misc]/links_bg.gif); height: 22px;">
<div class="headlinks" style="padding-left: 15px;">

<a href="index.php">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="faq.php$session[sessionurl_q]" accesskey="5">FAQ</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="calendar.php$session[sessionurl_q]">Calendar</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<a href="memberlist.php$session[sessionurl_q]">Members List</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<if condition="$show['popups']">
<if condition="$show['searchbuttons']">
<if condition="$show['member']"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a>
<else />
<a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></if></if>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;
<a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow" id="navbar_search">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if>
</if>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;
<if condition="$show['member']">
<a href="$show[nojs_link]#usercptools" id="usercptools">$vbphrase[quick_links]</a> <script type="text/javascript"> vbmenu_register("usercptools"); </script></if>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;<a href="#">Advertise</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
<if condition="$show['member']"><a href="usercp.php$session[sessionurl_q]">UserCp</a></if>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;
<if condition="$show['registerbutton']"><a href="register.php$session[sessionurl_q]" rel="nofollow">Register</a></if></div>
</td>
</tr>
</table>
<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->

<if condition="$show['searchbuttons']">
<!-- header quick search form -->
<div class="vbmenu_popup" id="navbar_search_menu" style="display:none">
<form action="search.php?do=process" method="post">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">$vbphrase[search_forums]</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<input type="hidden" name="do" value="process" />
<input type="hidden" name="quicksearch" value="1" />
<input type="hidden" name="childforums" value="1" />
<input type="hidden" name="exactname" value="1" />
<input type="hidden" name="s" value="$session[sessionhash]" />
<div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" /></div>
</td>
</tr>
<tr>
<td class="vbmenu_option" title="nohilite">
<label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />$vbphrase[show_threads]</label>
&nbsp;
<label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />$vbphrase[show_posts]</label>
</td>
</tr>
<tr>
<td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
</tr>
</table>
</form>
</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>
<if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
<tr><td class="vbmenu_option"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=n o,menubar=no,toolbar=no,scrollbars=yes,resizable=y es,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td></tr>

<tr><td class="thead"><a href="usercp.php$session[sessionurl_q]">$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['pmmainlink']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="subscription.php$session[sessionurl_q]" rel="nofollow">$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_q]">$vbphrase[whos_online]</a></td></tr></if>

</table>
</div>
<!-- / user cp tools menu -->
</if>
<!-- / NAVBAR POPUP MENUS -->

Lynne 05-05-2008 06:03 PM

To delete the calendar, remove this line:
Code:

<a href="calendar.php$session[sessionurl_q]">Calendar</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
To add another link, add this line right around (or in place of) the calendar link:
Code:

<a href="yourpage.php$session[sessionurl_q]">Your Page</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
and change the stuff in red for your new page.

glenbelt 05-08-2008 01:23 PM

Thanks again Lynne, much appreciated :)

One more question - how do I go about linking to an external link, not a .php one? I mean, this wouldn't work, would it?:

Quote:

<a href="http://www.myurl.com/$session[sessionurl_q]">My URL</a>&

Thanks again for all the help :)

Lynne 05-08-2008 02:04 PM

I think you can link to anything in your navbar unless you have some setting on your site that doesn't allow outside links.

glenbelt 05-09-2008 11:46 AM

Thanks again Lynne.

Would this line of code work though as a link to an external site?


<a href="http://www.myurl.com/$session[sessionurl_q]">My URL</a>


Do I need the "$session[sessionurl_q]" directly after the URL?



Thanks for any more help :)

glenbelt 05-14-2008 08:13 AM

Does anyone know how to link to an external website on the navigation bar of the forum?

Would this line work?

Quote:

<a href="http://www.myurl.com/$session[sessionurl_q]">My URL</a>
Also what does the "$session[sessionurl_q]" line of code do?



Thanks for any help offered

Dismounted 05-14-2008 09:22 AM

Session IDs are used when users have cookies disabled.

Lynne 05-14-2008 02:58 PM

If you are linking to another site, then you don't need the session id. That is just used on your own site.

Dismounted 05-15-2008 06:51 AM

Definitely, it would be potentially dangerous as well.

glenbelt 05-15-2008 09:04 PM

Ah right okay, thanks guys.

So when linking out to the site I should simply do it in this way?:

Quote:

<a href="http://www.myurl.com/">My URL</a>

Thanks again for all the help

Lynne 05-15-2008 10:25 PM

If you are linking to another site, then just use the url. In other words, if your site is at yoursite.com and you want to link to anothersite.com, then you would do it how you posted above.


All times are GMT. The time now is 10:29 PM.

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.01793 seconds
  • Memory Usage 1,842KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (26)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete