?? collections.php
字號:
<?include "include/db.php";include "include/collections_functions.php";# External access support (authenticate only if no key provided, or if invalid access key provided)$k=getvalescaped("k","");if (($k=="") || (!check_access_key_collection(getvalescaped("collection",""),$k))) {include "include/authenticate.php";}include "include/general.php";include "include/research_functions.php";include "include/resource_functions.php";include "include/search_functions.php";# Hide/show thumbs$thumbs=getval("thumbs",$thumbs_default);setcookie("thumbs",$thumbs);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title><?=$applicationname?></title><link href="css/global.css" rel="stylesheet" type="text/css" media="screen,projection,print" /><link href="css/Col-<?=(isset($userfixedtheme) && $userfixedtheme!="")?$userfixedtheme:getval("colourcss","greyblu")?>.css" rel="stylesheet" type="text/css" media="screen,projection,print" id="colourcss"/><!--[if lte IE 6]> <link href="css/globalIE.css" rel="stylesheet" type="text/css" media="screen,projection,print" /> <![endif]--><!--[if lte IE 5.6]> <link href="css/globalIE5.css" rel="stylesheet" type="text/css" media="screen,projection,print" /> <![endif]--><?$collection=getvalescaped("collection","");if ($collection!="") { hook("prechangecollection"); #change current collection if ($k=="" && $collection==-1) { # Create new collection $name=get_mycollection_name($userref); $new=create_collection ($userref,$name); set_user_collection($userref,$new); # Log this daily_stat("New collection",$userref); } else { # Switch the existing collection if ($k=="") {set_user_collection($userref,$collection);} $usercollection=$collection; } hook("postchangecollection"); }# Load collection info.$cinfo=get_collection($usercollection);# Check to see if the user can edit this resource.$collectiondata=get_collection($collection);$allow_reorder=false;if (($k=="") && (($userref==$cinfo["user"]) || ($cinfo["allow_changes"]==1) || (checkperm("h")))) { $allow_reorder=true; }# Include function for reordering / infoboxif ($allow_reorder || $infobox) { ?> <script src="js/prototype.js" type="text/javascript"></script> <script src="js/scriptaculous.js" type="text/javascript"></script> <script src="js/infobox_collection.js" type="text/javascript"></script> <script type="text/javascript"> function ReorderResources(id1,id2) { document.location='collections.php?reorder=' + id1 + '-' + id2; } </script> <? # Also check for the parameter and reorder as necessary. $reorder=getvalescaped("reorder",""); if ($reorder!="") { $r=explode("-",$reorder); swap_collection_order(substr($r[0],13),$r[1],$usercollection); } }?></head><body class="CollectBack" id="collectbody"<? if ($infobox) { ?> OnMouseMove="InfoBoxMM(event);"<? } ?>><?$add=getvalescaped("add","");if ($add!="") { hook("preaddtocollection"); #add to current collection if (add_resource_to_collection($add,$usercollection)==false) { ?><script language="Javascript">alert("<?=$lang["cantmodifycollection"]?>");</script><? }; # 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"); }$remove=getvalescaped("remove","");if ($remove!="") { hook("preremovefromcollection"); #remove from current collection if (remove_resource_from_collection($remove,$usercollection)==false) { ?><script language="Javascript">alert("<?=$lang["cantmodifycollection"]?>");</script><? }; hook("postremovefromcollection"); } $addsearch=getvalescaped("addsearch",-1);if ($addsearch!=-1) { hook("preaddsearch"); if (getval("mode","")=="") { #add saved search add_saved_search($usercollection); # Log this daily_stat("Add saved search to collection",0); } else { #add saved search (the items themselves rather than just the query) add_saved_search_items($usercollection); # Log this daily_stat("Add saved search items to collection",0); } hook("postaddsearch"); }$removesearch=getvalescaped("removesearch","");if ($removesearch!="") { hook("preremovesearch"); #remove saved search remove_saved_search($usercollection,$removesearch); hook("postremovesearch"); } $research=getvalescaped("research","");if ($research!="") { hook("preresearch"); $col=get_research_request_collection($research); if ($col==false) { $rr=get_research_request($research); $new=create_collection ($rr["user"],"Request: " . $rr["name"],1); set_user_collection($userref,$new); set_research_collection($research,$new); } else { set_user_collection($userref,$col); } hook("postresearch"); } hook("processusercommand");?><script language="Javascript">function ToggleThumbs() { document.getElementById("collectbody").style.paddingTop="400px"; <? if ($thumbs=="show") { ?> document.getElementById("CollectionSpace").style.visibility="hidden"; top.document.getElementById("topframe").rows="*,3,33"; <? } else { ?> top.document.getElementById("topframe").rows="*,3,138"; <? } ?> }<? if ($thumbs=="hide") { ?>top.document.getElementById("topframe").rows="*,3,33";<? } ?></script><? $searches=get_saved_searches($usercollection);$result=do_search("!collection" . $usercollection);$cinfo=get_collection($usercollection);if ($thumbs=="show") { # ---------------------------- Maximised viewif ($k!="") { # Anonymous access, slightly different display $tempcol=get_collection($usercollection); ?><div id="CollectionMenu"> <h2><?=$tempcol["name"]?></h2> <br /> <?=$lang["created"] . " " . nicedate($tempcol["created"])?><br /> <?=count($result) . " " . $lang["youfoundresources"]?><br /> <? if (isset($zipcommand)) { ?> <a href="collection_download.php?collection=<?=$usercollection?>&k=<?=$k?>" target="main">> <?=$lang["action-download"]?></a> <? } ?></div><?} else {?><div id="CollectionMenu"><? if (!hook("thumbsmenu")) { ?> <h2><?=$lang["mycollections"]?></h2> <form method="get" id="colselect"> <div class="SearchItem" style="padding:0;margin:0;"><?=$lang["currentcollection"]?>: <select name="collection" onchange="document.getElementById('colselect').submit();" class="SearchWidth"> <? $list=get_user_collections($userref); $found=false; for ($n=0;$n<count($list);$n++) {
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -