get_query("SELECT img_type FROM s_roster
WHERE user_id=". intval($userdata['user_id'])),0);
if (file_exists($file))
{
@unlink($file);
}
$sql = "img_type=NULL,";
}
else
{
// we need this because img_type in database would be erased
// due to we use replace and not update
$sql = "img_type='".
@mysql_result($sdb->get_query("SELECT img_type FROM s_roster WHERE user_id=". intval($userdata['user_id'])), 0)
."',";
}
$birth_date = $_POST['birth_y'] .'-'. $_POST['birth_m'] .'-'. $_POST['birth_d'];
if (!preg_match('/(19|20)\d\d-\d\d-\d\d/', $birth_date) || !checkdate(intval($_POST['birth_m']), intval($_POST['birth_d']), intval($_POST['birth_y'])))
{
$birth_date = '0000-00-00';
?>
Wrong birth date.
quote_smart($_POST['nickname']) .",
{$sql}
name=" . $sdb->quote_smart($_POST['name']) .",
origin=" . intval($_POST['origin']) .",
location=" . $sdb->quote_smart($_POST['location']) .",
birth_date='" . $birth_date ."',
sex='" . ( ($_POST['sex'] == 'male') ? 'm' : 'f' ) ."',
website=" . $sdb->quote_smart($_POST['website']) .",
email=" . $sdb->quote_smart($_POST['email']) .",
msn=" . $sdb->quote_smart($_POST['msn']) .",
mouse=" . $sdb->quote_smart($_POST['mouse']) .",
storage=" . $sdb->quote_smart($_POST['storage']) .",
headphones=" . $sdb->quote_smart($_POST['headphones']) .",
monitor=" . $sdb->quote_smart($_POST['monitor']) .",
cpu=" . $sdb->quote_smart($_POST['cpu']) .",
memory=" . $sdb->quote_smart($_POST['memory']) .",
graphic_card=" . $sdb->quote_smart($_POST['graphic_card']) .",
soundcard=" . $sdb->quote_smart($_POST['soundcard']) .",
motherboard=" . $sdb->quote_smart($_POST['motherboard']) .",
connection=" . $sdb->quote_smart($_POST['connection']) .",
about=" . $sdb->quote_smart($_POST['about']);
$sdb->get_query($sql);
// jesli jest obrazek - zapisz go
if ($_FILES['image']['error'] != 4)
{
$status = $sf->saveImg('image', UPLOAD_DIR .'roster_'. intval($userdata['user_id']), ROSTER_IMG_WIDTH, ROSTER_IMG_HEIGHT, 3);
// zapis udany
if ($status[0])
{
$sql = "UPDATE s_roster SET img_type=". $sdb->quote_smart($status[1]) ."
WHERE user_id=". intval($userdata['user_id']) ."
LIMIT 1";
$sdb->get_query($sql);
}
else
{
?>get_query("SELECT file_ext FROM s_game_cfg
WHERE user_id=". intval($userdata['user_id']) ."
AND gameID=". intval($gameID) )
,0);
if (file_exists($file))
{
@unlink($file);
}
$sql = "DELETE FROM s_game_cfg
WHERE user_id=". intval($userdata['user_id']) ."
AND gameID=". intval($gameID) ."
LIMIT 1";
$sdb->get_query($sql);
}
}
// save configs
if (is_array($_POST['configs']))
{
foreach ($_POST['configs'] as $key )
{
// jesli jest obrazek - zapisz go
if ($_FILES['config_'.$key]['error'] != 4)
{
$status = $sf->writeFile('config_'.intval($key), UPLOAD_DIR .'game_cfg_'. intval($userdata['user_id']) .'_'. intval($key), array('cfg','config','txt','zip','rar','gz','bz2'));
// zapis udany
if ($status[0])
{
$sql = "REPLACE s_game_cfg SET
filename=". $sdb->quote_smart($_FILES['config_'.$key]['name']) .",
file_ext=". $sdb->quote_smart($status[1]) .",
user_id=". intval($userdata['user_id']) .",
gameID=". intval($key);
$sdb->get_query($sql);
}
else
{
?>get_query($sql);
if (mysql_num_rows($res))
{
$row = mysql_fetch_assoc($res);
}
else
{
$row = array();
}
if ($_POST)
{
$row = $_POST;
$row['birth_date'] = $_POST['birth_y'] .'-'. $_POST['birth_m'] .'-'. $_POST['birth_d'];
}
?>