PDA

View Full Version : Add-On Releases - v3 Arcade Most Played and Most Popular Games


Gemma
10-23-2011, 10:00 PM
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:
// Favorites
else if ($vbulletin->GPC['categoryid'] == 2)Above that added:
// 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.categor yid)
" . 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.categor yid)
" . 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.

datoneer
05-09-2012, 02:22 PM
Awesome. Works like a charm!