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

PHP get_resource_path函数代码示例

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

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



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

示例1: mia_results

function mia_results($results){
    global $date_fields,$dont_pull;
    $getfields = sql_query("SELECT ref,title FROM resource_type_field");
    $fieldnames = array();
    for($g=0; $g<count($getfields); $g++){
       $fieldnames[$getfields[$g]['ref']]=$getfields[$g]['title'];
    }
    for($i = 0; $i < count($results); $i++) {
        $ref = $results[$i]['ref'];
        if(isset($results[$i]['ref'])){
            $query=sql_query("SELECT * FROM resource_data WHERE resource = $ref AND value != '' AND value!='NULL' AND value != ','");
            for($q=0; $q<count($query); $q++){
                if($query[$q]['value'] != "," && $query[$q]['value'] !="" && array_key_exists($query[$q]['resource_type_field'],$fieldnames)){
                    if(substr($query[$q]['value'],0,1)==","){
                        $results[$i][$fieldnames[$query[$q]['resource_type_field']]]=substr($query[$q]['value'],1);
                    }else{
                        $results[$i][$fieldnames[$query[$q]['resource_type_field']]]=$query[$q]['value'];
                    }
                }
            }

            $access = get_resource_access($results[$i]);
            $filepath = get_resource_path($results[$i]['ref'], TRUE, '', FALSE, $results[$i]['file_extension'], -1, 1, FALSE, '', -1);
            $original_link = get_resource_path($results[$i]['ref'], FALSE, '', FALSE, $results[$i]['file_extension'], -1, 1, FALSE, '', -1);
            if(file_exists($filepath)) {
                $results[$i]['original_link'] = $original_link;
            } else {
                $results[$i]['original_link'] = 'No original link available.';
            }
            // Get the size of the original file:
           /* $original_size = get_original_imagesize($results[$i]['ref'], $filepath, $results[$i]['file_extension']);
            $original_size = formatfilesize($original_size[0]);
            $original_size = str_replace('&nbsp;', ' ', $original_size);
            $results[$i]['original_size'] = $original_size;*/
            foreach($results[$i] as $k => $v){
                if($v == "" || $v ==","){
                    unset($results[$i][$k]);
                }
                if($k == "created_by"){
                    $user = get_user($v);
                    $results[$i][$k]=$user["fullname"];
                }
                if(in_array($k,$date_fields)){
                    $unix = strtotime($v);
                    $datetime = date('y-m-d',$unix);
                    $results[$i][$k] = $datetime;
                }
                if($k == "resource_type" && is_numeric($v)){
                   $results[$i][$k]=get_resource_type_name($v);
                }
                //need to convert type to string here
                if(in_array($k,$dont_pull)){
                   unset($results[$i][$k]);
                }
            }
       }
//  var_dump($results);exit();
  return $results;
  }
}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:60,代码来源:elastic_functions.php


示例2: savetoelastic

function savetoelastic($ref){
global $baseurl, $pagename;
if($pagename != "upload2"){
//error_log($ref);
   $results=array();
   $results[] = get_resource_data($ref,false);
   $resourcetype=get_resource_type_name($results[0]['resource_type']);
   if($resourcetype != "Audio"){
     $thethumb = $baseurl.str_replace("/var/www/include/..","",get_resource_path($ref,true,"thm",false,"jpg"));
     if(!file_exists($thethumb)){
       $thethumb = $results[0]["thumbnail"] = $baseurl."/gfx/no_preview/extension/".$results[0]['file_extension'].".png";
     }
     $results[0]["thumbnail"]=$thethumb;
   }else{
     $results[0]["thumbnail"] = $baseurl."/gfx/no_preview/extension/".$results[0]['file_extension'].".png";
   }
   if($resourcetype == "Audio"){
       $results[0]["preview"]=$baseurl.str_replace("/var/www/include/..","",get_resource_path($ref, true, "", false, "mp3"));
   }else if($resourcetype == "Video"){
       $results[0]["preview"]=$baseurl.str_replace("/var/www/include/..","",get_resource_path($ref, true, "pre", false, "mp4"));
   }
   $results = mia_results($results);
   $results=json_encode($results[0]);
   $query = push_RStoElastic($resourcetype,$ref,$results);
   if($query == false){
       //failed to connect to elastic search
       createcron($attempts=1, $ref);
   }else{
//       var_dump($query);exit();
   }
   return;
}
}
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:33,代码来源:all.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: HookFormat_chooserAllGetdownloadurl

