veenuisthebest
11-22-2008, 03:57 PM
I know how to create custom WOL locations but How do we create custom online locations for sub-pages like I want the exact location to display when user is viewing page.php?do=this&uid=12
For example, this is the WOL code of ibproarcade:-
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&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&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_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'];
}
}
Can anybody explain me how its done? Thanks
For example, this is the WOL code of ibproarcade:-
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&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&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_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'];
}
}
Can anybody explain me how its done? Thanks