// 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&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 -->
<!-- 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.
It performs one query to the games table to get game title (for the link wording), game id (for the link itself), and game settings (to check the game is enabled from the Arcade CP) ...