Announcement

Collapse
No announcement yet.

[Template] vbmenu_register() in 2 places?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Template] vbmenu_register() in 2 places?

    Is it possible to have the menu (specifically the "Thread Tools) menu's appear in two spots? I've got a button on top, and a button on bottom which I want to bring up the same menu.

    Thanks

  • #2
    I believe it is possible, just would require some tweaking...

    If you look in the FORUMDISPLAY template for the Thread Tools menu you will find this:
    HTML Code:
     	<td class="vbmenu_control" id="forumtools"><a href="#forumtools">$vbphrase[forum_tools]</a> <script type="text/javascript"> vbmenu_register("forumtools"); </script></td>
    Then later you will see this code here:
    HTML Code:
     <!-- forum tools menu -->
     <div class="vbmenu_popup" id="forumtools_menu" style="display:none">
     <form action="moderator.php" method="post" name="forumadminform">
     	<table cellpadding="4" cellspacing="1" border="0">
     	<tr><td class="thead">$vbphrase[forum_tools]<a name="forumtools">&nbsp;</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">$vbphrase[post_a_new_thread]</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread&amp;f=$foruminfo[forumid]">$vbphrase[mark_this_forum_read]</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="subscription.php?$session[sessionurl]do=addsubscription&amp;f=$foruminfo[forumid]">$vbphrase[subscribe_to_this_forum]</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[parentid]">$vbphrase[view_parent_forum]</a></td></tr>
     	<if condition="$show['adminoptions']">
     	<tr>
     		<td class="thead">$vbphrase[admin_tools]<a name="forumadmin">&nbsp;</a></td>
     	</tr>
     	<tr>
     		<td class="vbmenu_option" title="nohilite">		
     		<div><label for="fa_mpo"><input type="radio" name="do" id="fa_mpo" value="modposts" checked="checked" />$vbphrase[view_posts_queue]</label></div>
     		<div><label for="fa_mat"><input type="radio" name="do" id="fa_mat" value="modattach" />$vbphrase[view_attachment_queue]</label></div>
     		<div><label for="fa_mov"><input type="radio" name="do" id="fa_mov" value="move" />$vbphrase[massmove_threads]</label></div>
     		<div><label for="fa_prn"><input type="radio" name="do" id="fa_prn" value="prune" />$vbphrase[massprune_threads]</label></div>
     		<if condition="$show['addmoderator']">
     		<div><label for="fa_amd"><input type="radio" name="do" id="fa_amd" value="addmoderator" />$vbphrase[add_moderator]</label></div>
     		</if>		
     		</td>
     	</tr>
     	<tr>
     		<td class="vbmenu_option" title="nohilite" align="center">    	
     			<input type="hidden" name="s" value="$session[sessionhash]" />
     			<input type="hidden" name="f" value="$forumid" />
     			<input type="submit" class="button" value="$vbphrase[perform_action]" />
     		</td>
     	</tr>
     	</if>
     	</table>
     </form>
     </div>
     <!-- / forum tools menu -->
    By adding another button (first code block), you can add another menu but you need to change their ids to something unique, you can duplicate them. So for a new Forum Tools menu at the bottom do this:

    Add this code where you want the menu to appear:
    HTML Code:
     	<td class="vbmenu_control" id="forumtools2"><a href="#forumtools2">$vbphrase[forum_tools]</a> <script type="text/javascript"> vbmenu_register("forumtools2"); </script></td>
    Then add in the code for the menu:
    HTML Code:
     <!-- forum tools menu -->
      <div class="vbmenu_popup" id="forumtools_menu2" style="display:none">
      <form action="moderator.php" method="post" name="forumadminform">
      	<table cellpadding="4" cellspacing="1" border="0">
      	<tr><td class="thead">$vbphrase[forum_tools]<a name="forumtools">&nbsp;</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]">$vbphrase[post_a_new_thread]</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread&amp;f=$foruminfo[forumid]">$vbphrase[mark_this_forum_read]</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="subscription.php?$session[sessionurl]do=addsubscription&amp;f=$foruminfo[forumid]">$vbphrase[subscribe_to_this_forum]</a></td></tr>
     	<tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]f=$foruminfo[parentid]">$vbphrase[view_parent_forum]</a></td></tr>
      	<if condition="$show['adminoptions']">
      	<tr>
     		<td class="thead">$vbphrase[admin_tools]<a name="forumadmin">&nbsp;</a></td>
      	</tr>
      	<tr>
      		<td class="vbmenu_option" title="nohilite">		
      		<div><label for="fa_mpo"><input type="radio" name="do" id="fa_mpo" value="modposts" checked="checked" />$vbphrase[view_posts_queue]</label></div>
      		<div><label for="fa_mat"><input type="radio" name="do" id="fa_mat" value="modattach" />$vbphrase[view_attachment_queue]</label></div>
      		<div><label for="fa_mov"><input type="radio" name="do" id="fa_mov" value="move" />$vbphrase[massmove_threads]</label></div>
      		<div><label for="fa_prn"><input type="radio" name="do" id="fa_prn" value="prune" />$vbphrase[massprune_threads]</label></div>
      		<if condition="$show['addmoderator']">
      		<div><label for="fa_amd"><input type="radio" name="do" id="fa_amd" value="addmoderator" />$vbphrase[add_moderator]</label></div>
      		</if>		
      		</td>
      	</tr>
      	<tr>
     		<td class="vbmenu_option" title="nohilite" align="center">    	
      			<input type="hidden" name="s" value="$session[sessionhash]" />
      			<input type="hidden" name="f" value="$forumid" />
     			<input type="submit" class="button" value="$vbphrase[perform_action]" />
      		</td>
      	</tr>
      	</if>
      	</table>
      </form>
      </div>
      <!-- / forum tools menu -->
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Thats great, I'll try it in a bit

      So will non-compatible browsers will see two menu's?

      Comment


      • #4
        It is possible. Haven't checked. I don't have anything that is not compatible personally. You can probably work around this would conditionals, though I would have to investigate.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment


        • #5
          Thanks for your help Wayne, your a lifesaver

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X