• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_data_by_field函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_data_by_field函数的典型用法代码示例。如果您正苦于以下问题:PHP get_data_by_field函数的具体用法?PHP get_data_by_field怎么用?PHP get_data_by_field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_data_by_field函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: Hookyt2rsUpload_pluploadupload_page_bottom

function Hookyt2rsUpload_pluploadupload_page_bottom()
{
    global $userref, $yt2rs_field_id, $lang;
    $ref_user = 0 - $userref;
    $youtube_copy_path = get_data_by_field($ref_user, $yt2rs_field_id);
    if ($youtube_copy_path == "") {
        return false;
    } else {
        if (preg_match("/youtu.be\\/[a-z1-9.-_]+/", $youtube_copy_path)) {
            preg_match("/youtu.be\\/([a-z1-9.-_]+)/", $youtube_copy_path, $matches);
        } else {
            if (preg_match("/youtube.com(.+)v=([^&]+)/", $youtube_copy_path)) {
                preg_match("/v=([^&]+)/", $youtube_copy_path, $matches);
            }
        }
    }
    $ytthumb_id = $matches[1];
    $thumb_path = 'http://img.youtube.com/vi/' . $ytthumb_id . '/mqdefault.jpg';
    ?>
	<h1><?php 
    echo $lang['yt2rs_thumb'];
    ?>
</h1>
	

<?php 
    echo $thumb_path;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:28,代码来源:upload_plupload.php


示例2: showApproval

function showApproval($result)
{
    $approval = sql_value("SELECT approval_status AS value FROM resource WHERE ref = {$result['ref']}", FALSE);
    $approval_form_id = sql_value("SELECT ref AS value FROM resource_type_field WHERE name = 'approval_form'", FALSE);
    if (!$approval_form_id) {
        return;
    }
    $approval_form = TidyList(get_data_by_field($result['ref'], $approval_form_id));
    if (empty($approval) and strpos($approval_form, 'Yes') !== FALSE) {
        $approval = 'waiting';
    }
    if ($approval) {
        switch ($approval) {
            case 'waiting':
                $title = 'Awaiting Approval';
                break;
            case 'minor':
                $title = 'Minor Changes Needed';
                break;
            case 'major':
                $title = 'Major Changes Needed';
                break;
            case 'approved':
                $title = 'Approved';
                break;
        }
        echo '<span class="rps-approval rps-approval-' . $approval . '" title="' . $title . '"></span>';
    }
}
开发者ID:EMRL,项目名称:approval,代码行数:29,代码来源:search.php


示例3: 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;
    ?>
">&gt; <?php 
    echo $lang["action-addtocollection"];
    ?>
</a></li>
	<?php 
}
开发者ID:vongalpha,项目名称:resourcespace,代码行数:34,代码来源:view.php


示例4: HookLightbox_previewViewRenderbeforerecorddownload

