本文整理汇总了PHP中get_collection函数的典型用法代码示例。如果您正苦于以下问题:PHP get_collection函数的具体用法?PHP get_collection怎么用?PHP get_collection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_collection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: morsle_get_files
function morsle_get_files($morsle, $wdir, &$collectionid)
{
global $USER, $COURSE;
global $userstr, $deptstr;
$collections = explode('/', $wdir);
if ($wdir === '') {
// root of morsle files, user and department are prepended in display_dir
$files = get_doc_feed($morsle, $collectionid);
// go get folder contents from Google
} elseif (strpos($wdir, $deptstr) === false && strpos($wdir, $userstr) === false) {
// course collection
$basecollectionid = sizeof($collections) > 2 ? get_collection($morsle, $collections[sizeof($collections) - 2]) : null;
// $basecollectionid = second to last collection in path that is passed
$collectionid = get_collection($morsle, $collections[sizeof($collections) - 1], $basecollectionid);
// $collectionid = last collection in path that is passed
// TODO: send a path to be used to get the doc feed from a nested collection
$files = get_doc_feed($morsle, $collectionid);
// go get folder contents from Google
} else {
// departmental or user account collection
$basecollectionid = sizeof($collections) > 3 ? get_collection($morsle, $collections[sizeof($collections) - 2]) : null;
// $basecollectionid = second to last collection in path that is passed
$collectionid = sizeof($collections) > 2 ? get_collection($morsle, $collections[sizeof($collections) - 1], $basecollectionid) : null;
// $collectionid = last collection in path that is passed
// go get folder contents from Google
if ($collectionid == null || $collectionid === '') {
$collectionid = 'root';
}
// TODO: send a path to be used to get the doc feed from a nested collection
$files = get_doc_feed($morsle, $collectionid);
// go get folder contents from Google
}
return $files;
}
示例2: get_table
function get_table($table)
{
$db = get_collection();
$t = $db->{$table};
switch ($table) {
case 'answer':
$t->ensureIndex(array('vote' => -1, 'q_id' => -1));
break;
case 'question':
$t->ensureIndex(array('id' => 1));
break;
case 'user':
$t->ensureIndex(array('name' => -1));
break;
default:
# code...
break;
}
return $t;
}
示例3: support
<?php
include "../include/db.php";
include "../include/general.php";
# External access support (authenticate only if no key provided, or if invalid access key provided)
$k=getvalescaped("k","");if (($k=="") || (!check_access_key(getvalescaped("ref","",true),$k))) {include "../include/authenticate.php";}
include "../include/collections_functions.php";
include "../include/resource_functions.php";
include "../include/search_functions.php";
$ref=getvalescaped("ref","",true);
$collection=getvalescaped("collection","",true);
# Fetch collection data
$cinfo=get_collection($collection);if ($cinfo===false) {exit("Collection not found.");}
$commentdata=get_collection_resource_comment($ref,$collection);
$comment=$commentdata["comment"];
$rating=$commentdata["rating"];
# Check access
if (!$cinfo["request_feedback"] && ($userref!=$cinfo["user"]) && ($cinfo["allow_changes"]!=1) && (!checkperm("h"))) {exit("Access denied.");}
if (getval("save","")!="")
{
# Save comment
$comment=trim(getvalescaped("comment",""));
$rating=trim(getvalescaped("rating",""));
save_collection_resource_comment($ref,$collection,$comment,$rating);
if ($k=="")
{
redirect ($baseurl_short."pages/search.php?refreshcollectionframe=true&search=!collection" . $collection);
}
示例4: get_collection
$per_page=getvalescaped("per_page_list_log",15);setcookie("per_page_list_log",$per_page, 0, '', '', false, true);
include "../include/header.php";
$log=get_collection_log($ref, $offset+$per_page);
$results=count($log);
$totalpages=ceil($results/$per_page);
$curpage=floor($offset/$per_page)+1;
$url=$baseurl . "/pages/collection_log.php?ref=" . $ref;
$jumpcount=1;
?>
<?php
# Fetch and translate collection name
$colinfo = get_collection($ref);
$colname = i18n_get_collection_name($colinfo);
if (!checkperm("b"))
{
# Add selection link to collection name.
$colname = "<a href=\"" . $baseurl_short . "pages/collections.php?collection=" . $ref . "\" onClick=\"return CollectionDivLoad(this);\">" . $colname . "</a>";
}
?>
<div class="BasicsBox">
<?php if ($back_to_collections_link != "") { ?><div style="float:right;"><a href="<?php echo $baseurl_short?>pages/collection_manage.php" onClick="return CentralSpaceLoad(this,true);"><strong><?php echo $back_to_collections_link ?></strong> </a></div> <?php } ?>
<h1><?php echo str_replace("%collection", $colname, $lang["collectionlogheader"]);?></h1>
<div class="TopInpageNav">
<div class="InpageNavLeftBlock"><?php echo $lang["resultsdisplay"]?>:
<?php
for($n=0;$n<count($list_display_array);$n++){?>
示例5: do_contactsheet_sizing_calculations
}
$bottomy = $pdf->GetY();
# Add spacing cell
if ($sheetstyle == "list") {
$pdf->Cell($cellsize[0], 0.5, '', 0, 0);
} else {
if ($sheetstyle == "thumbnails") {
$pdf->Setx($topx);
$pdf->Cell($cellsize[0], $bottomy - $topy + $imagesize + 0.2, '', 0, 0);
}
}
}
$deltay = 1;
do_contactsheet_sizing_calculations();
#Get data
$collectiondata = get_collection($collection);
if (is_numeric($order_by)) {
$order_by = "field" . $order_by;
}
//debug("Contact Sheet Sort is $order_by $sort");
$result = do_search("!collection" . $collection, "", $order_by, 0, -1, $sort);
if ($sheetstyle == "thumbnails") {
$getfields = $config_sheetthumb_fields;
} else {
if ($sheetstyle == "list") {
$getfields = $config_sheetlist_fields;
} else {
if ($sheetstyle == "single") {
$getfields = $config_sheetsingle_fields;
}
}
示例6:
daily_stat("New collection",$userref);
}
elseif(!isset($usercollection) || $collection!=$usercollection)
{
$validcollection=sql_value("select ref value from collection where ref='$collection'",0);
# 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 collection.
$allow_reorder=false;
if (($k=="") && (($userref==$cinfo["user"]) || ($cinfo["allow_changes"]==1) || (checkperm("h"))))
{
$allow_reorder=true;
}
# Reordering capability
if ($allow_reorder)
{
# Also check for the parameter and reorder as necessary.
$reorder=getvalescaped("reorder",false);
if ($reorder)
{
示例7: do_search
$collections = $getthemes;
$collection = $getthemes[$m]["ref"];
$colresult = do_search("!collection" . $collection);
$cinfo = get_collection($collection);
$feedback = $cinfo["request_feedback"];
$k = "";
} else {
if ($pagename == "collections") {
$collection = $usercollection;
$colresult = $result;
}
}
}
if ($pagename == "search" && isset($resources) && is_array($resources)) {
$colresult = $resources;
$cinfo = get_collection($collections[$n]['ref']);
$feedback = $cinfo["request_feedback"];
$collection_results = true;
$collection = $collections[$n]['ref'];
}
$count_result = count($colresult);
// check editability
$col_editable = false;
if (count($colresult) > 0 && checkperm("e" . $colresult[0]["archive"]) && allow_multi_edit($colresult)) {
$col_editable = true;
}
if ($pagename != "collection_manage" && $pagename != "collection_public" && $pagename != "themes") {
?>
<form method="get" name="colactions" id="colactions" action="collections_compact_style.php">
<?php
}
示例8: getvalescaped
<?php
include "../include/db.php";
include "../include/authenticate.php";
include "../include/general.php";
include "../include/search_functions.php";
include "../include/resource_functions.php";
include "../include/collections_functions.php";
# Fetch vars
$ref = getvalescaped("ref", "", true);
# if bypass sharing page option is on, redirect to e-mail
if ($bypass_share_screen) {
header('Location:collection_email.php?ref=' . $ref);
}
$collection = get_collection($ref);
# Process deletion of access keys
if (getval("deleteaccess", "") != "") {
delete_collection_access_key($ref, getvalescaped("deleteaccess", ""));
}
# Get min access to this collection
$minaccess = collection_min_access($ref);
if ($minaccess >= 1 && !$restricted_share) {
$show_error = true;
$error = $lang["restrictedsharecollection"];
}
if (!$collection_allow_empty_share && count(get_collection_resources($ref)) == 0) {
$show_error = true;
$error = $lang["cannotshareemptycollection"];
}
include "../include/header.php";
?>
示例9: foreach
echo $message;
}
?>
<?php
if (isset($collection_results)) {
?>
<div class="collectionresults">
<a href="?action=collectionsearch">Search again</a>
<h1>Results</h1>
<ul>
<?php
foreach ($collection_results as $collection_result) {
?>
<?php
//var_dump($collection_result);
$collection = get_collection($collection_result['collection_id']);
$collection_owner = get_owner($collection_result['collection_id']);
?>
<li><a href="<?php
echo '.?action=collection&collectionid=' . $collection['collection_id'];
?>
"><?php
echo $collection['collection_name'] . ' by ' . $collection_owner['user_name'];
?>
</a></li>
<?php
}
?>
</ul>
</div>
示例10: dbg_error_log
dbg_error_log("PROPFIND", "Getting item: Path: %s", $item_path);
$sql = "SELECT caldav_data.dav_name, caldav_data, caldav_data.dav_etag ";
$sql .= "FROM caldav_data WHERE dav_name = ?";
$qry = new PgQuery($sql, PgQuery::Plain(iCalendar::HttpDateFormat()), PgQuery::Plain(iCalendar::HttpDateFormat()), $item_path);
if ($qry->Exec("PROPFIND", __LINE__, __FILE__) && $qry->rows > 0) {
while ($item = $qry->Fetch()) {
$responses[] = item_to_xml($item);
}
}
return $responses;
}
$request->UnsupportedRequest($unsupported);
// Won't return if there was unsupported stuff.
/**
* Something that we can handle, at least roughly correctly.
*/
$url = $c->protocol_server_port_script . $request->path;
$url = preg_replace('#/$#', '', $url);
if ($request->IsCollection()) {
$responses = get_collection($request->depth, $request->user_no, $request->path);
} elseif ($request->AllowedTo('read')) {
$responses = get_item($request->path);
} else {
$request->DoResponse(403, translate("You do not have appropriate rights to view that resource."));
}
$multistatus = new XMLElement("multistatus", $responses, array('xmlns' => 'DAV:'));
// dbg_log_array( "PROPFIND", "XML", $multistatus, true );
$xmldoc = $multistatus->Render(0, '<?xml version="1.0" encoding="utf-8" ?>');
$etag = md5($xmldoc);
header("ETag: \"{$etag}\"");
$request->DoResponse(207, $xmldoc, 'text/xml; charset="utf-8"');
示例11: if
$cinfo=get_collection($collection);
$feedback=$cinfo["request_feedback"];
}
elseif ($pagename=="themes"){
$n=$m;
$collections=$getthemes;
$collection=$getthemes[$m]["ref"];
$colresult=do_search("!collection" . $collection);
$cinfo=get_collection($collection);
$feedback=$cinfo["request_feedback"];
$k="";
}
else if ($pagename=="collections"||$pagename=="collections_frameless_loader"){
$collection=$usercollection;$colresult=$result;
}
if ($pagename=="search" && isset($resources) && is_array($resources)){$colresult=$resources;$cinfo=get_collection($collections[$n]['ref']);$feedback=$cinfo["request_feedback"];$collection_results=true;$collection=$collections[$n]['ref'];}
}
$count_result=count($colresult);
// check editability
$col_editable=false;
if (count($colresult)>0 && checkperm("e" . $colresult[0]["archive"]) && allow_multi_edit($colresult)){
$col_editable=true;
}
?>
<select <?php if ($pagename=="collections"){if ($collection_dropdown_user_access_mode){?>class="SearchWidthExp" style="margin:0;"<?php } else { ?> class="SearchWidth" style="margin:0;"<?php } } $tag=$pagename."-coltools-".$collection;if ($pagename=="collections"){$tag.="_usercol";}
示例12: managed_collection_request
function managed_collection_request($ref, $details, $ref_is_resource = false)
{
# Request mode 1
# Managed via the administrative interface
# An e-mail is still sent.
global $applicationname, $email_from, $baseurl, $email_notify, $username, $useremail, $userref, $lang, $request_senduserupdates, $watermark, $filename_field, $view_title_field, $access, $resource_type_request_emails;
# Has a resource reference (instead of a collection reference) been passed?
# Manage requests only work with collections. Create a collection containing only this resource.
if ($ref_is_resource) {
$admin_mail_template = "emailresourcerequest";
$user_mail_template = "emailuserresourcerequest";
$resourcedata = get_resource_data($ref);
$templatevars['thumbnail'] = get_resource_path($ref, true, "thm", false, "jpg", $scramble = -1, $page = 1, $watermark ? $access == 1 ? true : false : false);
if (!file_exists($templatevars['thumbnail'])) {
$templatevars['thumbnail'] = "../gfx/" . get_nopreview_icon($resourcedata["resource_type"], $resourcedata["file_extension"], false);
}
$templatevars['url'] = $baseurl . "/?r=" . $ref;
if (isset($filename_field)) {
$templatevars["filename"] = $lang["fieldtitle-original_filename"] . ": " . get_data_by_field($ref, $filename_field);
}
if (isset($resourcedata["field" . $view_title_field])) {
$templatevars["title"] = $resourcedata["field" . $view_title_field];
}
$c = create_collection($userref, $lang["request"] . " " . date("ymdHis"));
add_resource_to_collection($ref, $c);
$ref = $c;
# Proceed as normal
} else {
$admin_mail_template = "emailcollectionrequest";
$user_mail_template = "emailusercollectionrequest";
$collectiondata = get_collection($ref);
$templatevars['url'] = $baseurl . "/?c=" . $ref;
if (isset($collectiondata["name"])) {
$templatevars["title"] = $collectiondata["name"];
}
}
# Fomulate e-mail text
$templatevars['username'] = $username;
$templatevars["useremail"] = $useremail;
$userdata = get_user($userref);
$templatevars["fullname"] = $userdata["fullname"];
$message = "";
reset($_POST);
foreach ($_POST as $key => $value) {
if (strpos($key, "_label") !== false) {
# Add custom field
$setting = trim($_POST[str_replace("_label", "", $key)]);
if ($setting != "") {
$message .= $value . ": " . $setting . "\n\n";
}
}
}
if (trim($details) != "") {
$message .= $lang["requestreason"] . ": " . newlines($details) . "\n\n";
} else {
return false;
}
# Add custom fields
$c = "";
global $custom_request_fields, $custom_request_required;
if (isset($custom_request_fields)) {
$custom = explode(",", $custom_request_fields);
# Required fields?
if (isset($custom_request_required)) {
$required = explode(",", $custom_request_required);
}
for ($n = 0; $n < count($custom); $n++) {
if (isset($required) && in_array($custom[$n], $required) && getval("custom" . $n, "") == "") {
return false;
# Required field was not set.
}
$message .= i18n_get_translated($custom[$n]) . ": " . getval("custom" . $n, "") . "\n\n";
}
}
# Create the request
sql_query("insert into request(user,collection,created,request_mode,status,comments) values ('{$userref}','{$ref}',now(),1,0,'" . escape_check($message) . "')");
$request = sql_insert_id();
$templatevars["request_id"] = $request;
$templatevars["requesturl"] = $baseurl . "/?q=" . $request;
$templatevars["requestreason"] = $message;
hook("afterrequestcreate", "", array($request));
# Check if alternative request email notification address is set, only valid if collection contains resources of the same type
$admin_notify_email = $email_notify;
if (isset($resource_type_request_emails)) {
$requestrestypes = array_unique(sql_array("select r.resource_type as value from collection_resource cr left join resource r on cr.resource=r.ref where cr.collection='{$ref}'"));
if (count($requestrestypes) == 1 && isset($resource_type_request_emails[$requestrestypes[0]])) {
$admin_notify_email = $resource_type_request_emails[$requestrestypes[0]];
}
}
# Send the e-mail
$userconfirmmessage = $lang["requestsenttext"] . "<br /><br />{$message}<br /><br />" . $lang["clicktoviewresource"] . "<br />{$baseurl}/?c={$ref}";
$message = $lang["user_made_request"] . "<br /><br />" . $lang["username"] . ": " . $username . "<br />{$message}<br /><br />";
$message .= $lang["clicktoviewresource"] . "<br />{$baseurl}/?q={$request}";
send_mail($admin_notify_email, $applicationname . ": " . $lang["requestcollection"] . " - {$ref}", $message, $useremail, $useremail, $admin_mail_template, $templatevars);
if ($request_senduserupdates) {
send_mail($useremail, $applicationname . ": " . $lang["requestsent"] . " - {$ref}", $userconfirmmessage, $email_from, $email_notify, $user_mail_template, $templatevars);
}
# Increment the request counter
sql_query("update resource set request_count=request_count+1 where ref='{$ref}'");
return true;
//.........这里部分代码省略.........
示例13: get_image_main
<?php
get_image_main('220x', true, true, '660x', 'divImgLeft');
?>
<?php
get_description();
?>
<div class="clear"></div>
</div>
<div class="clear"></div>
<!-- Overview -->
<div class="divContentOverview">
<?php
get_collection();
?>
<div class="clear"></div>
</div>
<!-- Content Sidebar -->
<div class="divContentSidebar">
<!-- Contact -->
<?php
get_contacts();
?>
<!-- Sidebar Blocks -->
<?php
get_sidebar_blocks();
?>
示例14: parse_str
if ($api_resource['signed']) {
// test signature? get query string minus leading ? and skey parameter
$test_query = "";
parse_str($_SERVER["QUERY_STRING"], $parsed);
foreach ($parsed as $parsed_parameter => $value) {
if ($parsed_parameter != "skey") {
$test_query .= $parsed_parameter . '=' . $value . "&";
}
}
$test_query = rtrim($test_query, "&");
// get hashkey that should have been used to create a signature.
$hashkey = md5($api_scramble_key . getval("key", ""));
// generate the signature required to match against given skey to continue
$keytotest = md5($hashkey . $test_query);
if ($keytotest != getval('skey', '')) {
header("HTTP/1.0 403 Forbidden.");
echo "HTTP/1.0 403 Forbidden. Invalid Signature";
exit;
}
}
if ($collection == 'all') {
// get all collections
$all_collections = sql_query("select c.*, c.theme2, c.theme3, c.keywords, u.fullname, u.username, c.home_page_publish, c.home_page_text, c.home_page_image,c.session_id from collection c left outer join user u on u.ref = c.user where 1");
print json_encode($all_collections);
} elseif ($collection != '') {
// get specific collection
print json_encode(get_collection($collection));
} else {
//
die('invalid request');
}
示例15: get_top_collections
} else {
?>
<div class="login" id="loginDiv">
<form method="post" action=".">
<input type="hidden" name="action" value="login">
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Password" required>
<input type="submit" value="Login">
</form>
<a href=".?action=signupform">Signup</a>
</div>
<?php
}
?>
<h3>Top 10 Collections</h3>
<ul class="top10list">
<?php
$collections_10 = get_top_collections();
//var_dump($collections_10);
foreach ($collections_10 as $collection_data) {
$collection_data = get_collection($collection_data['collection_id']);
$collection_owner = get_owner($collection_data['collection_id']);
echo '<li><a href=".?action=collection&collectionid=' . $collection_data['collection_id'] . '">' . $collection_data['collection_name'] . ' by ' . $collection_owner['user_name'] . '</a></li> ';
}
?>
</ul>
<a href="?action=collectionsearch">Search Collections</a>
</div>