load((int)$uid);
}
catch (PAException $e) {
$msg = "Error occured in retreiving user information\n";
$msg .= "
".$e->message."";
$error = TRUE;
}
}
// user general info
$user_data_general = array();
$user_generaldata = User::load_user_profile($uid, (int)$_SESSION['user']['id'], GENERAL);
for ($i=0; $iupload_file($uploaddir,'user_caption_image',true,true,$image_type);
if( $file == false) {
$msg = $myUploadobj->error;
$error = TRUE;
}
else {
$user_caption_image = $file;
}
}
else {
$user_caption_image = $user_data_general['user_caption_image'];
}
if ((!empty($day) || !empty($month) || !empty($year)) && (empty($day) || empty($month) || empty($year))){
$msg = "Bitrthday field given is wrong, please fill valid date.";
$error = TRUE;
}
if (($_POST['month']) && ($_POST['day']) && ($_POST['year'])) {
$dob_validation = checkdate ($_POST['month'], $_POST['day'], $_POST['year']);
}
if ((($_POST['month']) || ($_POST['day']) || ($_POST['year'])) && $dob_validation == '0') {
$msg = "The Date of Birth is invalid.";
$error = TRUE;
}
if ($error != TRUE) {
if (!empty($homepage)) {
if (!strstr($homepage, "http://")) {
$homepage = "http://".$homepage;
}
}
$tags = explode(',', $_POST['user_tags']);
foreach ($tags as $term) {
$tr = trim($term);
if ($tr) {
$terms[] = $tr;
}
}
for ($i=0; $i'; print_r($array_user_data); exit;
try {
$user->save_user_profile($array_user_data, $information_type);
//$user->save();
Tag::add_tags_to_user($user->user_id, $terms);
} catch (PAException $e) {
$msg = "$e->message";
$save_error = TRUE;
}
}
if ($error == TRUE || $save_error == TRUE) {
$msg = 'Sorry: you are unable to save data.
Reason: '."$msg";
}
else {
// invalidate the cache for user profile
$user_id = $_SESSION['user']['id'];
$file = "$current_theme_path/user_profile.tpl?uid=$user_id";
CachedTemplate::invalidate_cache($file);
header("Location: edit_personalprofile.php");
}
}
$user_picture = $user->picture;
if ($user->picture) {
$img_path = $base_url."/files/".$user->picture;
}
else {
$img_path = $base_url."/images/default.jpg";
}
$user_data = array();
$user_generaldata = User::load_user_profile($uid, (int)$_SESSION['user']['id'], $information_type);
for ($i=0; $i';
print html_header("edit general profile-".$_SESSION['user']['first_name']." ".$_SESSION['user']['last_name'], $parameter);
?>
set('msg', $msg);
}
$content->set('user_data', $user_data);
// header
$header = & new Template(CURRENT_THEME_FSPATH."/header.tpl");
$header->set('current_theme_path', $current_theme_path);
//$header->set('current_theme_path', $current_theme_path);
$header->tier_one_tab = $main_tier;
$header->tier_two_tab = $second_tier;
$header->tier_three_tab = $third_tier;
if ($network_info) {
$header->set_object('network_info', $network_info);
}
$onload = "fillcountry('".$user_data['country']."');";
$header->set(onload, $onload);
$header->set('user_name', $first_name." ".$last_name);
$content->set('header', $header);
$left_panel = & new Template(CURRENT_THEME_FSPATH."/left_page.tpl");
$left_panel->set('img_path', $img_path);
$content->set('left_panel', $left_panel);
$right_panel = & new Template(CURRENT_THEME_FSPATH."/right_editprofile.tpl");
$content->set('right_panel', $right_panel);
$footer = & new Template(CURRENT_THEME_FSPATH."/footer.tpl");
echo $content->fetch();
echo $footer->fetch();
?>