$name, "featured_collections_changes" => array( "update_parent" => $parent, "force_featured_collection_type" => true, "thumbnail_selection_method" => $FEATURED_COLLECTION_BG_IMG_SELECTION_OPTIONS["most_popular_image"], ), ); $redirect_params = ($parent == 0 ? array() : array("parent" => $parent)); $redirect_url = generateURL("{$baseurl_short}pages/collections_featured.php", $redirect_params); save_collection($new, $coldata); } set_user_collection($userref, $new); daily_stat('New collection', $userref); redirect($redirect_url); } $delete_collections = array(); if (getval("delete", "") != "") { $delete_cols = explode(',', getval("delete", "")); foreach ($delete_cols as $col_ref) { $delete_collections[] = $col_ref; } } foreach ($delete_collections as $delete) { if ($delete != '' && enforcePostRequest(getval("ajax", false))) { // Check user is actually allowed to delete the collection first $collection_data = get_collection($delete); if (!is_array($collection_data) || !can_delete_collection($collection_data, $userref, $k)) { header('HTTP/1.1 401 Unauthorized'); die('Permission denied!'); } # Delete collection delete_collection($collection_data); # Get count of collections $c = get_user_collections($userref); # If the user has just deleted the collection they were using, select a new collection if ($usercollection == $delete && count($c) > 0) { # Select the first collection in the dropdown box. $usercollection = $c[0]["ref"]; set_user_collection($userref, $usercollection); } # User has deleted their last collection? add a new one. if (count($c) == 0) { # No collections to select. Create them a new collection. $usercollection = create_collection($userref, "Default Collection"); set_user_collection($userref, $usercollection); } # To update the page only when all collections have been deleted, remove from the array those already processed. $id_col_deleted = array_search($delete, $delete_collections); if ($id_col_deleted !== false) { unset($delete_collections[$id_col_deleted]); } if (getval('ajax', '') !== '' && getval('dropdown_actions', '') !== '' && count($delete_collections) == 0) { $response = array( 'success' => 'Yes', 'redirect_to_collection' => $usercollection, 'k' => getval('k', ''), 'nc' => time() ); echo json_encode($response); exit(); } } } refresh_collection_frame($usercollection); $removeall = getval("removeall", ""); if ($removeall != "" && enforcePostRequest(false)) { remove_all_resources_from_collection($removeall); refresh_collection_frame($usercollection); } $remove = getval("remove", ""); if ($remove != "" && enforcePostRequest(false)) { # Remove someone else's collection from your My Collections remove_collection($userref, $remove); # Get count of collections $c = get_user_collections($userref); # If the user has just removed the collection they were using, select a new collection if ($usercollection == $remove && count($c) > 0) { # Select the first collection in the dropdown box. $usercollection = $c[0]["ref"]; set_user_collection($userref, $usercollection); } refresh_collection_frame(); } $add = getval("add", ""); if ($add != "" && enforcePostRequest(false)) { # Add someone else's collection to your My Collections add_collection($userref, $add); set_user_collection($userref, $add); refresh_collection_frame(); # Log this daily_stat("Add public collection", $userref); } $reload = getval("reload", ""); if ($reload != "") { # Refresh the collection frame (just edited a collection) refresh_collection_frame(); } $purge = getval("purge", ""); $deleteall = getval("deleteall", ""); if (($purge != "" || $deleteall != "") && enforcePostRequest(false)) { if ($purge != "") { $deletecollection = $purge; } if ($deleteall != "") { $deletecollection = $deleteall; } # Delete all resources in collection if (!checkperm("D")) { $resources = do_search("!collection" . $deletecollection); for ($n = 0; $n < count($resources); $n++) { if (checkperm("e" . $resources[$n]["archive"])) { delete_resource($resources[$n]["ref"]); collection_log($deletecollection, "D", $resources[$n]["ref"]); } } } if ($purge != "") { # Delete collection delete_collection($purge); # Get count of collections $c = get_user_collections($userref); # If the user has just deleted the collection they were using, select a new collection if ($usercollection == $purge && count($c) > 0) { # Select the first collection in the dropdown box. $usercollection = $c[0]["ref"]; set_user_collection($userref, $usercollection); } # User has deleted their last collection? add a new one. if (count($c) == 0) { # No collections to select. Create them a new collection. $usercollection = create_collection($userref, "Default Collection"); set_user_collection($userref, $usercollection); } } refresh_collection_frame($usercollection); } $deleteempty = getval("deleteempty", ""); if ($deleteempty != "" && enforcePostRequest(false)) { $collections = get_user_collections($userref); $deleted_usercoll = false; for ($n = 0; $n < count($collections); $n++) { // if count is zero and not Default Collection and collection is owned by user: if ($collections[$n]['count'] == 0 && $collections[$n]['cant_delete'] != 1 && $collections[$n]['user'] == $userref) { delete_collection($collections[$n]['ref']); if ($collections[$n]['ref'] == $usercollection) { $deleted_usercoll = true; } } } # Get count of collections $c = get_user_collections($userref); # If the user has just deleted the collection they were using, select a new collection if ($deleted_usercoll && count($c) > 0) { # Select the first collection in the dropdown box. $usercollection = $c[0]["ref"]; set_user_collection($userref, $usercollection); } # User has deleted their last collection? add a new one. if (count($c) == 0) { # No collections to select. Create them a new collection. $usercollection = create_collection($userref, "Default Collection"); set_user_collection($userref, $usercollection); } refresh_collection_frame($usercollection); } $removeall = getval("removeall", ""); if ($removeall != "" && enforcePostRequest(false)) { remove_all_resources_from_collection($removeall); refresh_collection_frame($usercollection); } include "../include/header.php"; ?>


" />
" />
"; if ($find == "") { $atoz .= ""; } $atoz .= "" . $lang["viewall"] . ""; if ($find == "") { $atoz .= ""; } $atoz .= "    "; for ($n = ord("A"); $n <= ord("Z"); $n++) { if ($find == chr($n)) { $atoz .= ""; } $atoz .= " " . chr($n) . "  "; if ($find == chr($n)) { $atoz .= ""; } $atoz .= " "; } $atoz .= "
"; $url = $baseurl_short . "pages/collection_manage.php?paging=true&col_order_by=" . urlencode($col_order_by) . "&sort=" . urlencode($sort) . "&find=" . urlencode($find) . ""; ?>
:  |
"return promptBeforePaging();")); ?>
 
 
 
 
 
 
'; } ?> ", {});' >
"; # The number of collections should never be equal to zero. ?>
"return promptBeforePaging();")); ?>

" />