load((int)$uid); } catch (PAException $e) { $msg = "Error occured in retreiving user information\n"; $msg .= "
".$e->message."
"; $error = TRUE; } } if (isset($_POST['submit'])) { /* Function for Filtering the POST data Array */ filter_all_post($_POST); if ($_POST['type'] == 'image') { $new_save = new Image(); } else if ($_POST['type'] == 'audio') { $new_save = new Audio(); } else if ($_POST['type'] == 'video') { $new_save = new Video(); } $new_save->content_id = $_POST['file_id']; $new_save->author_id = $_SESSION['user']['id']; $new_save->title = stripslashes(trim($_POST['caption'])); $new_save->title = strip_tags($new_save->title); $new_save->excerpt = stripslashes(trim($_POST['caption'])); $new_save->excerpt = strip_tags($new_save->excerpt); $new_save->body = stripslashes(trim($_POST['body'])); $new_save->body = stripslashes($new_save->body); $new_save->file_name = $_POST['file_name']; $new_save->allow_comments = 1; $new_save->save(); if ($_POST['type'] == 'image') { header("Location: gallery_image.php?uid=".($_SESSION['user']['id'])); } if ($_POST['type'] == 'audio') { header("Location: gallery_audio.php?uid=".($_SESSION['user']['id'])); } if ($_POST['type'] == 'video') { header("Location: gallery_video.php?uid=".($_SESSION['user']['id'])); } } $login_name = $user->login_name; $first_name = $user->first_name; $last_name = $user->last_name; $email = $user->email; $user_picture = $user->picture; if ($user->picture) { $img_path = $base_url."/files/".$user->picture; } else { $img_path = $base_url."/images/default.jpg"; } print html_header(); ?> set('msg', $msg); } $content->set('login_name', $login_name); $content->set('first_name', $first_name); $content->set('last_name', $last_name); $content->set('email', $email); $content->set('user_picture', $user_picture); $content->set('base_url', $base_url); $header = & new Template(CURRENT_THEME_FSPATH."/header.tpl"); if ($network_info) { $header->set_object('network_info', $network_info); } $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); $footer = & new Template(CURRENT_THEME_FSPATH."/footer.tpl"); echo $content->fetch(); echo $footer->fetch(); ?>