vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - Additional navbar with dropdowns (https://vborg.vbsupport.ru/showthread.php?t=166136)

shotkey 09-04-2008 02:22 AM

attroll,
It seems you have a lot of navbar experience, so maybe you can save me some time as I haven't found anything on the best way to do this - I would like to move some of the existing menu items from navbar to navbar2.

These items are from some of the installed mods from this forum and when you install them they are automatically inserted in the navbar - and these mods don't have any option in the ACP to redirect where the link appears.

So the question is what needs to be edited to make this change (i.e.,change .xml files? revise templates?, etc?) Just looking for the easiest way to accomplish this.

attroll 09-04-2008 02:36 AM

Quote:

Originally Posted by Daisyboo (Post 1613791)
Ahh yep but I'm not sure of the code I need to add, so I was looking in nav bar 1 where it is currently so I can copy it and add it to nav bar 2 (then delete it from nav bar 1)
But I can't see anything that looks like its referring to vBExperience so wondered if anyone knew what I was looking for :)

Let me know what you trying to move and maybe I can walk you through it.

Quote:

Originally Posted by shotkey (Post 1614082)
attroll,
It seems you have a lot of navbar experience, so maybe you can save me some time as I haven't found anything on the best way to do this - I would like to move some of the existing menu items from navbar to navbar2.

These items are from some of the installed mods from this forum and when you install them they are automatically inserted in the navbar - and these mods don't have any option in the ACP to redirect where the link appears.

So the question is what needs to be edited to make this change (i.e.,change .xml files? revise templates?, etc?) Just looking for the easiest way to accomplish this.

I would have to look at your navbar and see what it is you want to move before I can explain it to you.

Daisyboo 09-04-2008 09:40 AM

Thanks Attroll.

In my original navbar I have a link for vBExperience, but I'd like to delete it from there and add it to navbar 2.

Here's my code for my original navbar
Code:

<!-- nav buttons bar -->
<div class="tborder" style="padding:$stylevar[cellspacing]px; border-top-width:0px">
        <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
        <tr align="center">
                <if condition="$show['member']">
                        <td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
                </if>
                <if condition="$show['registerbutton']">
                        <td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
                </if>
                $template_hook[navbar_buttons_left]
                <td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
                <if condition="$vboptions['enablememberlist']">
                        <td class="vbmenu_control"><a href="memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></td>
                </if>
                <td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td>
                                  <if condition="$show['popups']">
                        <if condition="$show['searchbuttons']">
                                <if condition="$show['member']">
                                <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                                <else />
                                <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                                </if>
                                <td id="navbar_search" class="vbmenu_control"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if></td>
                        </if>
                        <if condition="$show['member']">
                                <td id="usercptools" class="vbmenu_control"><a href="$show[nojs_link]#usercptools" accesskey="3">$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_q]" accesskey="4">$vbphrase[search]</a></td>
                                <if condition="$show['member']">
                                <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
                                <else />
                                <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily" accesskey="2">$vbphrase[todays_posts]</a></td>
                                </if>
                        </if>
                        <td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread" rel="nofollow">$vbphrase[mark_forums_read]</a></td>
                        <if condition="$show['member']">
                                <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_contacts]</a></td>
                        </if>
                </if>
                $template_hook[navbar_buttons_right]
                <if condition="$show['member']">
                        <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')">$vbphrase[log_out]</a></td>
                </if>
                </tr>
        </table>
</div>
<!-- / nav buttons bar -->

I can't figure what the code is that I need to move the vBExperience link.

Many thanks!
:)

jw00dy 09-05-2008 06:05 AM

Great Mod!

Question, I am trying to add a 2nd navbar2 (for a total of 3, original navbar, and 2 navbar2's) how can I accomplish this?

I'm migrating both my forums to this and have started with my wife's site (he he) first.

The reason for the 2nd navbar2 is that I like to place it at the bottom in the footer -- You can see an example on my forum that I've not updated to your mod yet due to wanting to get this working in the footer --> http://www.allthingsmoto.com/ (Having it in the footer is actually very very nice).

I've tried adding $navbar2 to the footer, but it doesn't show for some reason. Would you be willing to tell me how or what I might need to change to make this work in the footer?

attroll 09-05-2008 06:47 AM

Quote:

Originally Posted by jw00dy (Post 1614877)
Great Mod!

Question, I am trying to add a 2nd navbar2 (for a total of 3, original navbar, and 2 navbar2's) how can I accomplish this?

I'm migrating both my forums to this and have started with my wife's site (he he) first.

The reason for the 2nd navbar2 is that I like to place it at the bottom in the footer -- You can see an example on my forum that I've not updated to your mod yet due to wanting to get this working in the footer --> http://www.allthingsmoto.com/ (Having it in the footer is actually very very nice).

I've tried adding $navbar2 to the footer, but it doesn't show for some reason. Would you be willing to tell me how or what I might need to change to make this work in the footer?

The only way I have found to make this work in the top and in the footer is to do the following:

Go you your Plugin Manager and remove the check mark from the following plugins:
navbar3 plugin part #1
navbar3 plugin part #2

Now you will have to create a plugin

Go to the Plugin Manager and click on Add New Plugin

Product: vBulletin
Hook Location: global_start
Title: navbar2 top and bottom
Plugin PHP Code:
PHP Code:

eval('$navbar2 = "' fetch_template('navbar2') . '";'); 

Plugin Active: YES

Now put the following command in you footer:
Find:
PHP Code:

 <td class="tfoot" align="$stylevar[right]width="100%">
  <
div class="smallfont">
   <
strong>
    <if 
condition="$show['contactus']"><a href="$vboptions[contactuslink]rel="nofollow" accesskey="9">$vbphrase[contact_us]</a> -</if> 

Above that add:
$navbar2


PS: You will still have to put the $navbar2 in the navbar template where you want it.

attroll 09-05-2008 06:49 AM

Daisyboo

I did not have time to look at you code tonight. I will try to look at it towmorrow.

jw00dy 09-05-2008 07:26 AM

Quote:

Originally Posted by attroll (Post 1614898)
The only way I have found to make this work in the top and in the footer is to do the following:

Go you your Plugin Manager and remove the check mark from the following plugins:
navbar2 plugin part #1
navbar2 plugin part #2 (this was called navbar2 plugin part #2a in my plugin's)

Now you will have to create a plugin

Go to the Plugin Manager and click on Add New Plugin

Product: navbar2
Hook Location: global_start
Title: navbar2 plugin part #2 top and bottom
Plugin PHP Code:
PHP Code:

eval('$navbar2 = "' fetch_template('navbar2') . '";'); 

Plugin Active: YES

Now put the following command in you footer:
Find:
PHP Code:

<!-- /content area table --> 

Below that add:
$navbar2


PS: You will still have to put the $navbar2 in the navbar template where you want it.

Oh, crap, I'm really sorry, I should have posted this as soon as I discovered a work around. Sorry for making you go through the hassle of making that code.

This works (what's below), but I'm not sure it's the best way to do it.

Edit Plugin navbar2 plugin part #2a (Could be called navbar2 plugin part #2), which looks like this:
PHP Code:

$insert '$navbar2'$vbulletin->templatecache['navbar'] =  str_replace($insert,$insert.fetch_template('navbar2'),$vbulletin->templatecache['navbar']); 

Copy what is there, and paste it a 2nd time below it, then change each entry of navbar to footer
PHP Code:

$insert '$navbar2'$vbulletin->templatecache['navbar'] =  str_replace($insert,$insert.fetch_template('navbar2'),$vbulletin->templatecache['navbar']);

$insert '$navbar2'$vbulletin->templatecache['footer'] =  str_replace($insert,$insert.fetch_template('navbar2'),$vbulletin->templatecache['footer']); 

Again, this worked, but I'm not sure it's the best way of doing it.

Also, I'm not getting this to show on my vBBlog either... but I'm also not getting ads to show there either, so I'm thinking the problem with the blog is bigger than this mod...

I am however going to try your method instead, and see if it works as well.

jw00dy 09-05-2008 07:47 AM

Thanks again. I edited your entry that I quoted just in case anyone else wants to do it. I'm a little OCD, so I had to do it.

Your method (of course) worked perfectly and is a little cleaner me thinks. However, I am no coder (more of a hack than anything), so take that with a grain of salt.

Still didn't work for vBBlog, but again, I'm not blaming this mod, as I believe vBBlog is the problem.

Thanks again for your Awesome support, as you really are a nice person with the best support I've encountered to date.

BTW, anyone that wants to see this in action you can click on either link in my sig.

Daisyboo 09-05-2008 09:01 AM

Quote:

Originally Posted by attroll (Post 1614900)
Daisyboo

I did not have time to look at you code tonight. I will try to look at it towmorrow.

Thanks Attoll whenever you have the time, its much appreciated!

Daisyboo 09-10-2008 08:29 AM

Hi Attroll - just wondering if you had had a look yet :)


All times are GMT. The time now is 04:35 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.01851 seconds
  • Memory Usage 1,809KB
  • 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
  • (1)bbcode_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete