plugin in forumhome_start
Un saluto a tutta la board,
sto usando vbulletin 3.8.4
plugin in questione : iB "Pro" Arcade Game Compatibility
compreso nel pacchetto v3arcade 1.1.1
devo inserire questo plugin in modo che entri in funzione
solo quando viene aperta la home di v3arcade, oppure
solo quando viene chiamata v3arcade,
perchè mi va in conflitto con un'altro analogo plugin che chiama
le stesse funzioni ma con 'Location:! diverse
quindi trovandosi tutti e due in forumhome_start secondo l'Ordine di esecuzione che do ai 2 plugin
chiaramente o funziona 1 o l'altra location, che singolarmente
girano alla perfezione.
chiaramente poi stessa cosa dovro' fare per l'altro prodotto.
il codice del plugin è questo:
Codice:
if ($_REQUEST['do'] == 'newscore' && $_REQUEST['act'] == 'Arcade')
{
require_once(DIR . '/includes/functions_arcade.php');
// Clean values
$vbulletin->input->clean_array_gpc('p',
array(
'gscore' => TYPE_UINT,
'gname' => TYPE_STR
)
);
if (!$game = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "arcade_games AS arcade_games WHERE shortname='" . addslashes($vbulletin->GPC['gname']) . "'"))
{
exit;
}
// Create a session record.
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_sessions (gameid,gamename,userid,start,sessiontype,challengeid,score,finish) VALUES ('" . $game['gameid'] . "', '" . addslashes($vbulletin->GPC['gname']) . "','" . $vbulletin->userinfo['userid'] . "', '" . TIMENOW . "', 1, 0, '" . $vbulletin->GPC['gscore'] . "', '" . TIMENOW . "')");
// Fetch the ID number of the session we just inserted.
$lastid = $db->insert_id();
header('Location: arcade.php?sessdo=burn&id=' . $lastid . 'µone=' . getmicrotime());
exit;
}
if ($_REQUEST['do'] == 'verifyscore' && $_REQUEST['autocom'] == 'arcade')
{
// Get two random numbers to do our score verification
$randomvar1 = rand(1, 25);
$randomvar2 = rand(1, 25);
// Bake a Cookie
vbsetcookie('v3arcade_v32_cookie', $randomvar1 . ',' . $randomvar2, permanent);
// Return the values
echo '&randchar=' . $randomvar1 . '&randchar2=' . $randomvar2 . '&savescore=1&blah=OK';
exit();
}
if ($_REQUEST['do'] == 'savescore' && $_REQUEST['autocom'] == 'arcade')
{
require_once(DIR . '/includes/functions_arcade.php');
$vbulletin->input->clean_array_gpc('p',
array(
'gscore' => TYPE_UINT,
'arcadegid' => TYPE_NUM,
'enscore' => TYPE_NUM,
'gname' => TYPE_STR
)
);
// Get a cookie from the jar
$randomvars = explode(',',$_COOKIE[COOKIE_PREFIX . 'v3arcade_v32_cookie']);
// If the checksum values do not match, display an error to the user.
if( $vbulletin->GPC['enscore'] != ($vbulletin->GPC['gscore'] * $randomvars[0] ^ $randomvars[1]) )
{
print_no_permission();
}
// Check to see game name is one file
if(!$game = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "arcade_games AS arcade_games WHERE shortname='" . addslashes($vbulletin->GPC['gname']) . "'"))
{
exit;
}
// Create a session record.
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_sessions (gameid,gamename,userid,start,sessiontype,challengeid,score,finish) VALUES ('" . $game['gameid'] . "', '" . addslashes($vbulletin->GPC['gname']) . "','" . $vbulletin->userinfo['userid'] . "', '" . TIMENOW . "', 1, 0, '" . $vbulletin->GPC['gscore'] . "', '" . TIMENOW . "')");
// Fetch the ID number of the session we just inserted.
$lastid = $db->insert_id();
header('Location: arcade.php?sessdo=burn&id=' . $lastid . 'µone=' . getmicrotime());
// Clear the cookie values
vbsetcookie('v3arcade_v32_cookie', '');
exit;
}
spero di essermi spiegato :)
Ringrazio anticipatamente
Saluti
Dott.New
.