vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Using vB drop-down menus more than once (https://vborg.vbsupport.ru/showthread.php?t=141832)

sv1cec 03-12-2007 09:05 AM

Using vB drop-down menus more than once
 
In our site, we use 3.0.xx.

Some of our threads are quite large (about 50 pages or more). So I decided to imitate the drop-down menu shown in the latest releases of vB, where you are allowed to enter a number, hit the Go menu and the program takes you to the specified page in the thread. I am using a drop-down menu (vbmenu_register) to create the drop-down menu, in the pagenav template. The code for the menu is entered in the SHOWTHREAD or SHOWFORUM templates (that's where I need the drop-down menu) and it is just a form to get the page number where you want to go).

The code works fine in the page navigation section on the top of the page, but does not work at the bottom one. From some tests I did, it looks as if you can't use vbmenu_register, to register a menu more than once.

Any ideas how to solve this problem?

Here is the code I am using:

In template pagenav:

After:

Code:

<if condition="$show['last']"><td class="alt1"><a class="smallfont" href="$address&amp;page=$totalpages$address2" title="$vbphrase[last_page] - <phrase 1="$lastnumbers[first]" 2="$lastnumbers[last]" 3="$total">$vbphrase[results_x_to_y_of_z]</phrase>">$vbphrase[last] <strong>&raquo;</strong></a></td></if>
I entered:

Code:

<if condition="$show['popups']"><td id="pagenav" class="vbmenu_control" title="$address$address2"><a name="PageNav"></a> <script type="text/javascript"> vbmenu_register("pagenav"); </script></td></if>

And in template SHOWTHREAD, I entered this code as an additional drop-down menu.

Code:

<!-- Page Navigation form menu -->
<if condition="$show[popups]">

<div class="vbmenu_popup" id="pagenav_menu" style="display:none">
        <form action="$address" method="post">
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
                <td class="thead" nowrap="nowrap">Go to Page...</td>
        </tr>

        <tr>
                <td class="vbmenu_option" title="nohilite">
<if condition="THIS_SCRIPT=='showthread'"><input type="hidden" name="perpage" value="$vboptions[maxposts]" /><else /><input type="hidden" name="perpage" value="$vboptions[maxthreads]" /></if>
<input type="text" class="bginput" name="pagenumber" size="4" />
<input type="submit" class="button" value="$vbphrase[go]"  /><br />
                </td>
        </tr>
        </table>
        </form>
</div>
</if>

Any help will be appreciated.


All times are GMT. The time now is 03:52 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.00956 seconds
  • Memory Usage 1,715KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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