Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Addon: Auto-populate Navbar menu (for John's Arcade V3) Details »»
Addon: Auto-populate Navbar menu (for John's Arcade V3)
Version: 1.00, by Natch Natch is offline
Developer Last Online: Apr 2022 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 02-06-2004 Last Update: 02-06-2004 Installs: 15
 
No support by the author.

Addon: Auto-populate Navbar menu (for John's Arcade V3)

What this hack does:

It replaces the link in your navbar for the Arcade with a Dropdown menu of all the games that are active in your Arcade.

Motivation: Extrapolated from my other auto-populating menu for Erwin's vB3 hack ...

Files to edit: 2
global.php
includes/functions.php
Template to edit: 1
navbar
New phrases to insert: 1
Queries added: 1

Step 1: Add the following in the Phrase Manager under GLOBAL

Alternate: you can import the single phrase using the included XML file

************************************************** ******
Name: arcade_addon_title
Phrase: The Arcade!
************************************************** ******

Step 2: Add the following at the bottom of global.php

Find:
Code:
/*======================================================================*\
|| ####################################################################
|| # Downloaded:
Add Before:
PHP Code:
// Addon to John's vB3 ArcadeV3 hack - created by Natch
    
$nav_arcade genArcadeMenu();
// Addon to John's vB3 ArcadeV3 hack - created by Natch 
Step 3: Add the following at the bottom of includes/functions.php

Find:
Code:
/*======================================================================*\
|| ####################################################################
|| # Downloaded:
Add Before:
PHP Code:
// Addon to John's vB3 ArcadeV3 hack - created by Natch
function genArcadeMenu() {
    global 
$DB_site,$vboptions;
    
$theseGames $DB_site->query("SELECT gameid,title,gamesettings FROM " TABLE_PREFIX "games ORDER BY title");
    while (
$thisGame $DB_site->fetch_array($theseGames)) {
        
$arcmenu.= (is_int($thisGame[gamesettings]/2)) ? "" "\t\t<tr><td class=\"vbmenu_option\"><a href=\"$vboptions[bburl]/arcade.php?$session[sessionurl]do=play&amp;gameid=".$thisGame[gameid]."\">".$thisGame[title]."</a></td></tr>\n";
    }
    return 
$arcmenu;
}
// Addon to John's vB3 ArcadeV3 hack - created by Natch 
Step 4: Add the following to the template 'navbar'

Find:
Code:
<!-- / NAVBAR POPUP MENUS -->
Add Before:
Code:
<!-- Addon to John's vB3 ArcadeV3 hack - created by Natch -->
	<if condition="$show['member']"> <!-- remove this line and the endif if you wish all users and guests to view the menu -->
	<!-- flash arcade auto-menu -->
	<div class="vbmenu_popup" id="flasharcade_menu" style="display:none">
		<table cellpadding="4" cellspacing="1" border="0">
		<tr><td class="thead"><a href="$vboptions[bburl]/arcade.php?$session[sessionurl]" title="$vbphrase[arcade_addon_title]">$vbphrase[arcade_addon_title]</a></td></tr>
$nav_arcade
		</table>
	</div>
	<!-- / flash arcade auto-menu -->
	</if>
<!-- Addon to John's vB3 ArcadeV3 hack - created by Natch -->
Find:
Code:
<td class="vbmenu_control"><a href="arcade.php?$session[sessionurl]">Arcade</a></td>
REPLACE WITH:
Code:
<!-- Addon to John's vB3 ArcadeV3 hack - created by Natch -->
			<if condition="$show['member']"> <!-- remove this line and the endif if you wish all users and guests to view the menu -->
				<td id="flasharcade" class="vbmenu_control"><a href="#flasharcade">$vbphrase[arcade_addon_title]</a> <script type="text/javascript"> vbmenu_register("flasharcade"); </script></td>
			</if>
<!-- Addon to John's vB3 ArcadeV3 hack - created by Natch -->
NOTE: in the two navbar edits there are conditionals that WILL CAUSE the menu to only appear to Registered users - remove these conditional wrappers to show the menu to all and sundry ...

Should work Enjoy, and props to John for his great Hack ...
U can see a demo @ http://www.mobileforces.org/ << running vBulletin 3.0.0 RC4 and vBIndex RC3, on PHP v4.3.4, MySQL 4.0.15

Screenshots attached: one with all default games enabled, and one with asteroids disabled

UPDATE: fixed up my comments - damn that copy and paste ... those that downloaded the attachment b4 5AM +11GMT, re-get the attachment, or make the following alterations to the above script:

Find twice:
Code:
// remove this line and the endif if you wish all users and  guests to view the menu
Replace with:
Code:
<!-- remove this line and the endif if you wish all users and guests to view the menu -->
UPDATE: IF YOU WANT ONLY N MOST POPULAR GAMES - check out this post

UPDATE: if you wat IMGAES in your dropdown menu, check out this post

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 05-23-2004, 03:54 PM
WEForums WEForums is offline
 
Join Date: Apr 2003
Location: Jacksonville, Florida
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Top worked for me.
Reply With Quote
  #33  
Old 05-23-2004, 08:36 PM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kall
I installed this hack, but the drop-down menu won't populate.

I can call $nav_arcade manually, on a separate page, and it displays a list of all installed games, but when it is put in the drop down box in the navbar, I get nothing.

http://forums.nzboards.com (top navbar)

Does anyone have any suggestions?
Sorted.

I had it in the 'Additional Navbar' and it really really didn't like that.

Nice hack.
Reply With Quote
  #34  
Old 06-05-2004, 08:57 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just upgraded to vbadvanced and ran into the same problem Kall.

So guessing that's what is causing it.

What did you do to fix your problem?

I use ushop and the arcade so would prefer to have both autopopulating.
Reply With Quote
  #35  
Old 06-07-2004, 05:21 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, the problem is with vbadvanced. Had vbindex and it worked fine, now at my home page www.mmogcommunities.com neither will populate, but at the forum index at www.mmogcommunities.com/forums they populate fine. I'll post to Trigga and see if he can troubleshoot the issue.
Reply With Quote
  #36  
Old 06-07-2004, 05:22 AM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cyricx
I just upgraded to vbadvanced and ran into the same problem Kall.

So guessing that's what is causing it.

What did you do to fix your problem?

I use ushop and the arcade so would prefer to have both autopopulating.
I think it was due to having another menu of the same name somewhere in the navbars...can't really remember what it was, because I decided to Revert my navbar and start again.
Reply With Quote
  #37  
Old 06-07-2004, 10:27 AM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Cyricx
Yep, the problem is with vbadvanced. Had vbindex and it worked fine, now at my home page www.mmogcommunities.com neither will populate, but at the forum index at www.mmogcommunities.com/forums they populate fine. I'll post to Trigga and see if he can troubleshoot the issue.
Ahh true...Im using the CMPS thingamewotsit.

Seems the Forums Jump in navbar populates fine, as does the top part of the Ushop, but not the Actions, nor this menu.

If I come up with a solution, I'll let you know.
Reply With Quote
  #38  
Old 06-07-2004, 10:35 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The only reason why this would not populate would be if the functions.php is not being called, if the populate function has been removed from functions.php, or if the variable has been stolen by another bit of code ...
Reply With Quote
  #39  
Old 06-08-2004, 03:42 AM
Cyricx Cyricx is offline
 
Join Date: Aug 2002
Location: Missouri
Posts: 1,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kewl Brian at http://vbadvanced.com pointed to the fix.

If you have VBadvanced cmps, and this hack isn't working, you'll need to open your vba_cmps_include_bottom.php file

And look for :
Code:
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox;
Replace it with :
Code:
		global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox, $nav_arcade;
And you'll be set to go!

This info came from this thread -

http://www.vbadvanced.com/forum/showthread.php?t=1182
Reply With Quote
  #40  
Old 06-14-2004, 12:24 PM
SurreDeth SurreDeth is offline
 
Join Date: Apr 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whenever I have an unregistered user click on a game in the dropdown they get the error: Could not find phrase 'quickreg_prompt'.

I have quickreg_prompt defined in the phrase manager.

EDIT: Nevermind, I found the reason :P I needed to move it to Front End error messages.
Reply With Quote
  #41  
Old 07-18-2004, 10:30 AM
Blam Forumz Blam Forumz is offline
 
Join Date: Jun 2004
Posts: 554
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*Installs*
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:07 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05336 seconds
  • Memory Usage 2,332KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (10)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete