get_data(); $me = (LOGGEDIN && $user['userId'] == $userData['userId'] ? true : false); endif; if ($me) { if (isset($_POST["userEdit"])) { $name = $_POST['userPublicName']; if (!Check::name($name)) array_push($error, $_locale['edit_wrong_public_name']); $rname = $_POST['userRealName']; if (!Check::name($rname)) array_push($error, $_locale['edit_wrong_real_name']); $email = $_POST['userEmail']; if (strlen($email) && !Check::email($email)) array_push($error, $_locale['edit_wrong_email']); $web = $_POST['userWeb']; if (!Check::domain($web)) array_push($error, $_locale['edit_wrong_web']); $bio = htmlspecialchars($_POST['userIntroduction']); if (strlen($bio) > 200) array_push($error, $_locale['edit_wrong_introduction']); $bio = sqlprot($bio); if (empty($error)) if ($_sql->query("UPDATE users SET userPublicName = '$name',userRealName = '$rname',userEmail = '$email',userWeb = '$web',userIntroduction = '$bio' WHERE userId = $user[userId]")) redirect(get_profile_link()); else array_push($error, $_locale['profile_not_updated']); } if (isset($_FILES["userPic"])) { $file = 'data/profile_pics/'.$user['userId'].'.jpg'; if (file_exists($file)) unlink($file); if ($_FILES["userPic"]["error"] < 1 && in_array($_FILES["userPic"]["type"], explode(',', $_set['allowedPicTypes']))) { clear_cache(); $thumb = new Imagick($_FILES["userPic"]["tmp_name"]); //$thumb->resizeImage(500, 500, Imagick::FILTER_POINT, 1, true); $thumb->cropThumbnailImage(500, 500); $thumb->setImageFormat('jpg'); $thumb->writeImage($file); $thumb->destroy(); $profile->setPic(true); redirect(get_current_link()); } else { $profile->setPic(false); } } else { //$profile->setPic(false); //redirect(get_current_link()); } } if (isset($seo[2]) && $seo[2] == 'edit') { addTitle($_locale['profile_edit']); if (theme_component('profile_edit')) include theme_component('profile_edit'); else include 'includes/main/profile_edit.php'; } else { addTitle($userData['userPublicName'].$_locale['s_profile']); if (theme_component('profile')) : include theme_component('profile'); else : if ($profile) : ?>
{locale:name}: =$userData['userRealName']?>
{locale:email}: =$userData['userEmail']?>
{locale:web}: =$userData['userWeb']?>
=$userData['userIntroduction']?>
{locale:profile_not_found}