PDA

View Full Version : [HOW] WOL plugins of arcade


veenuisthebest
11-25-2008, 03:03 PM
Hello sir,

Can you please make me understand how WOL for arcade is done via these plugins. The only problem I have is to get LOCATION URL's working at $userinfo['where']. I am not able to get the values from the database for $ids and $titles

Hook: online_location_process

if (($filename == 'arcade.php') || ($filename == 'holdsession.php'))
{
$userinfo['activity'] = 'arcade';
if (!empty($values['gameid']))
{
$userinfo['gameid'] = intval($values['gameid']);
global $gameids;
$gameids .= ',' . $userinfo['gameid'];
}
}


Hook: online_location_unknown

if ($userinfo['activity'] == 'arcade')
{
$gameid =& $userinfo['gameid'];
global $wol_games;
$gametitle =& $wol_games["$gameid"];
switch($userinfo['values']['do'])
{
case 'play':
$userinfo['action'] = $vbphrase['ibproarcade_playing_game'];
$userinfo['where'] = '<a href="arcade.php?' . $vbulletin->session->vars['sessionurl'] . "do=play&amp;gameid=$gameid\">$gametitle</a>";
break;
case 'stats':
$userinfo['action'] = $vbphrase['ibproarcade_viewing_highscores'];
$userinfo['where'] = '<a href="arcade.php?' . $vbulletin->session->vars['sessionurl'] . "do=stats&amp;gameid=$gameid\">$gametitle</a>";
break;
default:
$userinfo['action'] = $vbphrase['ibproarcade_viewing_home'];
$userinfo['where'] = '<a href="arcade.php' . $vbulletin->session->vars['sessionurl_q'] . "\">$vbphrase[ibproarcade_home]</a>";
break;
}
$handled = true;
DEVDEBUG("gameid = " . $userinfo['gameid']);
}


Hook: online_ids_titles

global $gameids, $wol_games;
if ($gameids)
{
$gameidquery = $vbulletin->db->query_read("
SELECT gid, gtitle
FROM " . TABLE_PREFIX . "games_list
WHERE gid IN (0$gameids)
");
while ($gameidqueryr = $vbulletin->db->fetch_array($gameidquery))
{
$wol_games["$gameidqueryr[gid]"] = $gameidqueryr['gtitle'];
}
}


1. Is anything else required in PHP files other than these plugins for WOL.
2. What does WHERE gid IN (0$gameids) mean?
3. I am not able to extract just the $ids and $titles in $userinfo['where'] under online_location_unknown hook, rest is fine.

Thank you

--------------- Added 1227672815 at 1227672815 ---------------

There was already a wonderful article here that helped me achieve this in few minutes
https://vborg.vbsupport.ru/showthread.php?t=113725

Thanks