level_info['level_album_allow'] ) { header("Location: home.php"); exit(); } // BE SURE ALBUM BELONGS TO THIS USER $album = $database->database_query("SELECT * FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='{$user->user_info['user_id']}' LIMIT 1"); if($database->database_num_rows($album) != 1) { header("Location: user_album.php"); exit(); } $album_info = $database->database_fetch_assoc($album); // SET VARIABLES $result = 0; $is_error = 0; // GET PRIVACY SETTINGS $level_album_privacy = unserialize($user->level_info['level_album_privacy']); $level_album_privacy[] = 35; rsort($level_album_privacy); $level_album_comments = unserialize($user->level_info['level_album_comments']); rsort($level_album_comments); $level_album_tag = unserialize($user->level_info['level_album_tag']); rsort($level_album_tag); // SAVE NEW INFO if($task == "dosave") { $album_info['album_title'] = censor($_POST['album_title']); $album_info['album_desc'] = censor(str_replace("\r\n", "
", $_POST['album_desc'])); $album_info['album_search'] = $_POST['album_search']; $album_info['album_privacy'] = $_POST['album_privacy']; $album_info['album_comments'] = $_POST['album_comments']; $album_info['album_tag'] = $_POST['album_tag']; $album_info['album_dateupdated'] = time(); if($album_info['album_privacy']!=35) { $album_info['friendsallowed']=""; } else { $album_info['friendsallowed']=""; foreach($_POST["friendtypes"] as $friendsallowed){ $album_info['friendsallowed'].=$friendsallowed.","; } $album_info['friendsallowed']=serialize($album_info['friendsallowed']); } // MAKE SURE SUBMITTED PRIVACY OPTIONS ARE ALLOWED, IF NOT, SET TO EVERYONE if(!in_array($album_info['album_privacy'], $level_album_privacy)) { $album_info['album_privacy'] = $level_album_privacy[0]; } if(!in_array($album_info['album_comments'], $level_album_comments)) { $album_info['album_comments'] = $level_album_comments[0]; } if(!in_array($album_info['album_tag'], $level_album_tag)) { $album_info['album_tag'] = $level_album_tag[0]; } // CHECK THAT TITLE IS NOT BLANK if(trim($album_info[album_title]) == "") { $is_error = 1000073; } // IF NO ERROR, CONTINUE if($is_error == 0) { // EDIT ALBUM IN DATABASE $database->database_query("UPDATE se_albums SET album_title='{$album_info['album_title']}', album_desc='{$album_info['album_desc']}', album_search='{$album_info['album_search']}', album_privacy='{$album_info['album_privacy']}', album_comments='{$album_info['album_comments']}', album_tag='{$album_info['album_tag']}', album_dateupdated='{$album_info['album_dateupdated']}', friendsallowed='{$album_info['friendsallowed']}' WHERE album_id='{$album_info['album_id']}' LIMIT 1"); // UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST) $user->user_lastupdate(); $result = 1; } } // GET PREVIOUS PRIVACY SETTINGS for($c=0;$cdatabase_query("SELECT DISTINCT(Binary friend_type) as friend_type FROM se_friends WHERE friend_user_id1='".$user->user_info["user_id"]."'"); while($row=$database->database_fetch_array($query)) { $friendtypes[]=array("friendtype"=>$row["friend_type"]); } function friendtypecheckboxes() { global $friendtypes, $album_info; ?> checked='checked' onclick="changecheck();">
style="display:none;"> " checked="checked">
", "\r\n", $album_info[album_desc]); // ASSIGN VARIABLES AND SHOW EDIT ALBUMS PAGE $smarty->assign('result', $result); $smarty->assign('is_error', $is_error); $smarty->assign('album_info', $album_info); $smarty->assign('privacy_options', $privacy_options); $smarty->assign('friendtypes', $friendtypes); $smarty->assign('comment_options', $comment_options); $smarty->assign('tag_options', $tag_options); include "footer.php"; ?>