vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Add-On Releases - v3 Arcade Most Played and Most Popular Games (https://vborg.vbsupport.ru/showthread.php?t=272715)

Gemma 10-23-2011 10:00 PM

v3 Arcade Most Played and Most Popular Games
 
1 Attachment(s)
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.

datoneer 05-09-2012 02:22 PM

Awesome. Works like a charm!


All times are GMT. The time now is 02:23 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.01195 seconds
  • Memory Usage 1,709KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete