load((int)$uid); } catch (PAException $e) { $msg = "Error occured in retreiving user information\n"; $msg .= "
".$e->message."
"; $error = TRUE; } } $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"; } // Image album delete try { if(($_GET['action']=='delete_album') && ($uid == $_SESSION['user']['id'])) { $type = "IMAGE_ALBUM"; $album = new Album($type); $album->collection_id = $_GET['alb_id']; $album->album_type = $type; $album->delete(); } } catch (PAException $e) { $msg = "$e->message"; $error = TRUE; } // deleting images try { if($_GET['action']=='delete') { foreach ($_POST as $k=>$v) { $delete_pics_id[] = $k; } array_pop($delete_pics_id); foreach ($delete_pics_id as $id) { $new_image = new Image(); $new_image->content_id = $id; $new_image->delete($id); } } } catch (PAException $e) { $msg = "$e->message"; $error = TRUE; } // FOR IMAGE UPLOAD - START if ($_POST['submit'] && !empty($_FILES['userfile']['name'])) { $upload = uihelper_upload_gallery ($uid, $_POST, $_FILES, ''); if ($upload[3] == TRUE) { $uploaded = TRUE; $msg1 = "Image Uploaded"; } } // Load Image Albums $image_albums = Album::load_all($uid, IMAGE_ALBUM); $image_data = array(); $image_ids = array(); $j=0; foreach ($image_albums as $albums) { $new_album = new Album(IMAGE_ALBUM); $image_data[$j]['album_name'] = $albums['description']; $image_data[$j]['album_id'] = $albums['collection_id']; $new_album->collection_id = $albums['collection_id']; $image_ids = $new_album->get_contents_for_collection(); if (!empty($image_ids)) { $k=0; $ids = array(); for ($i=0; $iload_many($ids); foreach ($data as $d) { $image_data[$j]['image_data'][$k]['content_id'] = $d['content_id']; $image_data[$j]['image_data'][$k]['image_file'] = $d['image_file']; $image_data[$j]['image_data'][$k]['image_caption'] = $d['image_caption']; $image_data[$j]['image_data'][$k]['title'] = $d['title']; $image_data[$j]['image_data'][$k]['body'] = $d['body']; $image_data[$j]['image_data'][$k]['created'] = $d['created']; $k++; } } $j++; } $image_ext = explode("|", $GLOBALS['file_type_info']['image']['ext']); $parameter = js_includes("base"); html_header("user gallery", $parameter); ?> set('msg', $msg); } $content->set('login_name', $login_name); $content->set('first_name', $first_name); $content->set('last_name', $last_name); $content->set('base_url', $base_url); $content->set('uid', $uid); $content->set('image_data', $image_data); $content->set('image_ext', $image_ext); $content->set('error', $upload[1]); // 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); } $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); echo $content->fetch(); $footer = & new Template(CURRENT_THEME_FSPATH."/footer.tpl"); echo $footer->fetch(); ?>