function HookFormat_chooserAllGetdownloadurl($ref, $size, $ext, $page = 1, $alternative = -1)
{
    global $baseurl_short;
    $path = get_resource_path($ref, true, $size, false, $ext, -1, $page, $size == "scr" && checkperm("w") && $alternative == -1, '', $alternative);
    if (file_exists($path)) {
        return false;
    }
    return $baseurl_short . 'plugins/format_chooser/pages/convert.php?ref=' . $ref . '&size=' . $size . '&ext=' . $ext . '&page=' . $page . '&alt=' . $alternative;
}
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:9,代码来源:all.php


示例5: getPreviewURLForType

function getPreviewURLForType($resource, $type, $alternative = -1)
{
    global $use_watermark;
    $path = get_resource_path($resource['ref'], true, $type, false, $resource["preview_extension"], -1, 1, $use_watermark, "", $alternative);
    if (!file_exists($path)) {
        return false;
    }
    return get_resource_path($resource['ref'], false, $type, false, $resource["preview_extension"], -1, 1, $use_watermark, "", $alternative);
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:9,代码来源:utility.php


示例6: HookEmbedvideoViewAfterresourceactions

function HookEmbedvideoViewAfterresourceactions()
{
    global $embedvideo_resourcetype, $ffmpeg_preview_extension, $resource, $ref, $ffmpeg_preview_max_width, $ffmpeg_preview_max_height, $userfixedtheme, $baseurl, $lang;
    if ($resource["resource_type"] != $embedvideo_resourcetype) {
        return false;
    }
    # Not the right type.
    ?>

	<?php 
    # FLV player - plays the FLV file created to preview video resources.
    if (file_exists(get_resource_path($ref, true, "pre", false, $ffmpeg_preview_extension))) {
        $flashpath = get_resource_path($ref, false, "pre", false, $ffmpeg_preview_extension, -1, 1, false, "", -1, false);
    } else {
        $flashpath = get_resource_path($ref, false, "", false, $ffmpeg_preview_extension, -1, 1, false, "", -1, false);
    }
    $flashpath = urlencode($flashpath);
    $thumb = get_resource_path($ref, false, "pre", false, "jpg");
    $thumb = urlencode($thumb);
    # Choose a colour based on the theme.
    # This is quite hacky, and ideally of course this would be CSS based, but the FLV player requires that the colour
    # is passed as a parameter.
    # The default is a neutral grey which should be acceptable for most user generated themes.
    $theme = isset($userfixedtheme) && $userfixedtheme != "" ? $userfixedtheme : getval("colourcss", "greyblu");
    $colour = "505050";
    if ($theme == "greyblu") {
        $colour = "446693";
    }
    ?>
<li><a href="#" onClick="
if (document.getElementById('embedvideo').style.display=='block') {document.getElementById('embedvideo').style.display='none';} else {document.getElementById('embedvideo').style.display='block';}
if (document.getElementById('embedvideo2').style.display=='block') {document.getElementById('embedvideo2').style.display='none';} else {document.getElementById('embedvideo2').style.display='block';}
 return false;">&gt;&nbsp;<?php 
    echo $lang["embed"];
    ?>
</a></li>
<p id="embedvideo2" style="display:none;float:left;padding:10px 0 3px 0;"><?php 
    echo $lang["embed_help"];
    ?>
</p>
<textarea id="embedvideo" style="width:335px;height:200px;display:none;"><?php 
    if (!hook("replaceembedcode")) {
        echo htmlspecialchars('
<object type="application/x-shockwave-flash" data="' . $baseurl . '/lib/flashplayer/player_flv_maxi.swf" width="' . $ffmpeg_preview_max_width . '" height="' . $ffmpeg_preview_max_height . '" class="Picture"><param name="allowFullScreen" value="true" /><param name="movie" value="' . $baseurl . '/lib/flashplayer/player_flv_maxi.swf" /><param name="FlashVars" value="flv=' . $flashpath . '&amp;width=' . $ffmpeg_preview_max_width . '&amp;height=' . $ffmpeg_preview_max_height . '&amp;margin=0&amp;buffer=10&amp;showvolume=1&amp;volume=200&amp;showtime=1&amp;autoplay=1&amp;autoload=0&amp;showfullscreen=1&amp;showstop=1&amp;playercolor=' . $colour . '&startimage=' . $thumb . '" /></object>
');
    }
    // end hook replaceembedcode
    ?>
</textarea>

	<?php 
    return true;
}
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:53,代码来源:view.php


示例7: HookResourceofthedayHomeReplaceslideshow

function HookResourceofthedayHomeReplaceslideshow()
{
    include_once dirname(__FILE__) . "/../inc/rotd_functions.php";
    global $baseurl, $view_title_field;
    $rotd = get_resource_of_the_day();
    if ($rotd === false) {
        return false;
    }
    # No ROTD, return false to disable hook and display standard slide show.
    # Get preview width
    $sizes = get_image_sizes($rotd, true);
    foreach ($sizes as $size) {
        if ($size["id"] == "pre") {
            $width = $size["width"];
            break;
        }
    }
    # Fetch title
    $title = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field={$view_title_field}", "");
    # Fetch caption
    $caption = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field=18", "");
    # Show resource!
    $pre = get_resource_path($rotd, false, "pre", false, "jpg");
    ?>
	<div class="HomePicturePanel RecordPanel" style="width: <?php 
    echo $width;
    ?>
px; padding-left: 3px;">
	<a onClick="return CentralSpaceLoad(this,true);" href="<?php 
    echo $baseurl;
    ?>
/pages/view.php?ref=<?php 
    echo $rotd;
    ?>
"><img class="ImageBorder" style="margin-bottom: 10px;" src="<?php 
    echo $pre;
    ?>
" /></a>
	<br />
	<h2 ><?php 
    echo i18n_get_translated(htmlspecialchars($title));
    ?>
</h2>
	<?php 
    echo $caption;
    ?>
	</div>
	<?php 
    return true;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:50,代码来源:home.php


示例8: HookImage_textPreviewPreviewimage

function HookImage_textPreviewPreviewimage()
{
    global $ext, $resource, $image_text_restypes, $baseurl, $ref, $url, $use_watermark, $k, $alternative, $image_text_filetypes, $page;
    # Return if not configured for this resource type, no image or using watermark
    if (!in_array($resource['resource_type'], $image_text_restypes) || $resource["has_image"] != 1 || !in_array(strtoupper($ext), $image_text_filetypes) || $use_watermark) {
        return false;
    }
    $path = get_resource_path($ref, true, "scr", false, $ext, -1, $page, "", "", $alternative);
    if (!file_exists($path)) {
        $size = "pre";
    } else {
        $size = "scr";
    }
    $url = $baseurl . "/pages/download.php" . "?ref=" . urlencode($ref) . "&size=" . urlencode($size) . "&ext=" . urlencode($ext) . "&k=" . urlencode($k) . "&alternative=" . urlencode($alternative) . "&noattach=true";
    return false;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:16,代码来源:preview.php


示例9: generate_transform_preview

function generate_transform_preview($ref){
	global $storagedir;	
        global $imagemagick_path;
	global $imversion;

	if (!isset($imversion)){
		$imversion = get_imagemagick_version();
	}

	$tmpdir = get_temp_dir();

        // get imagemagick path
        $command = get_utility_path("im-convert");
        if ($command==false) {exit("Could not find ImageMagick 'convert' utility.");}

        $orig_ext = sql_value("select file_extension value from resource where ref = '$ref'",'');
        $originalpath= get_resource_path($ref,true,'',false,$orig_ext);

	# Since this check is in get_temp_dir() omit: if(!is_dir($storagedir."/tmp")){mkdir($storagedir."/tmp",0777);}
	if(!is_dir(get_temp_dir() . "/transform_plugin")){mkdir(get_temp_dir() . "/transform_plugin",0777);}

       if ($imversion[0]<6 || ($imversion[0] == 6 &&  $imversion[1]<7) || ($imversion[0] == 6 && $imversion[1] == 7 && $imversion[2]<5)){
                $colorspace1 = " -colorspace sRGB ";
                $colorspace2 =  " -colorspace RGB ";
        } else {
                $colorspace1 = " -colorspace RGB ";
                $colorspace2 =  " -colorspace sRGB ";
        }

        $command .= " \"$originalpath\" +matte -delete 1--1 -flatten $colorspace1 -geometry 450 $colorspace2 \"$tmpdir/transform_plugin/pre_$ref.jpg\"";
        run_command($command);


	// while we're here, clean up any old files still hanging around
	$dp = opendir(get_temp_dir() . "/transform_plugin");
	while ($file = readdir($dp)) {
		if ($file <> '.' && $file <> '..'){
			if ((filemtime(get_temp_dir() . "/transform_plugin/$file")) < (strtotime('-2 days'))) {
				unlink(get_temp_dir() . "/transform_plugin/$file");
			}
		}
	}
	closedir($dp);

        return true;
  
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:47,代码来源:transform_functions.php


示例10: generate_transform_preview

function generate_transform_preview($ref)
{
    global $storagedir;
    global $imagemagick_path;
    global $imversion;
    if (!isset($imversion)) {
        $imversion = get_imagemagick_version();
    }
    $tmpdir = get_temp_dir();
    // get imagemagick path
    $command = get_utility_path("im-convert");
    if ($command == false) {
        exit("Could not find ImageMagick 'convert' utility.");
    }
    $orig_ext = sql_value("select file_extension value from resource where ref = '{$ref}'", '');
    $transformsourcepath = get_resource_path($ref, true, 'scr', false, 'jpg');
    //use screen size if available to save time
    if (!file_exists($transformsourcepath)) {
        $transformsourcepath = get_resource_path($ref, true, '', false, $orig_ext);
    }
    # Since this check is in get_temp_dir() omit: if(!is_dir($storagedir."/tmp")){mkdir($storagedir."/tmp",0777);}
    if (!is_dir(get_temp_dir() . "/transform_plugin")) {
        mkdir(get_temp_dir() . "/transform_plugin", 0777);
    }
    if ($imversion[0] < 6 || $imversion[0] == 6 && $imversion[1] < 7 || $imversion[0] == 6 && $imversion[1] == 7 && $imversion[2] < 5) {
        $colorspace1 = " -colorspace sRGB ";
        $colorspace2 = " -colorspace RGB ";
    } else {
        $colorspace1 = " -colorspace RGB ";
        $colorspace2 = " -colorspace sRGB ";
    }
    $command .= " \"{$transformsourcepath}\"[0] +matte -flatten {$colorspace1} -geometry 450 {$colorspace2} \"{$tmpdir}/transform_plugin/pre_{$ref}.jpg\"";
    run_command($command);
    // while we're here, clean up any old files still hanging around
    $dp = opendir(get_temp_dir() . "/transform_plugin");
    while ($file = readdir($dp)) {
        if ($file != '.' && $file != '..') {
            if (filemtime(get_temp_dir() . "/transform_plugin/{$file}") < strtotime('-2 days')) {
                unlink(get_temp_dir() . "/transform_plugin/{$file}");
            }
        }
    }
    closedir($dp);
    return true;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:45,代码来源:transform_functions.php


示例11: convertImage

/**
 * Converts the file of the given resource to the new target file with the specified size. The
 * target file format is determined from the suffix of the target file.
 * The original colorspace of the image is retained. If $width and $height are zero, the image
 * keeps its original size.
 */
function convertImage($resource, $page, $alternative, $target, $width, $height)
{
    $command = get_utility_path("im-convert");
    if (!$command) {
        die("Could not find ImageMagick 'convert' utility.");
    }
    $originalPath = get_resource_path($resource['ref'], true, '', false, $resource['file_extension'], -1, $page, false, '', $alternative);
    $command .= " \"{$originalPath}\"[0] -auto-orient";
    if ($width != 0 && $height != 0) {
        # Apply resize ('>' means: never enlarge)
        $command .= " -resize \"{$width}";
        if ($height > 0) {
            $command .= "x{$height}";
        }
        $command .= '>"';
    }
    $command .= " \"{$target}\"";
    run_command($command);
}
开发者ID:chandradrupal,项目名称:resourcespace,代码行数:25,代码来源:utility.php


示例12: HookRemotedownloadAllGetdownloadurl

function HookRemotedownloadAllGetdownloadurl($ref, $size, $ext, $page = 1, $alternative = -1)
{
    global $remotedownload_prepend, $remotedownload_append, $remotedownload_replace, $remotedownload_addquery;
    global $storageurl;
    $url = get_resource_path($ref, false, $size, false, $ext, -1, $page, $size == "scr" && checkperm("w") && $alternative == -1, "", $alternative);
    if (!empty($remotedownload_prepend) && strpos($url, $storageurl) === 0) {
        $storageurl_len = strlen($storageurl);
        $url = substr($url, 0, $storageurl_len) . $remotedownload_prepend . substr($url, $storageurl_len);
    }
    if (!empty($remotedownload_append)) {
        $url = $url . $remotedownload_append;
    }
    foreach ($remotedownload_replace as $replace) {
        $url = str_replace($replace['match'], $replace['with'], $url);
    }
    foreach ($remotedownload_addquery as $query) {
        $url = $url . (strpos($url, "?") !== FALSE ? "?" : "&") . $query;
    }
    return $url;
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:20,代码来源:all.php


示例13: alt_from_resource

function alt_from_resource($source,$target,$name='',$delete=false){
	// Copy a resource as an alt file of another resource
	// alt is the source resource, $ref is the target resource that will get the new alternate
	global $view_title_field;
	$srcdata=get_resource_data($source);
	$srcext = $srcdata['file_extension'];
	$srcpath = get_resource_path($source,true,"",false,$srcext);
	if ($name == ''){
		$name = sql_value("select value from resource_data where resource_type_field = '$view_title_field' and resource = '$source'",'Untitled');
	}

	$description = '';
	if (!file_exists($srcpath)){
		echo "ERROR: File not found.";
		return false;
	} else {

		$file_size = filesize_unlimited($srcpath);
		$altid = add_alternative_file($target,$name,$description="",$file_name="",$file_extension="",$file_size,$alt_type='');
		$newpath = get_resource_path($target,true,"",true,$srcext,-1,1,false,'',$altid);
		copy($srcpath,$newpath);
		# Preview creation for alternative files (enabled via config)
                global $alternative_file_previews;
                if ($alternative_file_previews){
			create_previews($target,false,$srcext,false,false,$altid);
               	}
		if ($delete){
			// we are supposed to delete the original resource when we're done
			# Not allowed to edit this resource? They shouldn't have been able to get here.
			if ((!get_edit_access($source,$srcdata["archive"]))||checkperm('D')) {
				exit ("Permission denied.");
			} else {
				delete_resource($source);
			}
		}
		return true;

	}
}
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:39,代码来源:resource_to_alt.php


示例14: updateResource

 public function updateResource()
 {
     $rid = $this->resourceId();
     // resource does not exist - create it
     if ($rid == 0) {
         $rid = create_resource($this->type);
     } else {
         update_resource_type($rid, $this->type);
     }
     foreach ($this->fields as $k => $v) {
         update_field($rid, $k, $v);
     }
     if (file_exists($this->filename)) {
         $extension = explode(".", $this->filename);
         if (count($extension) > 1) {
             $extension = trim(strtolower($extension[count($extension) - 1]));
         } else {
             $extension = "";
         }
         $path = get_resource_path($rid, true, "", true, $extension);
         copy($this->filename, $path);
         create_previews($rid, false, $extension);
         # add file extension
         sql_query("update resource set file_extension='" . escapeString($extension) . "' where ref='" . escapeString($rid) . "'");
     }
     # add resource to collection (if the collection exists)
     if ($this->collection != null) {
         $col_ref = sql_value("select ref as value from collection where name='" . escapeString($this->collection) . "'", 0);
         if (isset($col_ref)) {
             add_resource_to_collection($rid, $col_ref);
         }
     }
     # set access rights
     if ($this->access != null) {
         sql_query("update resource set access='" . escapeString($this->access) . "' where ref='" . escapeString($rid) . "'");
     }
 }
开发者ID:superdol,项目名称:xlsimport,代码行数:37,代码来源:resource.php


示例15: HookResourceofthedayHomeReplaceslideshow

function HookResourceofthedayHomeReplaceslideshow()
{
    include_once dirname(__FILE__) . "/../inc/rotd_functions.php";
    $rotd = get_resource_of_the_day();
    if ($rotd === false) {
        return false;
    }
    # No ROTD, return false to disable hook and display standard slide show.
    # Fetch resource data
    $resource = get_resource_data($rotd);
    # Fetch title
    $title = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field=8", "");
    # Fetch caption
    $caption = sql_value("select value from resource_data where resource='{$rotd}' and resource_type_field=18", "");
    # Show resource!
    $pre = get_resource_path($rotd, false, "pre", false, "jpg");
    ?>
	<div class="HomePicturePanel RecordPanel" style="width:350px;padding-left:4px;">
	<a href="view.php?ref=<?php 
    echo $rotd;
    ?>
"><img class="ImageBorder" style="margin-bottom: 10px;" src="<?php 
    echo $pre;
    ?>
" /></a>
	<br />
	<h2 ><?php 
    echo i18n_get_translated(htmlspecialchars($title));
    ?>
</h2>
	<?php 
    echo $caption;
    ?>
	</div>
	<?php 
    return true;
}
开发者ID:vongalpha,项目名称:resourcespace,代码行数:37,代码来源:home.php


示例16: sql_query

     $sql .= ", transform_flop=" . ($flip ? "'1'" : "null") . ", transform_rotation=" . ($rotation > 0 ? "'{$rotation}'" : "null") . "";
     $sql .= " where ref='{$newfile}'";
     $result = sql_query($sql);
     resource_log($ref, 'b', '', "{$new_ext} " . strtolower($verb) . " to {$newfilewidth} x {$newfileheight}");
 } elseif ($original && getval("slideshow", "") == "" && !$cropperestricted) {
     // we are supposed to replace the original file
     $origalttitle = $lang['priorversion'];
     $origaltdesc = $lang['replaced'] . " " . strftime("%Y-%m-%d, %H:%M");
     $origfilename = sql_value("select value from resource_data left join resource_type_field on resource_data.resource_type_field = resource_type_field.ref where resource = '{$ref}' and name = 'original_filename'", $ref . "_original.{$orig_ext}");
     $origalt = add_alternative_file($ref, $origalttitle, $origaltdesc);
     $origaltpath = get_resource_path($ref, true, "", true, $orig_ext, -1, 1, false, "", $origalt);
     $mporig = round($origwidth * $origheight / 1000000, 2);
     $filesizeorig = filesize_unlimited($originalpath);
     rename($originalpath, $origaltpath);
     $result = sql_query("update resource_alt_files set file_name='{$origfilename}',file_extension='{$orig_ext}',file_size = '{$filesizeorig}' where ref='{$origalt}'");
     $neworigpath = get_resource_path($ref, true, '', false, $new_ext);
     rename($newpath, $neworigpath);
     $result = sql_query("update resource set file_extension = '{$new_ext}' where ref = '{$ref}' limit 1");
     // update extension
     resource_log($ref, 't', '', 'original transformed');
     create_previews($ref, false, $orig_ext, false, false, $origalt);
     create_previews($ref, false, $new_ext);
     # delete existing resource_dimensions
     sql_query("delete from resource_dimensions where resource='{$ref}'");
     sql_query("insert into resource_dimensions (resource, width, height, file_size) values ('{$ref}', '{$newfilewidth}', '{$newfileheight}', '{$newfilesize}')");
     # call remove annotations, since they will not apply to transformed
     hook("removeannotations");
     // remove the cached transform preview, since it will no longer be accurate
     if (file_exists(get_temp_dir() . "/transform_plugin/pre_{$ref}.jpg")) {
         unlink(get_temp_dir() . "/transform_plugin/pre_{$ref}.jpg");
     }
开发者ID:claytondaley,项目名称:resourcespace,代码行数:31,代码来源:crop.php


示例17: do_search

<?php 
}
?>
var timer;
</script>

<?php 
$page = 1;
$resources = do_search("!collection" . $ref);
foreach ($resources as $resource) {
    $file_path = get_resource_path($resource["ref"], true, $size, false, $resource["preview_extension"], -1, 1, $use_watermark);
    if (file_exists($file_path)) {
        $preview_path = get_resource_path($resource["ref"], false, $size, false, $resource["preview_extension"], -1, 1, $use_watermark);
    } else {
        # Fall back to 'pre' size
        $preview_path = get_resource_path($resource["ref"], false, "pre", false, $resource["preview_extension"], -1, 1, $use_watermark);
    }
    # sets height and width to display
    $ratio = $resource["thumb_width"] / $resource["thumb_height"];
    if ($ratio >= 1) {
        # Landscape image, width is the largest - scale the height
        $width = getvalescaped("width", "");
        $height = floor($width / $ratio);
    } else {
        $height = getvalescaped("width", "");
        $width = floor($height * $ratio);
    }
    ?>
	<a class="embedslideshow_preview_inner" id="embedslideshow_preview<?php 
    echo $page;
    ?>
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:viewer.php


示例18: get_resource_access

 <?php 
}
?>
id="ResourceShell<?php 
echo $ref;
?>
">
	<div class="ResourcePanelSmall">	
		<?php 
if (!hook("renderimagesmallthumb")) {
    ?>
		<?php 
    $access = get_resource_access($result[$n]);
    $use_watermark = check_use_watermark();
    # Work out the preview image path
    $col_url = get_resource_path($ref, false, "col", false, $result[$n]["preview_extension"], -1, 1, $use_watermark, $result[$n]["file_modified"]);
    if (isset($result[$n]["col_url"])) {
        $col_url = $result[$n]["col_url"];
    }
    # If col_url set in data, use instead, e.g. by manipulation of data via process_search_results hook
    ?>
		<table border="0" class="ResourceAlignSmall">
		<?php 
    hook("resourcetop");
    ?>
		<tr><td>
		<a href="<?php 
    echo $url;
    ?>
"  onClick="return CentralSpaceLoad(this,true);" <?php 
    if (!$infobox) {
开发者ID:vongalpha,项目名称:resourcespace,代码行数:31,代码来源:smallthumbs.php


示例19: urlencode

						// swap title fields if necessary

						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];
								}	
							}	
								
						?>
						
						<!--Resource Panel-->
						<div class="ResourcePanelShellSmall">
						<table border="0" class="ResourceAlignSmall"><tr><td>
						<a href="<?php echo $baseurl_short?>pages/view.php?ref=<?php echo $rref?>&search=<?php echo urlencode("!related" . $ref)?>" onClick="return CentralSpaceLoad(this,true);"><?php if ($result[$n]["has_image"]==1) { ?><img border=0 src="<?php echo get_resource_path($rref,false,"col",false,$result[$n]["preview_extension"],-1,1,checkperm("w"),$result[$n]["file_modified"])?>" class="CollectImageBorder"/><?php } else { ?><img border=0 src="../gfx/<?php echo get_nopreview_icon($result[$n]["resource_type"],$result[$n]["file_extension"],true)?>"/><?php } ?></a></td>
						</tr></table>
						<div class="ResourcePanelInfo"><a href="<?php echo $baseurl_short?>pages/view.php?ref=<?php echo $rref?>" onClick="return CentralSpaceLoad(this,true);"><?php echo tidy_trim(i18n_get_translated($title),15)?></a>&nbsp;</div>
						<div class="ResourcePanelIcons"><input type="checkbox" id="share<?php echo $rref ?>" class="checkselect" onChange="UpdateRelatedField(this,<?php echo $rref ?>);"></div>
						
						</div>
						<?php		
						}
					}
					?>
					</div><!-- end of sharerelatedtype -->
					<div class="clearerleft"> </div>
					<?php
				} //end of display loop by resource extension
		
		?>
开发者ID:artsmia,项目名称:mia_resourcespace,代码行数:31,代码来源:resource_email.php


示例20: run_command

    run_command($command);
    $convert_fullpath = get_utility_path("im-convert");
    if ($convert_fullpath == false) {
        exit("Could not find ImageMagick 'convert' utility at location '{$imagemagick_path}'");
    }
    $command = $convert_fullpath . " -resize " . $contact_sheet_preview_size . " -quality 90 -colorspace " . $imagemagick_colorspace . " \"" . get_temp_dir() . "/contactsheetrip.jpg\" \"" . get_temp_dir() . "/contactsheet.jpg\"" . ($config_windows ? "" : " 2>&1");
    run_command($command);
    exit;
}
#check configs, decide whether PDF outputs to browser or to a new resource.
if ($contact_sheet_resource == true) {
    $newresource = create_resource(1, 0);
    update_field($newresource, 8, i18n_get_collection_name($collectiondata) . " " . $date);
    update_field($newresource, $filename_field, $newresource . ".pdf");
    #Relate all resources in collection to the new contact sheet resource
    relate_to_collection($newresource, $collection);
    #update file extension
    sql_query("update resource set file_extension='pdf' where ref='{$newresource}'");
    # Create the file in the new resource folder:
    $path = get_resource_path($newresource, true, "", true, "pdf");
    $pdf->Output($path, 'F');
    #Create thumbnails and redirect browser to the new contact sheet resource
    create_previews($newresource, true, "pdf");
    redirect($baseurl_short . "pages/view.php?ref=" . $newresource);
} else {
    $out1 = ob_get_contents();
    if ($out1 != "") {
        ob_end_clean();
    }
    $pdf->Output(i18n_get_collection_name($collectiondata) . ".pdf", "D");
}
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:contactsheet.php



注:本文中的get_resource_path函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_resource_type函数代码示例发布时间:2022-05-15
下一篇:
PHP get_resource_field_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