Quindi, se io ho questo codice:
Codice PHP:
$sql = 'SELECT * FROM ' . CHALLENGE_TABLE . '
WHERE id = ' . $id_challenge;
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not read id challenge.', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$challenger_id = $row['id_challenger'];
$challenging_id = $row['id_challenging'];
$state_challenger_image = $row['state_image_challenger'];
$state_challenging_image = $row['state_image_challenging'];
if(($challenger_id || $challenging_id) != $userdata['user_id'])
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View'] . '<br />' .
sprintf('Clicca %sQUI%s per tornare alla sfida', '<a href="' . append_sid(U_CHALLENGE . '?id=' . $id_challenge . '&mode=view_challenge') . '">', '</a>'));
}
Dovrebbe diventare:
Codice PHP:
$sql = 'SELECT * FROM ' . CHALLENGE_TABLE . '
WHERE id = ' . $id_challenge;
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not read id challenge.', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$challenger_id = $row['id_challenger'];
$challenging_id = $row['id_challenging'];
$state_challenger_image = $row['state_image_challenger'];
$state_challenging_image = $row['state_image_challenging'];
if(($challenger_id != $userdata['user_id']) || ($challenging_id != $userdata['user_id']))
{
message_die(GENERAL_MESSAGE, $lang['Not_Auth_View'] . '<br />' .
sprintf('Clicca %sQUI%s per tornare alla sfida', '<a href="' . append_sid(U_CHALLENGE . '?id=' . $id_challenge . '&mode=view_challenge') . '">', '</a>'));
}
Giusto?