Пример #1
0
	foreach ($addarray as $add)
		{
		hook("preaddtocollection");
		#add to current collection
		if (add_resource_to_collection($add,($to_collection === '') ? $usercollection : $to_collection,false,getvalescaped("size",""))==false)
			{ ?>
			<script language="Javascript">alert("<?php echo $lang["cantmodifycollection"]?>");</script><?php
			}
		else
			{
			# Log this	
			daily_stat("Add resource to collection",$add);
		
			# Update resource/keyword kit count
			$search=getvalescaped("search","");
			if ((strpos($search,"!")===false) && ($search!="")) {update_resource_keyword_hitcount($add,$search);}
			hook("postaddtocollection");
			}
		}	
	# Show warning?
	if (isset($collection_share_warning) && $collection_share_warning)
		{
		?><script language="Javascript">alert("<?php echo $lang["sharedcollectionaddwarning"]?>");</script><?php
		}
	}

$remove=getvalescaped("remove","");
if ($remove!="")
	{
	// If we provide a collection ID use that one instead
	$from_collection = getvalescaped('fromCollection', '');
Пример #2
0
    }
}
if ($pending_review_visible_to_all && isset($userref) && $resource["created_by"] != $userref && $resource["archive"] == -1 && !checkperm("e0")) {
    # When users can view resources in the 'User Contributed - Pending Review' state in the main search
    # via the $pending_review_visible_to_all option, set access to restricted.
    $access = 1;
}
# If requested, refresh the collection frame (for redirects from saves)
if (getval("refreshcollectionframe", "") != "") {
    refresh_collection_frame();
}
# Update the hitcounts for the search keywords (if search specified)
# (important we fetch directly from $_GET and not from a cookie
$usearch = @$_GET["search"];
if (strpos($usearch, "!") === false && $usearch != "") {
    update_resource_keyword_hitcount($ref, $usearch);
}
# Log this activity
daily_stat("Resource view", $ref);
if ($log_resource_views) {
    resource_log($ref, 'v', 0);
}
if ($direct_download && !$save_as) {
    // check browser to see if forcing save_as
    if (!$direct_download_allow_opera && strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "opera") !== false) {
        $save_as = true;
    }
    if (!$direct_download_allow_ie7 && strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "msie 7.") !== false) {
        $save_as = true;
    }
    if (!$direct_download_allow_ie8 && strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "msie 8.") !== false) {
        foreach ($addarray as $add) {
            hook("preaddtocollection");
            #add to current collection
            if (add_resource_to_collection($add, $to_collection === '' ? $usercollection : $to_collection, false, getvalescaped("size", "")) == false) {
                ?>
				<script language="Javascript">alert("<?php 
                echo $lang["cantmodifycollection"];
                ?>
");</script><?php 
            } else {
                # Log this
                daily_stat("Add resource to collection", $add);
                # Update resource/keyword kit count
                $search = getvalescaped("search", "");
                if (strpos($search, "!") === false && $search != "") {
                    update_resource_keyword_hitcount($add, $search);
                }
                hook("postaddtocollection");
            }
        }
        # Show warning?
        if (isset($collection_share_warning) && $collection_share_warning) {
            ?>
<script language="Javascript">alert("<?php 
            echo $lang["sharedcollectionaddwarning"];
            ?>
");</script><?php 
        }
    }
}
$remove = getvalescaped("remove", "");