more failsave (e.g. if someone deletes his char while the tournament is busy)

main
hecht 13 years ago
parent c327197f69
commit e8c9641530

@ -16,11 +16,13 @@ include_once('char.inc.php');
* @return boolean if the insert was successful * @return boolean if the insert was successful
*/ */
function insertIntoHallOfFame($title, $charid, $userid){ function insertIntoHallOfFame($title, $charid, $userid){
echo 'insertIntoHallOfFame('.$title.', '.$charid.', '.$userid.')<br>';
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online')); $row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
$char = getChar($charid); $char = getChar($charid);
$user = mysql_fetch_assoc(mysql_query('Select * from user where id = '.$userid)); $user = mysql_fetch_assoc(mysql_query('Select * from user where id = '.$userid));
if(!$row || is_null($char) || is_null($user)){ if(!$row){
echo 'insertIntoHallOfFame failed as the basic methods failed!<br>';
return false; return false;
} }
@ -28,8 +30,10 @@ function insertIntoHallOfFame($title, $charid, $userid){
} }
function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charname = '', $userid = '', $username = '', $date = ''){ function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charname = '', $userid = '', $username = '', $date = ''){
echo 'insertIntoHallOfFame('.$title.', '.$charid.', '.$charname.', '.$username.', '.$userid.', '.$date.')<br>';
// These Entries may not be '' // These Entries may not be ''
if(!is_numeric($round) || $date == '' || $title == ''){ if(!is_numeric($round) || $date == '' || $title == ''){
echo 'insertIntoHallOfFame failed as the extended methods failed!<br>';
return false; return false;
} }

Loading…
Cancel
Save