';
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
$char = getChar($charid);
$user = mysql_fetch_assoc(mysql_query('Select * from user where id = '.$userid));
if(!$row){
echo 'insertIntoHallOfFame failed as the basic methods failed!
';
return false;
}
return insertIntoHallOfFameFull($row['round'], $title, $charid, $char['name'], $userid, $user['nickname'], 'CURRENT_DATE');
}
function insertIntoHallOfFameFull($round = '', $title = '', $charid = '', $charname = '', $userid = '', $username = '', $date = ''){
echo 'insertIntoHallOfFame('.$title.', '.$charid.', '.$charname.', '.$username.', '.$userid.', '.$date.')
';
// These Entries may not be ''
if(!is_numeric($round) || $date == '' || $title == ''){
echo 'insertIntoHallOfFame failed as the extended methods failed!
';
return false;
}
$columns = 'art, runde, datum, charname, username';
$values = '\''.$title.'\','.$round.','.$date.',\''.$charname.'\',\''.$username.'\'';
if(is_numeric($charid)){
$columns .= ',charid';
$values .= ','.$charid;
}
if(is_numeric($userid)){
$columns .= ',userid';
$values .= ','.$userid;
}
$sql = 'INSERT INTO highscore('.$columns.') values('.$values.')';
// echo $sql.'
';
$qry = mysql_query($sql);
return mysql_affected_rows() > 0;
}
function getHallOfFame($title, $userid) {
$row = mysql_fetch_assoc(mysql_query('Select max(id) as round from online'));
return getHallOfFameFull($row['round'],$title, $userid);
}
function getHallOfFameFull($round = '', $title = '', $userid = '') {
$sql = 'select count(*) from highscore where runde='.$round.' and userid='.$userid;
$row = mysql_fetch_row($sql);
return $row[0];
}
?>