Back to vBulletin 4.x Add-ons

v3 Arcade Most Played and Most Popular Games
Mod Version: 1.00, by Gemma

vB Version: 4.x.x Rating: (3 votes - 5.00 average) Installs: 14
Released: 25 Oct 2011 Last Update: Never Downloads: 0
Not Supported Code Changes Re-usable Code  

What does this do?

Creates two tabs in your v3 Arcade which is auto-populated with X Most Played Games and X Most Popular Games (by Votes), where X is equivalent to the number of games set to be shown on each page (set via AdminCP > v3 Arcade > v3 Arcade Settings > v3 Arcade Homepage Settings)

Firstly, create two new games categories (v3 Arcade > Games Categories) and take note of each of the Category IDs

Open arcade.php

Find:
Code:
// Favorites
    else if ($vbulletin->GPC['categoryid'] == 2)
Above that added:
Code:
// Most Popular
else if ($vbulletin->GPC['categoryid'] == X)
{
$games = $db->query_read("
SELECT arcade_games.*, user.username, arcade_categories.catname 
FROM " . TABLE_PREFIX . "v3arcade_games AS arcade_games
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (arcade_games.highscorerid=user.userid)
LEFT JOIN " . TABLE_PREFIX . "v3arcade_categories AS arcade_categories ON (arcade_games.categoryid=arcade_categories.categoryid)
" . iif($bitfieldcheck, "WHERE $bitfieldcheck") . "
ORDER BY arcade_games.votepoints DESC 
LIMIT $start " . $vbulletin->options['gamesperpage']
);
$categorygamecnt = $db->num_rows($games);
} 
// Most Played
else if ($vbulletin->GPC['categoryid'] == XX)
{
$games = $db->query_read("
SELECT arcade_games.*, user.username, arcade_categories.catname 
FROM " . TABLE_PREFIX . "v3arcade_games AS arcade_games
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (arcade_games.highscorerid=user.userid)
LEFT JOIN " . TABLE_PREFIX . "v3arcade_categories AS arcade_categories ON (arcade_games.categoryid=arcade_categories.categoryid)
" . iif($bitfieldcheck, "WHERE $bitfieldcheck") . "
ORDER BY arcade_games.sessioncount DESC
LIMIT $start " . $vbulletin->options['gamesperpage']
);
$categorygamecnt = $db->num_rows($games);
}
Replace the X and XX with the corresponding Category ID that you noted when creating the categories.

Save and re-up your arcade.php

If anyone wants to further develop any of my addons, you are free to do so.

Download

No files for download.

Screenshots

Click image for larger version
Name:	tabs.jpg
Views:	127
Size:	33.0 KB
ID:	134048   Click image for larger version
Name:	popular.jpg
Views:	198
Size:	306.2 KB
ID:	134049   Click image for larger version
Name:	played.jpg
Views:	115
Size:	296.8 KB
ID:	134050  


vblts.ru supports vBulletin®, 2022-2024