vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Addon: Auto-populate Navbar menu (for John's Arcade V3) (https://vborg.vbsupport.ru/showthread.php?t=61278)

Natch 02-07-2004 04:39 PM

Good thing the drop-downs are persistent and you can scroll LOL ...

But what could be done to improve this is to evaluate which are the most popular 15 games, and only put them in the menu ... probably based on the number of times played, or the length of time played ... if it became an issue that could be implemented ...

M1th 02-07-2004 04:48 PM

Quote:

Originally Posted by Natch
But what could be done to improve this is to evaluate which are the most popular 15 games, and only put them in the menu ... probably based on the number of times played, or the length of time played ... if it became an issue that could be implemented ...

now, that I like. The sql query will no doubt get abit complicated, though since you'd need to do a join table and use 'count', order by, limit etc. :)

gmarik 02-07-2004 07:27 PM

Any chance to use it without DHTML on?

Natch 02-08-2004 03:25 AM

Quote:

Originally Posted by gmarik
Any chance to use it without DHTML on?

How would you want it - like in a Sidebar menu ? or a vBIndex custom box ?

Sure - could be done :)

BlackxRam 02-08-2004 05:46 AM

THIS IS AWESOME LOOKING. But right now even with a dozen or so games the LIST is Huge!

I like the idea of HAVING an option like ONLY use top 5 games. or Whatever you want to make the limit. Personally I would like to use Top5 most visited Games. Someone might want to use Top 10. Perhaps a editable field in the Arcade Panel for this option.

Ill use this hack soon if it ever gets those features.

Ill keep in touch with this thread.

Natch 02-08-2004 06:51 AM

Another option (if it is just the size of the list that is too big) is to edit the CSS statements for the navbar popup links - drop them down a fint size and it should help a lot ...

Sometimes I forget that not everyone has 1280x1024 ...

I'll look into this ok guys ?

Natch 02-10-2004 04:58 AM

Quote:

Originally Posted by Natch
Another option (if it is just the size of the list that is too big) is to edit the CSS statements for the navbar popup links - drop them down a fint size and it should help a lot ...

Sometimes I forget that not everyone has 1280x1024 ...

I'll look into this ok guys ?

OK - I've created the new function to populate the menu with only the N most played games - atm the value of N will be hardcoded by you the hacker into your global.php (where the function is called), but for the next release (which will have this variant as an option) I will add it to the Arcade ACP Options page (once I learn how to do ACP options LOL) - I will not be updating the original instructions until the next release ...

IF YOU WANT TO HAVE ONLY N MOST POPULAR OPTIONS

Find in includes/functions.php
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 

Replace with:
PHP Code:

// Addon to John's vB3 ArcadeV3 hack - created by Natch
function genArcadeMenu($limit) {
    global 
$DB_site,$vboptions;
    
$theseGames $DB_site->query("
                    SELECT " 
TABLE_PREFIX "games.gameid AS gameid, " TABLE_PREFIX "games.title AS title, " TABLE_PREFIX "games.gamesettings as gamesettings, COUNT(" TABLE_PREFIX "gamesessions.gamename) AS popularity 
                    FROM " 
TABLE_PREFIX "games 
                    INNER JOIN " 
TABLE_PREFIX "gamesessions 
                    ON " 
TABLE_PREFIX "games.shortname = " TABLE_PREFIX "gamesessions.gamename 
                    GROUP BY title 
                    ORDER BY popularity DESC 
                    LIMIT 
$limit
                    "
);
    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 

Find in global.php
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 

Replace with:
PHP Code:

// Addon to John's vB3 ArcadeV3 hack - created by Natch
    
$nav_arcade genArcadeMenu("6");
// Addon to John's vB3 ArcadeV3 hack - created by Natch 

This should do it ... change the value in the global function call (above) to match your required number of menu options ...

Amzadi 02-10-2004 05:51 AM

Got a screen capture of this?

Natch 02-10-2004 08:41 AM

Check out the first post - this is just a modification of the first script ...

dirtymerc 02-11-2004 05:35 AM

Everything worked, but my arcade button is missing, its just a drop down arrow??? www.offthetopic.com/forums


All times are GMT. The time now is 10:50 AM.

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.01179 seconds
  • Memory Usage 1,765KB
  • 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
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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