}
    }
    # 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.
        $name = get_mycollection_name($userref);
        $usercollection = create_collection($userref, $name);
        set_user_collection($userref, $usercollection);
    }
    refresh_collection_frame($usercollection);
}
hook('customcollectionmanage');
$removeall = getvalescaped("removeall", "");
if ($removeall != "") {
    remove_all_resources_from_collection($removeall);
    refresh_collection_frame($usercollection);
}
include "../include/header.php";
?>
  <div class="BasicsBox">
    <h2>&nbsp;</h2>
    <h1><?php 
echo $lang["managemycollections"];
                    ?>
</option><?php 
                }
                ?>
		
		<?php 
                if ($upload_force_mycollection) {
                    $list = get_user_collections($userref, "My Collection");
                } else {
                    $list = get_user_collections($userref);
                }
                $currentfound = false;
                // make sure it's possible to set the collection with collection_add (compact style "upload to this collection"
                if ($collection_add != "" && getval("resetform", "") == "" && (!isset($save_errors) || !$save_errors)) {
                    # Switch to the selected collection (existing or newly created) and refresh the frame.
                    set_user_collection($userref, $collection_add);
                    refresh_collection_frame($collection_add);
                }
                for ($n = 0; $n < count($list); $n++) {
                    if ($collection_dropdown_user_access_mode) {
                        $colusername = $list[$n]['fullname'];
                        # Work out the correct access mode to display
                        if (!hook('collectionaccessmode')) {
                            if ($list[$n]["public"] == 0) {
                                $accessmode = $lang["private"];
                            } else {
                                if (strlen($list[$n]["theme"]) > 0) {
                                    $accessmode = $lang["theme"];
                                } else {
                                    $accessmode = $lang["public"];
                                }
Пример #3
0
include "../include/general.php";
include "../include/resource_functions.php";
include "../include/search_functions.php";
include "../include/collections_functions.php";

if (getval("purchaseonaccount","")!="" && $userrequestmode==3)
	{
	# Invoice mode.
	# Mark as payment complete.
	payment_set_complete($usercollection);
	
	# Set new user collection to empty the basket (without destroying the old basket which contains the 'paid' flag to enable the download).
	$oldcollection=$usercollection;
	$name=get_mycollection_name($userref);
	$newcollection=create_collection ($userref,$name,0,1); // make not deletable
	set_user_collection($userref,$newcollection);
	
	# Redirect to basket (old) collection for download.
	redirect($baseurl_short."pages/purchase_download.php?collection=" . $oldcollection);
	}


include "../include/header.php";


if (getval("submit","")=="")
	{
	# ------------------- Show the size selection screen -----------------------
	?>
	<div class="BasicsBox"> 
	  <h2>&nbsp;</h2>
function add_smart_collection()
{
    global $userref;
    $search = getvalescaped("addsmartcollection", "");
    $restypes = getvalescaped("restypes", "");
    if ($restypes == "Global") {
        $restypes = "";
    }
    $archive = getvalescaped("archive", "", true);
    $starsearch = getvalescaped("starsearch", 0);
    // more compact search strings should work with get_search_title
    $searchstring = array();
    if ($search != "") {
        $searchstring[] = "search={$search}";
    }
    if ($restypes != "") {
        $searchstring[] = "restypes={$restypes}";
    }
    if ($starsearch != "") {
        $searchstring[] = "starsearch={$starsearch}";
    }
    if ($archive != 0) {
        $searchstring[] = "archive={$archive}";
    }
    $searchstring = implode("&", $searchstring);
    if ($starsearch == "") {
        $starsearch = 0;
    }
    $newcollection = create_collection($userref, get_search_title($searchstring), 1);
    sql_query("insert into collection_savedsearch(collection,search,restypes,archive,starsearch) values ('{$newcollection}','" . $search . "','" . $restypes . "','" . $archive . "','" . $starsearch . "')");
    $savedsearch = sql_insert_id();
    sql_query("update collection set savedsearch='{$savedsearch}' where ref='{$newcollection}'");
    set_user_collection($userref, $newcollection);
}
Пример #5
0
$research=getvalescaped("research","");
if ($research!="")
	{
	hook("preresearch");
	$col=get_research_request_collection($research);
	if ($col==false)
		{
		$rr=get_research_request($research);
		$name="Research: " . $rr["name"];  # Do not translate this string, the collection name is translated when displayed!
		$new=create_collection ($rr["user"],$name,1);
		set_user_collection($userref,$new);
		set_research_collection($research,$new);
		}
	else
		{
		set_user_collection($userref,$col);
		}
	hook("postresearch");
	}
	
hook("processusercommand");
?>


<?php 
$searches=get_saved_searches($usercollection);

// Note that the full search is done initially. The time saved is due to content drawing and transfer.
$result=do_search("!collection" . $usercollection,"","relevance",0);
$count_result=count($result);