function HookLightbox_previewViewRenderbeforerecorddownload()
{
    global $resource, $title_field;
    $url = getPreviewURL($resource);
    if ($url === false) {
        return;
    }
    $title = get_data_by_field($resource['ref'], $title_field);
    setLink('#previewimagelink', $url, $title);
    setLink('#previewlink', $url, $title, 'lightbox-other');
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:11,代码来源:view.php


示例5: HookApprovalViewRenderbeforeresourcedetails

function HookApprovalViewRenderbeforeresourcedetails()
{
    global $lang, $ref, $resource, $fields;
    $approval_form_id = sql_value("SELECT ref AS value FROM resource_type_field WHERE name = 'approval_form'", FALSE);
    if (!$approval_form_id) {
        return;
    }
    $approval_form = TidyList(get_data_by_field($ref, $approval_form_id));
    if ($approval_form !== 'Yes') {
        return;
    }
    $history = sql_query('SELECT id, ref, posted, comment, name, signature, status FROM approval WHERE ref = ' . (int) $ref . ' ORDER BY posted DESC');
    ob_start();
    $path = dirname(dirname(__FILE__));
    include $path . '/inc/approval.php';
    echo ob_get_clean();
}
开发者ID:EMRL,项目名称:approval,代码行数:17,代码来源:view.php


示例6: HookApprovalResource_emailFooterbottom

function HookApprovalResource_emailFooterbottom()
{
    global $ref;
    $approval_form_id = sql_value("SELECT ref AS value FROM resource_type_field WHERE name = 'approval_form'", FALSE);
    if (!$approval_form_id) {
        return;
    }
    $approval_form = TidyList(get_data_by_field($ref, $approval_form_id));
    if ($approval_form !== 'Yes') {
        return;
    }
    $settings = get_plugin_config('approval');
    echo '
		<script type="text/javascript">
			document.getElementById("message").value = "' . htmlspecialchars($settings['email_message']) . '";
		</script>
	';
}
开发者ID:EMRL,项目名称:approval,代码行数:18,代码来源:resource_email.php


示例7: getTargetFilename

/**
 * Returns the filename to be used for a specific file.
 * @param type $ref The resource for which the name should be built.
 * @param type $ext The new filename suffix to be used.
 * @param type $size A short name for the target file format, for example 'hpr'.
 */
function getTargetFilename($ref, $ext, $size)
{
    global $filename_field, $view_title_field;
    # Get filename - first try title, then original filename, and finally use the resource ID
    $filename = get_data_by_field($ref, $view_title_field);
    if (empty($filename)) {
        $filename = get_data_by_field($ref, $filename_field);
        if (!empty($filename)) {
            $originalSuffix = pathinfo($filename, PATHINFO_EXTENSION);
            $filename = mb_basename($filename, $originalSuffix);
        } else {
            $filename = strval($ref);
        }
    }
    # Remove potentially problematic characters, and make sure it's not too long
    $filename = preg_replace("/[*:<>?\\/|]/", '_', $filename);
    $filename = substr($filename, 0, 240);
    return $filename . (empty($size) ? '' : '-' . strtolower($size)) . '.' . strtolower($ext);
}
开发者ID:claytondaley,项目名称:resourcespace,代码行数:25,代码来源:utility.php


示例8: Hookyt2rsViewreplacedownloadoptions

function Hookyt2rsViewreplacedownloadoptions()
{
    // Replace download options
    global $ref, $yt2rs_field_id, $baseurl_short, $lang;
    $youtube_url = get_data_by_field($ref, $yt2rs_field_id);
    if ($youtube_url !== "" && isValidURL($youtube_url)) {
        ?>
			<table cellpadding="0" cellspacing="0">
				<tr >
					<td>File Information</td>
					<td>File Size </td>
					<td>Options</td>
				</tr>
				<tr class="DownloadDBlend">
					<td><h2>Online Preview</h2><p>Youtube Video</p></td>
					<td>N/A</td>
					<td class="DownloadButton HorizontalWhiteNav"><a href="<?php 
        echo $baseurl_short;
        ?>
pages/resource_request.php?ref=<?php 
        echo urlencode($ref);
        ?>
&k=<?php 
        echo getval("k", "");
        ?>
" onClick="return CentralSpaceLoad(this,true);">
				<?php 
        echo $lang["action-request"];
        ?>
</td>
				</tr>
			</table>
<?php 
        return true;
    } else {
        return false;
    }
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:38,代码来源:view.php


示例9: substr

	<div class="clearerleft"></div>
	<!--<h1><?php 
    echo $affiliatename;
    ?>
</h1>-->
	<?php 
    for ($n = $offset; $n < count($results) && $n < $offset + $pagesize; $n++) {
        $result = $results[$n];
        $ref = $result["ref"];
        $url = $baseurl . "/pages/view.php?ref=" . $ref . "&k=" . substr(md5($access_key . $ref), 0, 10) . "&language_set=" . urlencode($language) . "&search=" . urlencode($search) . "&offset=" . $offset . "&resourceconnect_source=" . urlencode(getval("resourceconnect_source", ""));
        # Wrap with local page that includes header/footer/sidebar
        $link_url = "../plugins/resourceconnect/pages/view.php?search=" . urlencode($search) . "&url=" . urlencode($url);
        $title = str_replace(array("\"", "'"), "", htmlspecialchars(i18n_get_translated($result["field" . $view_title_field])));
        # Add to collections link.
        $add_url = getval("resourceconnect_source", "") . "/plugins/resourceconnect/pages/add_collection.php?nc=" . time();
        $add_url .= "&title=" . urlencode(get_data_by_field($ref, $view_title_field));
        $add_url .= "&url=" . urlencode(str_replace("&search", "&source_search", $url));
        # Move the search so it doesn't get set, and therefore the nav is hidden when viewing the resource
        $add_url .= "&back=" . urlencode($baseurl . "/pages/view.php?" . $_SERVER["QUERY_STRING"]);
        # Add image
        if ($result["has_image"] == 1) {
            $add_url .= "&thumb=" . urlencode(get_resource_path($ref, false, "col", false, "jpg"));
            $add_url .= "&large_thumb=" . urlencode(get_resource_path($ref, false, "thm", false, "jpg"));
            $add_url .= "&xl_thumb=" . urlencode(get_resource_path($ref, false, "pre", false, "jpg"));
        } else {
            $add_url .= "&thumb=" . urlencode($baseurl . "/gfx/" . get_nopreview_icon($result["resource_type"], $result["file_extension"], true));
            $add_url .= "&large_thumb=" . urlencode($baseurl . "/gfx/" . get_nopreview_icon($result["resource_type"], $result["file_extension"], false));
            $add_url .= "&xl_thumb=" . urlencode($baseurl . "/gfx/" . get_nopreview_icon($result["resource_type"], $result["file_extension"], false));
        }
        ?>
		<div class="ResourcePanelShell">
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:remote_results.php


示例10: trim

        # Display resource ID
        ?>
	<p><?php 
        echo $lang["resourceid"];
        ?>
: <?php 
        echo $ref;
        ?>
</p>
	<?php 
    }
    # Display fields
    for ($n = 0; $n < count($infobox_fields); $n++) {
        $field = $infobox_fields[$n];
        if ((checkperm("f" . $field) || checkperm("f*")) && !checkperm("f-" . $field)) {
            $value = trim(get_data_by_field($ref, $field));
            $type = sql_value("select type value from resource_type_field where ref = {$field}", 0);
            if ($value != "") {
                if ($type != 8) {
                    $value = nl2br(htmlspecialchars(TidyList(i18n_get_translated($value))));
                }
                if ($type == 4) {
                    $value = nicedate($value);
                }
                ?>
			<p><?php 
                echo $value;
                ?>
</p>
			<?php 
            }
开发者ID:claytondaley,项目名称:resourcespace,代码行数:31,代码来源:infobox_loader.php


示例11: exit

    exit("Permission denied");
}
include "../include/resource_functions.php";
if (!$speedtagging) {
    exit("This function is not enabled.");
}
if (getval("save", "") != "") {
    $ref = getvalescaped("ref", "", true);
    $keywords = getvalescaped("keywords", "");
    # support resource_type based tag fields
    $resource_type = get_resource_data($ref);
    $resource_type = $resource_type['resource_type'];
    if (isset($speedtagging_by_type[$resource_type])) {
        $speedtaggingfield = $speedtagging_by_type[$resource_type];
    }
    $oldval = get_data_by_field($ref, $speedtaggingfield);
    update_field($ref, $speedtaggingfield, $keywords);
    # Write this edit to the log.
    resource_log($ref, 'e', $speedtaggingfield, "", $oldval, $keywords);
}
# append resource type restrictions based on 'T' permission
# look for all 'T' permissions and append to the SQL filter.
global $userpermissions;
$rtfilter = array();
$sql_join = "";
$sql_filter = "";
for ($n = 0; $n < count($userpermissions); $n++) {
    if (substr($userpermissions[$n], 0, 1) == "T") {
        $rt = substr($userpermissions[$n], 1);
        if (is_numeric($rt)) {
            $rtfilter[] = $rt;
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:tag.php


示例12: hookView_in_finderViewRenderinnerresourcedownloadspace

function hookView_in_finderViewRenderinnerresourcedownloadspace()
{
    global $resource;
    global $afp_server_path;
    global $access;
    global $staticSyncSyncDirField, $staticSyncDirs, $staticSyncUseArray;
    $restrictedAccess = false;
    $viewInFinder = get_plugin_config("view_in_finder");
    /*
    echo "<pre>";
    print_r($viewInFinder);
    echo "</pre>";
    */
    // check to see if we are using permissions, and if yes then do they have access to this resource type?
    if ($viewInFinder['afpServerPath'] && $access != 0) {
        $restrictedAccess = true;
    }
    if (!$restrictedAccess) {
        //echo "Access Allowed... ";
        if ($resource["file_path"] != "") {
            //echo "Got the file path…. ";
            if ($staticSyncUseArray) {
                $syncPath = get_data_by_field($resource['ref'], $staticSyncSyncDirField);
                $found = false;
                $lSyncDir = "";
                if ($syncPath != "") {
                    foreach ($staticSyncDirs as $tDir) {
                        if (!$found) {
                            if (strpos($syncPath, $tDir['syncdir']) !== false) {
                                $found = true;
                                $lSyncDir = $tDir['syncdir'];
                            }
                        }
                    }
                    if ($found) {
                        //echo "sync dir found : ". $lSyncDir;
                        // check the afp path from the config.
                        if (array_key_exists($lSyncDir, $viewInFinder['multiafpServerPath'])) {
                            $afp_link = $viewInFinder['multiafpServerPath'][$lSyncDir] . "/" . $resource["file_path"];
                        } else {
                            // use the default
                            $afp_link = $viewInFinder['afpServerPath'] . "/" . $resource["file_path"];
                        }
                        //echo $afp_link;
                    }
                } else {
                    // $syncPath is empty or not fouond, use the default
                    $afp_link = $viewInFinder['afpServerPath'] . "/" . $resource["file_path"];
                    $found = true;
                }
            } else {
                if (array_key_exists('afpServerPath', $viewInFinder)) {
                    $afp_link = $viewInFinder['afpServerPath'] . "/" . $resource["file_path"];
                    $found = true;
                }
            }
            if ($found) {
                echo "<table>";
                echo '<tr class="DownloadDBlend">';
                echo '<td>Open Original File In Finder</td>';
                $fName = explode("/", $resource["file_path"]);
                $fid = count($fName) - 1;
                echo '<td class="DownloadButton"><a href="' . $afp_link . '">' . $fName[$fid] . '</a></ td>';
                echo '</tr>';
                echo "</table>";
            }
        }
    }
}
开发者ID:vongalpha,项目名称:resourcespace,代码行数:69,代码来源:all.php


示例13: do_search

	<?php 
    exit;
}
# Fetch videos
$videos = do_search("!collection" . $usercollection);
if (getval("splice", "") != "" && count($videos) > 1) {
    $ref = copy_resource($videos[0]["ref"]);
    # Base new resource on first video (top copy metadata).
    # Set parent resource field details.
    global $videosplice_parent_field;
    $resources = "";
    for ($n = 0; $n < count($videos); $n++) {
        if ($n > 0) {
            $resources .= ", ";
        }
        $crop_from = get_data_by_field($videos[$n]["ref"], $videosplice_parent_field);
        $resources .= $videos[$n]["ref"] . ($crop_from != "" ? " " . str_replace("%resourceinfo", $crop_from, $lang["cropped_from_resource"]) : "");
    }
    $history = str_replace("%resources", $resources, $lang["merged_from_resources"]);
    update_field($ref, $videosplice_parent_field, $history);
    # Establish FFMPEG location.
    $ffmpeg_fullpath = get_utility_path("ffmpeg");
    $vidlist = "";
    # Create FFMpeg syntax to merge all additional videos.
    for ($n = 0; $n < count($videos); $n++) {
        # Work out source/destination
        global $ffmpeg_preview_extension;
        if (file_exists(get_resource_path($videos[$n]["ref"], true, "", false, $videos[$n]["file_extension"]))) {
            $source = get_resource_path($videos[$n]["ref"], true, "", false, $videos[$n]["file_extension"], -1, 1, false, "", -1, false);
        } else {
            exit(str_replace(array("%resourceid", "%filetype"), array($videos[$n]["ref"], $videos[$n]["file_extension"]), $lang["error-no-ffmpegpreviewfile"]));
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:splice.php


示例14: get_data_by_field

 // copies file
 if ($tmpfile !== false && file_exists($tmpfile)) {
     $p = $tmpfile;
     // file already in tmp, just rename it
 } else {
     if (!$replaced_file) {
         $copy = true;
         // copy the file from filestore rather than renaming
     }
 }
 # if the tmpfile is made, from here on we are working with that.
 # If using original filenames when downloading, copy the file to new location so the name is included.
 $filename = '';
 if ($original_filenames_when_downloading) {
     # Retrieve the original file name
     $filename = get_data_by_field($ref, $filename_field);
     if (!empty($filename)) {
         # Only perform the copy if an original filename is set.
         # now you've got original filename, but it may have an extension in a different letter case.
         # The system needs to replace the extension to change it to jpg if necessary, but if the original file
         # is being downloaded, and it originally used a different case, then it should not come from the file_extension,
         # but rather from the original filename itself.
         # do an extra check to see if the original filename might have uppercase extension that can be preserved.
         # also, set extension to "" if the original filename didn't have an extension (exiftool identification of filetypes)
         $pathparts = pathinfo($filename);
         if (isset($pathparts['extension'])) {
             if (strtolower($pathparts['extension']) == $pextension) {
                 $pextension = $pathparts['extension'];
             }
         } else {
             $pextension = "jpg";
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:31,代码来源:collection_download.php


示例15: extract_exif_comment


//.........这里部分代码省略.........
                        }
                        # If not in the options list, do not read this value
                        $s = trim_array(explode(",", $value));
                        $value = "";
                        # blank value
                        for ($n = 0; $n < count($s); $n++) {
                            if (trim($s[0]) != "" && in_array(strtolower($s[$n]), $options)) {
                                $value .= "," . $s[$n];
                            }
                        }
                        #echo($read_from[$i]["ref"] . " = " . $value . "<br>");
                    }
                    # Read the data.
                    if ($read) {
                        $plugin = dirname(__FILE__) . "/../plugins/exiftool_filter_" . $read_from[$i]['name'] . ".php";
                        if ($read_from[$i]['exiftool_filter'] != "") {
                            eval($read_from[$i]['exiftool_filter']);
                        }
                        if (file_exists($plugin)) {
                            include $plugin;
                        }
                        # Field 8 is used in a special way for staticsync; don't overwrite field 8 in this case
                        if (!($omit_title_for_staticsync && $read_from[$i]['ref'] == 8)) {
                            $exiffieldoption = $exifoption;
                            if ($exifoption == "custom" || isset($embedded_data_user_select_fields) && in_array($read_from[$i]['ref'], $embedded_data_user_select_fields)) {
                                debug("EXIF - custom option for field " . $read_from[$i]['ref'] . " : " . $exifoption);
                                $exiffieldoption = getval("exif_option_" . $read_from[$i]['ref'], $exifoption);
                            }
                            debug("EXIF - option for field " . $read_from[$i]['ref'] . " : " . $exiffieldoption);
                            if ($exiffieldoption == "no") {
                                continue;
                            } elseif ($exiffieldoption == "append") {
                                $spacechar = $read_from[$i]["type"] == 2 || $read_from[$i]["type"] == 3 ? ", " : " ";
                                $oldval = get_data_by_field($ref, $read_from[$i]['ref']);
                                if (strpos($oldval, $value) !== false) {
                                    continue;
                                }
                                $newval = $oldval . $spacechar . iptc_return_utf8($value);
                            } elseif ($exiffieldoption == "prepend") {
                                $spacechar = $read_from[$i]["type"] == 2 || $read_from[$i]["type"] == 3 ? ", " : " ";
                                $oldval = get_data_by_field($ref, $read_from[$i]['ref']);
                                if (strpos($oldval, $value) !== false) {
                                    continue;
                                }
                                $newval = iptc_return_utf8($value) . $spacechar . $oldval;
                            } else {
                                $newval = iptc_return_utf8($value);
                            }
                            global $merge_filename_with_title, $lang;
                            if ($merge_filename_with_title) {
                                $merge_filename_with_title_option = urlencode(getval('merge_filename_with_title_option', ''));
                                $merge_filename_with_title_include_extensions = urlencode(getval('merge_filename_with_title_include_extensions', ''));
                                $merge_filename_with_title_spacer = urlencode(getval('merge_filename_with_title_spacer', ''));
                                $original_filename = '';
                                if (isset($_REQUEST['name'])) {
                                    $original_filename = $_REQUEST['name'];
                                } else {
                                    $original_filename = $processfile['name'];
                                }
                                if ($merge_filename_with_title_include_extensions == 'yes') {
                                    $merged_filename = $original_filename;
                                } else {
                                    $merged_filename = strip_extension($original_filename);
                                }
                                $oldval = get_data_by_field($ref, $read_from[$i]['ref']);
                                if (strpos($oldval, $value) !== FALSE) {
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:67,代码来源:image_processing.php


示例16: resource_log

        resource_log($ref, 'e', $youtube_publish_url_field ? $youtube_publish_url_field : 0, $lang["youtube_publish_log_share"], $fromvalue = $youtube_old_url, $tovalue = $save_url);
    }
}
$title = get_data_by_field($ref, $youtube_publish_title_field);
#$description=get_data_by_field($ref,$youtube_publish_descriptionfield);
$description = "";
foreach ($youtube_publish_descriptionfields as $youtube_publish_descriptionfield) {
    $resource_description = get_data_by_field($ref, $youtube_publish_descriptionfield);
    if ($description != '') {
        $description .= "\r\n";
    }
    $description .= $resource_description;
}
$video_keywords = "";
foreach ($youtube_publish_keywords_fields as $youtube_publish_keywords_field) {
    $resource_keywords = get_data_by_field($ref, $youtube_publish_keywords_field);
    $video_keywords .= $resource_keywords;
}
include "../../../include/header.php";
?>

<script language="JavaScript">
function confirmSubmit()
{
var agree=confirm("<?php 
echo $lang["youtube_publish_legal_warning"];
?>
");
if (agree)
return true ;
else
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:youtube_upload.php


示例17: if

	?><span class="ResourcePendingSubmissionTitle"><?php echo $lang["status-2"]?>:</span>&nbsp;<?php
	break;
	case -1:
	?><span class="ResourcePendingReviewTitle"><?php echo $lang["status-1"]?>:</span>&nbsp;<?php
	break;
	case 1:
	?><span class="ArchiveResourceTitle"><?php echo $lang["status1"]?>:</span>&nbsp;<?php
	break;
	case 2:
	?><span class="ArchiveResourceTitle"><?php echo $lang["status2"]?>:</span>&nbsp;<?php
	break;
	case 3:
	?><span class="DeletedResourceTitle"><?php echo $lang["status3"]?>:</span>&nbsp;<?php
	break;
	} }
if (!hook("replaceviewtitle")){ echo highlightkeywords(htmlspecialchars(i18n_get_translated(get_data_by_field($resource['ref'],$title_field))),$search); } /* end hook replaceviewtitle */  
?>&nbsp;</h1>
<?php } /* End of renderinnerresourceheader hook */ ?>
</div>

<?php if (!hook("replaceresourceistranscoding")){
	if (isset($resource['is_transcoding']) && $resource['is_transcoding']!=0) { ?><div class="PageInformal"><?php echo $lang['resourceistranscoding']?></div><?php }
	} //end hook replaceresourceistrancoding ?>

<?php hook('renderbeforeresourceview', '', array('resource' => $resource)); 
$download_multisize=true;
?>

<div class="RecordResource">
<?php if (!hook("renderinnerresourceview")) { ?>
<?php if (!hook("replacerenderinnerresourcepreview")) { ?>
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:31,代码来源:view.php


示例18: upload_file

 function upload_file($ref, $no_exif = false, $revert = false, $autorotate = false)
 {
     hook("clearaltfiles", "", array($ref));
     // optional: clear alternative files before uploading new resource
     # revert is mainly for metadata reversion, removing all metadata and simulating a reupload of the file from scratch.
     hook("removeannotations");
     $exiftool_fullpath = get_utility_path("exiftool");
     # Process file upload for resource $ref
     if ($revert == true) {
         global $filename_field;
         $original_filename = get_data_by_field($ref, $filename_field);
         # Field 8 is used in a special way for staticsync, don't overwrite.
         $test_for_staticsync = get_resource_data($ref);
         if ($test_for_staticsync['file_path'] != "") {
             $staticsync_mod = " and resource_type_field != 8";
         } else {
             $staticsync_mod = "";
         }
         sql_query("delete from resource_data where resource={$ref} {$staticsync_mod}");
         sql_query("delete from resource_keyword where resource={$ref} {$staticsync_mod}");
         #clear 'joined' display fields which are based on metadata that is being deleted in a revert (original filename is reinserted later)
         $display_fields = get_resource_table_joins();
         if ($staticsync_mod != "") {
             $display_fields_new = array();
             for ($n = 0; $n < count($display_fields); $n++) {
                 if ($display_fields[$n] != 8) {
                     $display_fields_new[] = $display_fields[$n];
                 }
             }
             $display_fields = $display_fields_new;
         }
         $clear_fields = "";
         for ($x = 0; $x < count($display_fields); $x++) {
             $clear_fields .= "field" . $display_fields[$x] . "=''";
             if ($x < count($display_fields) - 1) {
                 $clear_fields .= ",";
             }
         }
         sql_query("update resource set " . $clear_fields . " where ref={$ref}");
         #also add the ref back into keywords:
         add_keyword_mappings($ref, $ref, -1);
         $extension = sql_value("select file_extension value from resource where ref={$ref}", "");
         $filename = get_resource_path($ref, true, "", false, $extension);
         $processfile['tmp_name'] = $filename;
     } else {
         # Work out which file has been posted
         if (isset($_FILES['userfile'])) {
             $processfile = $_FILES['userfile'];
         } elseif (isset($_FILES['Filedata'])) {
             $processfile = $_FILES['Filedata'];
         }
         # Java upload (at least) needs this
         # Plupload needs this
         if (isset($_REQUEST['name'])) {
             $filename = $_REQUEST['name'];
         } else {
             $filename = $processfile['name'];
         }
     }
     # Work out extension
     if (!isset($extension)) {
         # first try to get it from the filename
         $extension = explode(".", $filename);
         if (count($extension) > 1) {
             $extension = trim(strtolower($extension[count($extension) - 1]));
         } else {
             if ($exiftool_fullpath != false) {
                 $file_type_by_exiftool = run_command($exiftool_fullpath . " -filetype -s -s -s " . escapeshellarg($processfile['tmp_name']));
                 if (strlen($file_type_by_exiftool) > 0) {
                     $extension = str_replace(" ", "_", trim(strtolower($file_type_by_exiftool)));
                     $filename = $filename;
                 } else {
                     return false;
                 }
             } else {
                 return false;
             }
         }
     }
     # Banned extension?
     global $banned_extensions;
     if (in_array($extension, $banned_extensions)) {
         return false;
     }
     $status = "Please provide a file name.";
     $filepath = get_resource_path($ref, true, "", true, $extension);
     if (!$revert) {
         # Remove existing file, if present
         hook("beforeremoveexistingfile", "", array("resourceId" => $ref));
         $old_extension = sql_value("select file_extension value from resource where ref='{$ref}'", "");
         if ($old_extension != "") {
             $old_path = get_resource_path($ref, true, "", true, $old_extension);
             if (file_exists($old_path)) {
                 unlink($old_path);
             }
         }
         // also remove any existing extracted icc profiles
         $icc_path = get_resource_path($ref, true, "", true, $extension . '.icc');
         if (file_exists($icc_path)) {
             unlink($icc_path);
//.........这里部分代码省略.........
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:101,代码来源:image_processing.php


示例19: write_metadata

function write_metadata($path, $ref, $uniqid="")
	{
	// copys the file to tmp and runs exiftool on it	
	// uniqid tells the tmp file to be placed in an isolated folder within tmp

	global $exiftool_remove_existing,$storagedir,$exiftool_write,$exiftool_no_process,$mysql_charset;

    # Fetch file extension and resource type.
	$resource_data=get_resource_data($ref);
	$extension=$resource_data["file_extension"];
	$resource_type=$resource_data["resource_type"];

	$exiftool_fullpath = get_utility_path("exiftool");

    # Check if an attempt to write the metadata shall be performed.
	if (($exiftool_fullpath!=false) && ($exiftool_write) && !in_array($extension,$exiftool_no_process))
		{
		$filename = pathinfo($path);
		$filename = $filename['basename'];	
		$tmpfile=get_temp_dir(false,$uniqid) . "/" . $filename;
		copy($path,$tmpfile);

        # Add the call to exiftool and some generic arguments to the command string.
        # Argument -overwrite_original: Now that we have already copied the original file, we can use exiftool's overwrite_original on the tmpfile.
        # Argument -E: Escape values for HTML. Used for handling foreign characters in shells not using UTF-8.
        # Arguments -EXIF:all= -XMP:all= -IPTC:all=: Remove the metadata in the tag groups EXIF, XMP and IPTC.
		$command = $exiftool_fullpath . " -overwrite_original -E ";
        if ($exiftool_remove_existing) {$command.= "-EXIF:all= -XMP:all= -IPTC:all= ";}

        $write_to = get_exiftool_fields($resource_type); # Returns an array of exiftool fields for the particular resource type, which are basically fields with an 'exiftool field' set.

        for($i = 0; $i<count($write_to); $i++) # Loop through all the found fields.
			{
            $fieldtype = $write_to[$i]['type'];
            $writevalue = "";
    
            # Formatting and cleaning of the value to be written - depending on the RS field type.
            switch ($fieldtype)
                {
                case 2:
                    # Check box list: remove initial comma if present
                    if (substr(get_data_by_field($ref, $write_to[$i]['ref']), 0, 1)==",") {$writevalue = substr(get_data_by_field($ref, $write_to[$i]['ref']), 1);}
                    else {$writevalue = get_data_by_field($ref, $write_to[$i]['ref']);}
                    break;
                case 3:
                    # Drop down list: remove initial comma if present
                    if (substr(get_data_by_field($ref, $write_to[$i]['ref']), 0, 1)==",") {$writevalue = substr(get_data_by_field($ref, $write_to[$i]['ref']), 1);}
                    else {$writevalue = get_data_by_field($ref, $write_to[$i]['ref']);}
                    break;
                case 4:
                    # Date: write datetype fields as ISO 8601 date ("c")
                    $datecheck=get_data_by_field($ref, $write_to[$i]['ref']);
                    if ($datecheck!=""){
						$writevalue = date("c", strtotime($datecheck));
					} 
                    break;
                case 6:
                    # Expiry Date: write datetype fields as ISO 8601 date ("c")
                                        $datecheck=get_data_by_field($ref, $write_to[$i]['ref']);
                    if ($datecheck!=""){
						$writevalue = date("c", strtotime($datecheck));
					} 
                    break;
                case 9:
                    # Dynamic Keywords List: remove initial comma if present
                    if (substr(get_data_by_field($ref, $write_to[$i]['ref']), 0, 1)==",") {$writevalue = substr(get_data_by_field($ref, $write_to[$i]['ref']), 1);}
                    else {$writevalue = get_data_by_field($ref, $write_to[$i]['ref']);}
                    break;
                default:
                    # Other types
                    $writevalue = get_data_by_field($ref, $write_to[$i]['ref']);
                }

            # Add the tag name(s) and the value to the command string.
            $group_tags = explode(",", $write_to[$i]['exiftool_field']); # Each 'exiftool field' may contain more than one tag.
            foreach ($group_tags as $group_tag)
                {
                $group_tag = strtolower($group_tag); # E.g. IPTC:Keywords -> iptc:keywords
                if (strpos($group_tag,":")===false) {$tag = $group_tag;} # E.g. subject -> subject
                else {$tag = substr($group_tag, strpos($group_tag,":")+1);} # E.g. iptc:keywords -> keywords

                switch ($tag)
                    {
                    case "filesize":
                        # Do nothing, no point to try to write the filesize.
                        break;
                    case "keywords":
                        # Keywords shall be written one at a time and not all together.
                        $keywords = explode(",", $writevalue); # "keyword1,keyword2, ke 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_data_query_array函数代码示例发布时间:2022-05-15
下一篇:
PHP get_data函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap