本文整理汇总了PHP中get_nopreview_icon函数的典型用法代码示例。如果您正苦于以下问题:PHP get_nopreview_icon函数的具体用法?PHP get_nopreview_icon怎么用?PHP get_nopreview_icon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_nopreview_icon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HookResourceconnectViewResourceactions_anonymous
function HookResourceconnectViewResourceactions_anonymous()
{
if (getval("resourceconnect_source", "") == "") {
return false;
}
# Not a ResourceConnect result set.
global $lang, $title_field, $ref, $baseurl, $search, $offset, $scramble_key, $language, $resource;
# Generate access key
$access_key = md5("resourceconnect" . $scramble_key);
# Formulate resource link (for collections bar)
$view_url = $baseurl . "/pages/view.php?ref=" . $ref . "&k=" . substr(md5($access_key . $ref), 0, 10) . "&language_set=" . urlencode($language) . "&resourceconnect_source=" . urlencode($baseurl);
# Add to collections link.
$url = getval("resourceconnect_source", "") . "/plugins/resourceconnect/pages/add_collection.php?nc=" . time();
$url .= "&title=" . urlencode(get_data_by_field($ref, $title_field));
$url .= "&url=" . urlencode($view_url);
# Add back URL
$url .= "&back=" . urlencode($baseurl . "/pages/view.php?" . $_SERVER["QUERY_STRING"]);
# Add images
if ($resource["has_image"] == 1) {
$url .= "&thumb=" . urlencode(get_resource_path($ref, false, "col", false, "jpg"));
} else {
$url .= "&thumb=" . urlencode($baseurl . "/gfx/" . get_nopreview_icon($resource["resource_type"], $resource["file_extension"], true));
}
?>
<li><a target="collections" href="<?php
echo $url;
?>
">> <?php
echo $lang["action-addtocollection"];
?>
</a></li>
<?php
}
示例2: urlencode
<!--Resource Panel-->
<div class="CollectionPanelShell" id="ResourceShell<?php echo urlencode($ref) ?>">
<?php if (!hook("rendercollectionthumb")){?>
<?php $access=get_resource_access($result[$n]);
$use_watermark=check_use_watermark();?>
<table border="0" class="CollectionResourceAlign"><tr><td>
<a style="position:relative;" onclick="return <?php echo ($resource_view_modal?"Modal":"CentralSpace") ?>Load(this,true);" href="<?php echo $baseurl_short?>pages/view.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode("!collection" . $usercollection)?>&k=<?php echo $k?>&curpos=<?php echo $n ?>"><?php if ($result[$n]["has_image"]==1) {
$colimgpath=get_resource_path($ref,false,"col",false,$result[$n]["preview_extension"],-1,1,$use_watermark,$result[$n]["file_modified"])
?>
<img border=0 src="<?php echo $colimgpath?>" class="CollectImageBorder" <?php if (!$infobox) { ?>title="<?php echo htmlspecialchars(i18n_get_translated($result[$n]["field".$view_title_field]))?>" alt="<?php echo htmlspecialchars(i18n_get_translated($result[$n]["field".$view_title_field]))?>"<?php } ?>
<?php if ($infobox) { ?>onMouseOver="InfoBoxSetResource(<?php echo $ref?>);" onMouseOut="InfoBoxSetResource(0);"<?php } ?>
/>
<?php
} else { ?><img border=0 src="<?php echo $baseurl_short?>gfx/<?php echo get_nopreview_icon($result[$n]["resource_type"],$result[$n]["file_extension"],true) ?>"
<?php if ($infobox) { ?>onMouseOver="InfoBoxSetResource(<?php echo $ref?>);" onMouseOut="InfoBoxSetResource(0);"<?php } ?>
/><?php } ?><?php hook("aftersearchimg","",array($result[$n]))?></a></td>
</tr></table>
<?php } /* end hook rendercollectionthumb */?>
<?php
$title=$result[$n]["field".$view_title_field];
$title_field=$view_title_field;
if (isset($metadata_template_title_field) && isset($metadata_template_resource_type))
{
if ($result[$n]['resource_type']==$metadata_template_resource_type)
{
$title=$result[$n]["field".$metadata_template_title_field];
$title_field=$metadata_template_title_field;
示例3: if
<?php if (!$is_template && !checkperm("F*")) { ?>
<div class="Question" id="question_file">
<label><?php echo $lang["file"]?></label>
<div class="Fixed">
<?php
if ($resource["has_image"]==1)
{
?><img align="top" src="<?php echo get_resource_path($ref,false,($edit_large_preview?"pre":"thm"),false,$resource["preview_extension"],-1,1,checkperm("w"))?>" class="ImageBorder" style="margin-right:10px;"/><br />
<?php
}
else
{
# Show the no-preview icon
?>
<img src="../gfx/<?php echo get_nopreview_icon($resource["resource_type"],$resource["file_extension"],true)?>" />
<br />
<?php
}
if ($resource["file_extension"]!="") { ?><strong><?php echo str_replace_formatted_placeholder("%extension", $resource["file_extension"], $lang["cell-fileoftype"]) . " (" . formatfilesize(@filesize_unlimited(get_resource_path($ref,true,"",false,$resource["file_extension"]))) . ")" ?></strong><br /><?php } ?>
<?php if ($resource["has_image"]!=1) { ?>
<a href="<?php echo $baseurl_short?>pages/upload.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>&upload_a_file=true" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["uploadafile"]?></a>
<?php } else { ?>
<a href="<?php echo $baseurl_short?>pages/upload_<?php echo $top_nav_upload_type ?>.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>&replace_resource=<?php echo urlencode($ref) ?>&resource_type=<?php echo $resource['resource_type']?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["replacefile"]?></a>
<?php hook("afterreplacefile"); ?>
<?php } ?>
<?php if (! $disable_upload_preview) { ?><br />
<a href="<?php echo $baseurl_short?>pages/upload_preview.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["uploadpreview"]?></a><?php } ?>
<?php if (! $disable_alternative_files) { ?><br />
<a href="<?php echo $baseurl_short?>pages/alternative_files.php?ref=<?php echo urlencode($ref) ?>&search=<?php echo urlencode($search)?>&offset=<?php echo urlencode($offset) ?>&order_by=<?php echo urlencode($order_by) ?>&sort=<?php echo urlencode($sort) ?>&archive=<?php echo urlencode($archive) ?>" onClick="return CentralSpaceLoad(this,true);">> <?php echo $lang["managealternativefiles"]?></a><?php } ?>
示例4: get_resource_path
$original_link = get_resource_path($file[0]['ref'], FALSE, '', FALSE, $file[0]['file_extension'], -1, 1, FALSE, '', -1);
printJson($original_link);
}
// get link to specific file thumbnail by file ID
// $get_file_thumbnail_link must be the ID of the file
if (!empty($get_file_thumbnail_link)) {
$resource = $get_file_thumbnail_link;
$file = sql_query("SELECT * FROM resource WHERE ref='{$resource}'");
$preview_extension = $file[0]['file_extension'];
if ($preview_extension == 'pdf') {
$preview_extension = $file[0]['preview_extension'];
}
$thumbnail_link = get_resource_path($resource, FALSE, 'col', FALSE, $preview_extension, -1, 1, FALSE);
$file_headers = get_headers($thumbnail_link);
$resourcedata = get_resource_data($resource);
$no_preview_icon = "gfx/" . get_nopreview_icon($resourcedata["resource_type"], $resourcedata["file_extension"], false);
$data = array('thumbnail_link' => $thumbnail_link, 'no_preview_icon' => $no_preview_icon, 'file_header' => $file_headers[0]);
printJson($data);
}
// get all collections
if ($get && $get_all_collections) {
$all_collections = get_user_collections($user_id);
printJson($all_collections);
}
// get all files within a specific collection
if ($get_files_in_collection && $collection_id) {
$fetchFiles = "SELECT * \n FROM resource \n WHERE \n ref IN (SELECT resource FROM collection_resource WHERE collection='{$collection_id}')";
$fetchCollection = "SELECT ref, name FROM collection WHERE ref='{$collection_id}'";
$fileData = sql_query($fetchFiles);
$collectionData = sql_query($fetchCollection);
foreach ($fileData as $k => $file) {
示例5: get_resource_access
# additional access check, as the resource download may be allowed, but access restriction should force watermark.
$access = get_resource_access($ref);
$use_watermark = check_use_watermark($ref);
# If no extension was provided, we fallback to JPG.
if ($ext == "") {
$ext = "jpg";
}
$noattach = getval("noattach", "");
$path = get_resource_path($ref, true, $size, false, $ext, -1, $page, $use_watermark && $alternative == -1, "", $alternative);
if (!file_exists($path)) {
$path = get_resource_path($ref, true, "", false, $ext, -1, $page, false, "", $alternative);
}
if (!file_exists($path) && $noattach != "") {
# Return icon for file (for previews)
$info = get_resource_data($ref);
$path = "../gfx/" . get_nopreview_icon($info["resource_type"], $ext, "thm");
}
# writing RS metadata to files: exiftool
if ($noattach == "" && $alternative == -1) {
$tmpfile = write_metadata($path, $ref);
if ($tmpfile !== false && file_exists($tmpfile)) {
$path = $tmpfile;
}
}
hook('modifydownloadfile');
$filesize = filesize_unlimited($path);
header("Content-Length: " . $filesize);
# Log this activity (download only, not preview)
if ($noattach == "") {
daily_stat("Resource download", $ref);
resource_log($ref, 'd', 0, $usagecomment, "", "", $usage, $size);
示例6: get_resource_access
$currenty = $pdf->GetY();
if ($ref !== false) {
# Find image
# Load access level
$access = get_resource_access($result[$n]);
// feed get_resource_access the resource array rather than the ref, since access is included.
$use_watermark = check_use_watermark();
$imgpath = get_resource_path($ref, true, $imgsize, false, $preview_extension, -1, 1, $use_watermark);
if (!file_exists($imgpath) && $preview_extension == "jpg" && $imgsize == 'hpr') {
$imgpath = get_resource_path($ref, true, '', false, $preview_extension, -1, 1, $use_watermark);
}
if (!file_exists($imgpath) && $imgsize != 'pre') {
$imgpath = get_resource_path($ref, true, 'pre', false, $preview_extension, -1, 1, $use_watermark);
}
if (!file_exists($imgpath)) {
$imgpath = "../../gfx/" . get_nopreview_icon($result[$n]['resource_type'], $result[$n]['file_extension'], false, true);
$preview_extension = explode(".", $imgpath);
if (count($preview_extension) > 1) {
$preview_extension = trim(strtolower($preview_extension[count($preview_extension) - 1]));
}
}
if (file_exists($imgpath)) {
# cells are used for measurement purposes only
# Two ways to size image, either by height or by width.
$thumbsize = getimagesize($imgpath);
if ($thumbsize[0] > $thumbsize[1]) {
################# landscape image
$imagewidth = $imagesize;
$imageheight = 0;
if ($sheetstyle == "thumbnails") {
$topy = $pdf->GetY();
示例7: htmlspecialchars
<?php
if ($infobox)
{ ?>
onmouseover="InfoBoxSetResource(<?php echo htmlspecialchars($ref)?>);"
onmouseout="InfoBoxSetResource(0); "
<?php
} ?>
alt="<?php echo str_replace(array("\"","'"),"",htmlspecialchars(i18n_get_translated($result[$n]["field".$view_title_field]))); ?>"
/>
<?php
}
else
{ ?>
<img
border=0
src="<?php echo $baseurl_short?>gfx/<?php echo get_nopreview_icon($result[$n]["resource_type"],$result[$n]["file_extension"],false) ?>"
<?php
if ($infobox)
{ ?>
onmouseover="InfoBoxSetResource(<?php echo htmlspecialchars($ref)?>);"
onmouseout="InfoBoxSetResource(0);"
<?php
} ?>
/>
<?php
}
hook("aftersearchimg","",array($result[$n]));
?>
</a>
<?php
} ?>
示例8: get_resource_path
?>
">
<?php
$images = 0;
for ($m = 0; $m < count($resources) && $images <= 4; $m++) {
$border = true;
$ref = $resources[$m]['ref'];
$previewpath = get_resource_path($ref, true, "col", false, "jpg", -1, 1, false);
if (file_exists($previewpath)) {
$previewpath = get_resource_path($ref, false, "col", false, "jpg", -1, 1, false, $resources[$m]["file_modified"]);
} else {
$previewpath = "../gfx/" . get_nopreview_icon($resources[$m]["resource_type"], $resources[$m]["file_extension"], "col");
$border = false;
}
$images++;
$space = 3 + ($images - 1) * 9;
if (list($sw, $sh) = @getimagesize($previewpath)) {
?>
<img width="<?php
echo floor($sw / 2);
?>
" height="<?php
echo floor($sh / 2);
?>
" style="position: absolute; top:<?php
echo $space;
?>
示例9: do_report
function do_report($ref, $from_y, $from_m, $from_d, $to_y, $to_m, $to_d, $download = true, $add_border = false)
{
# Run report with id $ref for the date range specified. Returns a result array.
global $lang, $baseurl;
$report = sql_query("select * from report where ref='{$ref}'");
$report = $report[0];
# Translates the report name.
$report["name"] = lang_or_i18n_get_translated($report["name"], "report-");
if ($download) {
$filename = str_replace(array(" ", "(", ")", "-", "/"), "_", $report["name"]) . "_" . $from_y . "_" . $from_m . "_" . $from_d . "_" . $lang["to"] . "_" . $to_y . "_" . $to_m . "_" . $to_d . ".csv";
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=" . $filename . "");
}
if ($results = hook("customreport", "", array($ref, $from_y, $from_m, $from_d, $to_y, $to_m, $to_d, $download, $add_border))) {
} else {
$sql = $report["query"];
$sql = str_replace("[from-y]", $from_y, $sql);
$sql = str_replace("[from-m]", $from_m, $sql);
$sql = str_replace("[from-d]", $from_d, $sql);
$sql = str_replace("[to-y]", $to_y, $sql);
$sql = str_replace("[to-m]", $to_m, $sql);
$sql = str_replace("[to-d]", $to_d, $sql);
global $view_title_field;
#back compatibility for three default reports, to replace "title" with the view_title_field.
#all reports should either use r.title or view_title_field when referencing the title column on the resource table.
if ($ref == 7 || $ref == 8 || $ref == 9) {
$sql = str_replace(",title", ",field" . $view_title_field, $sql);
}
$sql = str_replace("view_title_field", "field" . $view_title_field, $sql);
$sql = str_replace("r.title", "field" . $view_title_field, $sql);
$results = sql_query($sql);
#echo "\"Number of results: " . count($results) . "\"\n";
}
if ($download) {
for ($n = 0; $n < count($results); $n++) {
$result = $results[$n];
if ($n == 0) {
$f = 0;
foreach ($result as $key => $value) {
$f++;
if ($f > 1) {
echo ",";
}
if ($key != "thumbnail") {
echo "\"" . lang_or_i18n_get_translated($key, "columnheader-") . "\"";
}
}
echo "\n";
}
$f = 0;
foreach ($result as $key => $value) {
$f++;
if ($f > 1) {
echo ",";
}
if ($key != "thumbnail") {
$value = lang_or_i18n_get_translated($value, "usergroup-");
$value = str_replace('"', '""', $value);
# escape double quotes
if (substr($value, 0, 1) == ",") {
$value = substr($value, 1);
}
# Remove comma prefix on dropdown / checkbox values
echo "\"" . $value . "\"";
}
}
echo "\n";
}
} else {
# Not downloading - output a table
$border = "";
if ($add_border) {
$border = "border=\"1\"";
}
$output = "<br /><style>.InfoTable td {padding:5px;}</style><table {$border} class=\"InfoTable\">";
for ($n = 0; $n < count($results); $n++) {
$result = $results[$n];
if ($n == 0) {
$f = 0;
$output .= "<tr>\r\n";
foreach ($result as $key => $value) {
$f++;
if ($key == "thumbnail") {
$output .= "<td><strong>Link</strong></td>\r\n";
} else {
$output .= "<td><strong>" . lang_or_i18n_get_translated($key, "columnheader-") . "</strong></td>\r\n";
}
}
$output .= "</tr>\r\n";
}
$f = 0;
$output .= "<tr>\r\n";
foreach ($result as $key => $value) {
$f++;
if ($key == "thumbnail") {
$thm_path = get_resource_path($value, true, "thm", false, "", $scramble = -1, $page = 1, false);
if (!file_exists($thm_path)) {
$resourcedata = get_resource_data($value);
$thm_url = $baseurl . "/gfx/" . get_nopreview_icon($resourcedata["resource_type"], $resourcedata["file_extension"], true);
} else {
//.........这里部分代码省略.........
示例10: tile_search_multi
function tile_search_multi($tile, $tile_id, $tile_width, $tile_height)
{
global $baseurl_short, $lang, $dash_tile_shadows;
$tile_type = "srch";
$tile_style = "multi";
$search_string = explode('?', $tile["link"]);
parse_str(str_replace("&", "&", $search_string[1]), $search_string);
$count = $tile["resource_count"] ? "-1" : "4";
$search = isset($search_string["search"]) ? $search_string["search"] : "";
$restypes = isset($search_string["restypes"]) ? $search_string["restypes"] : "";
$order_by = isset($search_string["order_by"]) ? $search_string["order_by"] : "";
$archive = isset($search_string["archive"]) ? $search_string["archive"] : "";
$sort = isset($search_string["sort"]) ? $search_string["sort"] : "";
$resources = do_search($search, $restypes, $order_by, $archive, $count, $sort, false, 0, false, false, "", false, false);
$img_size = "pre";
for ($i = 0; $i < count($resources) && $i < 4; $i++) {
$shadow = true;
$ref = $resources[$i]['ref'];
$previewpath = get_resource_path($ref, true, $img_size, false, "jpg", -1, 1, false);
if (file_exists($previewpath)) {
$previewpath = get_resource_path($ref, false, $img_size, false, "jpg", -1, 1, false, $resources[$i]["file_modified"]);
} else {
$previewpath = $baseurl_short . "gfx/" . get_nopreview_icon($resources[$i]["resource_type"], $resources[$i]["file_extension"], "");
$border = false;
$shadow = false;
}
$modifiedurl = hook('searchpublicmodifyurl');
if ($modifiedurl) {
$previewpath = $modifiedurl;
$border = true;
}
#$space=$margin+($images-1)*$gap;
$gap = 140 / min(count($resources), 4);
$space = $i * $gap;
?>
<img style="position: absolute; top:10px;left:<?php
echo $space * 1.5;
?>
px;height:100%;<?php
if ($shadow) {
?>
box-shadow: 0 0 25px #000;<?php
}
?>
;transform: rotate(<?php
echo 20 - $i * 12;
?>
deg);" src="<?php
echo $previewpath;
?>
">
<?php
}
$icon = "";
if (substr($search_string["search"], 0, 11) == "!collection") {
$icon = "collection";
} else {
if (substr($search_string["search"], 0, 7) == "!recent" || substr($search_string["search"], 0, 5) == "!last") {
$icon = "clock";
} else {
$icon = "search";
}
}
echo "<span class='" . $icon . "-icon'></span>";
if (!empty($tile["title"])) {
?>
<h2 class="title thmbs_tile">
<?php
echo htmlspecialchars($tile["title"]);
?>
</h2>
<?php
} else {
if (!empty($tile["txt"])) {
?>
<h2 class="title notitle thmbs_tile">
<?php
echo htmlspecialchars($tile["txt"]);
?>
</h2>
<?php
}
}
if (!empty($tile["title"]) && !empty($tile["txt"])) {
?>
<p>
<?php
echo htmlspecialchars($tile["txt"]);
?>
</p>
<?php
}
if ($tile["resource_count"]) {
?>
<p class="tile_corner_box">
<span class="count-icon"></span>
<?php
echo count($resources);
?>
</p>
//.........这里部分代码省略.........
示例11: echo
</p>
<p><?php
echo $lang["drag_and_drop_to_rearrange"];
?>
</p>
<div id="splice_scroll">
<div id="splice_reel" style="width:<?php
echo (count($videos) + 1) * 80;
?>
px">
<?php
foreach ($videos as $video) {
if ($video["has_image"]) {
$img = get_resource_path($video["ref"], false, "col", false, $video["preview_extension"], -1, 1, false, $video["file_modified"]);
} else {
$img = "../../../gfx/" . get_nopreview_icon($video["resource_type"], $video["file_extension"], true);
}
?>
<img src="<?php
echo $img;
?>
" id="splice_<?php
echo $video["ref"];
?>
" class="splice_item"><?php
}
?>
</div></div>
<script type="text/javascript">
function ReorderResourcesInCollectionSplice(idsInOrder){
示例12: email_resource_request
function email_resource_request($ref, $details)
{
# E-mails a basic resource request for a single resource (posted) to the team
# (not a managed request)
global $applicationname, $email_from, $baseurl, $email_notify, $username, $useremail, $userref, $lang, $request_senduserupdates, $watermark, $filename_field, $view_title_field, $access, $resource_type_request_emails;
$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);
}
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];
}
$templatevars['username'] = $username . " (" . $useremail . ")";
$templatevars['formemail'] = getval("email", "");
$templatevars['url'] = $baseurl . "/?r=" . $ref;
$templatevars["requesturl"] = $templatevars['url'];
$userdata = get_user($userref);
$templatevars["fullname"] = $userdata["fullname"];
$htmlbreak = "";
global $use_phpmailer;
if ($use_phpmailer) {
$htmlbreak = "<br><br>";
}
$list = "";
reset($_POST);
foreach ($_POST as $key => $value) {
if (strpos($key, "_label") !== false) {
# Add custom field
$data = "";
$data = $_POST[str_replace("_label", "", $key)];
$list .= $htmlbreak . $value . ": " . $data . "\n";
}
}
$list .= $htmlbreak;
$templatevars['list'] = $list;
$templatevars['details'] = stripslashes($details);
if ($templatevars['details'] != "") {
$adddetails = $lang["requestreason"] . ": " . newlines($templatevars['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.
}
$c .= i18n_get_translated($custom[$n]) . ": " . getval("custom" . $n, "") . "\n\n";
}
}
$templatevars["requestreason"] = $lang["requestreason"] . ": " . $templatevars['details'] . $c . "";
$message = $lang["user_made_request"] . "<br /><br />";
$message .= isset($username) ? $lang["username"] . ": " . $username . " (" . $useremail . ")<br />" : "";
$message .= !empty($templatevars["formemail"]) ? $lang["email"] . ":" . $templatevars["formemail"] . "<br />" : "";
$message .= $adddetails . $c . "<br /><br />" . $lang["clicktoviewresource"] . "<br />" . $templatevars['url'];
# Check if alternative request email notification address is set
$admin_notify_email = $email_notify;
if (isset($resource_type_request_emails)) {
if (isset($resource_type_request_emails[$resourcedata["resource_type"]])) {
$admin_notify_email = $resource_type_request_emails[$resourcedata["resource_type"]];
}
}
send_mail($admin_notify_email, $applicationname . ": " . $lang["requestresource"] . " - {$ref}", $message, $useremail, $useremail, "emailresourcerequest", $templatevars);
if ($request_senduserupdates) {
$sender = !empty($useremail) ? $useremail : !empty($templatevars["formemail"]) ? $templatevars["formemail"] : "";
$k = getval("k", "") != "" ? "&k=" . getval("k", "") : "";
$userconfirmmessage = $lang["requestsenttext"] . "<br /><br />" . $lang["requestreason"] . ": " . $templatevars['details'] . $c . "<br /><br />" . $lang["clicktoviewresource"] . "\n{$baseurl}/?r={$ref}" . $k;
if ($sender != "") {
send_mail($sender, $applicationname . ": " . $lang["requestsent"] . " - {$ref}", $userconfirmmessage, $email_from, $email_notify, "emailuserresourcerequest", $templatevars);
}
}
# Increment the request counter
sql_query("update resource set request_count=request_count+1 where ref='{$ref}'");
}
示例13: HookAnnotateViewRenderinnerresourcepreview
//.........这里部分代码省略.........
&search=<?php
echo urlencode($search);
?>
&offset=<?php
echo $offset;
?>
&order_by=<?php
echo $order_by;
?>
&sort=<?php
echo $sort;
?>
&archive=<?php
echo $archive;
?>
" onClick="return CentralSpaceLoad(this);">> <?php
echo $lang["pdfwithnotes"];
?>
</a>
<?php
}
?>
</div>
</div>
<script language="javascript">
jQuery("#toAnnotate").load(function(){
jQuery("#toAnnotate").annotateImage({
getUrl: "<?php
echo $baseurl;
?>
/plugins/annotate/pages/get.php?ref=<?php
echo $ref;
?>
&k=<?php
echo $k;
?>
&pw=<?php
echo $w;
?>
&ph=<?php
echo $h;
?>
",
saveUrl: "<?php
echo $baseurl;
?>
/plugins/annotate/pages/save.php?ref=<?php
echo $ref;
?>
&k=<?php
echo $k;
?>
&pw=<?php
echo $w;
?>
&ph=<?php
echo $h;
?>
",
deleteUrl: "<?php
echo $baseurl;
?>
/plugins/annotate/pages/delete.php?ref=<?php
echo $ref;
?>
&k=<?php
echo $k;
?>
",
useAjax: true,
<?php
if ($k == "") {
?>
editable: true <?php
} else {
?>
editable: false <?php
}
?>
});
});
</script>
<?php
}
} else {
?>
<img src="<?php
echo $baseurl;
?>
/gfx/<?php
echo get_nopreview_icon($resource["resource_type"], $resource["file_extension"], false);
?>
" alt="" class="Picture" style="border:none;" id="previewimage" />
<?php
}
return true;
}
示例14: get_resource_path
{
$wmpath=get_resource_path($ref,true,($edit_large_preview?"pre":"thm"),false,$resource["preview_extension"],-1,1,true);
if (file_exists($wmpath))
{ ?>
<img style="display:none;" id="wmpreview" align="top" src="<?php echo get_resource_path($ref,false,($edit_large_preview?"pre":"thm"),false,$resource["preview_extension"],-1,1,true)?>" class="ImageBorder"/>
<?php
}
} ?>
<br />
<?php
}
else
{
# Show the no-preview icon
?>
<img src="<?php echo $baseurl_short ?>gfx/<?php echo get_nopreview_icon($resource["resource_type"],$resource["file_extension"],true)?>" />
<br />
<?php
}
if ($resource["file_extension"]!="")
{ ?>
<strong>
<?php
echo str_replace_formatted_placeholder("%extension", $resource["file_extension"], $lang["cell-fileoftype"]) . " (" . formatfilesize(@filesize_unlimited(get_resource_path($ref,true,"",false,$resource["file_extension"]))) . ")";
?>
</strong>
<?php
if (checkperm("w") && $resource["has_image"]==1 && file_exists($wmpath))
{ ?>
<a href="#" onclick="jQuery('#wmpreview').toggle();jQuery('#preview').toggle();if (jQuery(this).text()=='<?php echo $lang['showwatermark']?>'){jQuery(this).text('<?php echo $lang['hidewatermark']?>');} else {jQuery(this).text('<?php echo $lang['showwatermark']?>');}"><?php echo $lang['showwatermark']?></a>
示例15: email_resource
function email_resource($resource, $resourcename, $fromusername, $userlist, $message, $access = -1, $expires = "", $useremail = "", $from_name = "", $cc = "", $list_recipients = false, $open_internal_access = false, $useraccess = 2, $group = "")
{
# Attempt to resolve all users in the string $userlist to user references.
global $baseurl, $email_from, $applicationname, $lang, $userref, $usergroup, $attach_user_smart_groups;
if ($useremail == "") {
$useremail = $email_from;
}
if ($group == "") {
$group = $usergroup;
}
# remove any line breaks that may have been entered
$userlist = str_replace("\\r\\n", ",", $userlist);
if (trim($userlist) == "") {
return $lang["mustspecifyoneusername"];
}
$userlist = resolve_userlist_groups($userlist);
if ($attach_user_smart_groups && strpos($userlist, $lang["groupsmart"] . ": ") !== false) {
$userlist_with_groups = $userlist;
$groups_users = resolve_userlist_groups_smart($userlist, true);
if ($groups_users != '') {
if ($userlist != "") {
$userlist = remove_groups_smart_from_userlist($userlist);
if ($userlist != "") {
$userlist .= ",";
}
}
$userlist .= $groups_users;
}
}
$ulist = trim_array(explode(",", $userlist));
$ulist = array_filter($ulist);
$ulist = array_values($ulist);
$emails = array();
$key_required = array();
$emails_keys = resolve_user_emails($ulist);
$unames = $emails_keys['unames'];
$emails = $emails_keys['emails'];
$key_required = $emails_keys['key_required'];
# Send an e-mail to each resolved user / e-mail address
$subject = "{$applicationname}: {$resourcename}";
if ($fromusername == "") {
$fromusername = $applicationname;
}
// fromusername is used for describing the sender's name inside the email
if ($from_name == "") {
$from_name = $applicationname;
}
// from_name is for the email headers, and needs to match the email address (app name or user name)
$message = str_replace(array("\\n", "\\r", "\\"), array("\n", "\r", ""), $message);
# Commented 'no message' line out as formatted oddly, and unnecessary.
# if ($message==""){$message=$lang['nomessage'];}
$resolve_open_access = false;
for ($n = 0; $n < count($emails); $n++) {
$key = "";
# Do we need to add an external access key for this user (e-mail specified rather than username)?
if ($key_required[$n]) {
$k = generate_resource_access_key($resource, $userref, $access, $expires, $emails[$n], $group);
$key = "&k=" . $k;
} elseif ($useraccess == 0 && $open_internal_access && !$resolve_open_access) {
debug("smart_groups: going to resolve open access");
# get this all done at once
resolve_open_access(isset($userlist_with_groups) ? $userlist_with_groups : $userlist, $resource, $expires);
$resolve_open_access = true;
}
# make vars available to template
global $watermark;
$templatevars['thumbnail'] = get_resource_path($resource, true, "thm", false, "jpg", $scramble = -1, $page = 1, $watermark ? $access == 1 ? true : false : false);
if (!file_exists($templatevars['thumbnail'])) {
$resourcedata = get_resource_data($resource);
$templatevars['thumbnail'] = "../gfx/" . get_nopreview_icon($resourcedata["resource_type"], $resourcedata["file_extension"], false);
}
$templatevars['url'] = $baseurl . "/?r=" . $resource . $key;
$templatevars['fromusername'] = $fromusername;
$templatevars['message'] = $message;
$templatevars['resourcename'] = $resourcename;
$templatevars['from_name'] = $from_name;
if (isset($k)) {
if ($expires == "") {
$templatevars['expires_date'] = $lang["email_link_expires_never"];
$templatevars['expires_days'] = $lang["email_link_expires_never"];
} else {
$day_count = round((strtotime($expires) - strtotime('now')) / (60 * 60 * 24));
$templatevars['expires_date'] = $lang['email_link_expires_date'] . nicedate($expires);
$templatevars['expires_days'] = $lang['email_link_expires_days'] . $day_count;
if ($day_count > 1) {
$templatevars['expires_days'] .= " " . $lang['expire_days'] . ".";
} else {
$templatevars['expires_days'] .= " " . $lang['expire_day'] . ".";
}
}
} else {
# Set empty expiration tempaltevars
$templatevars['expires_date'] = '';
$templatevars['expires_days'] = '';
}
# Build message and send.
if (count($emails > 1) && $list_recipients === true) {
$body = $lang["list-recipients"] . "\n" . implode("\n", $emails) . "\n\n";
$templatevars['list-recipients'] = $lang["list-recipients"] . "\n" . implode("\n", $emails) . "\n\n";
} else {
//.........这里部分代码省略.........