Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

generate_featured_collection_image_urls()

Description

Get preview URLs for a list of resource IDs

Parameters

ColumnTypeDefaultDescription
$resource_refs array List of resources
$size string Preview size

Return

array List of images URLs

Location

include/collections_functions.php lines 2277 to 2302

Definition

 
function generate_featured_collection_image_urls(array $resource_refsstring $size)
    {
    
$images = array();

    
$refs_list array_filter($resource_refs'is_numeric');
    if(empty(
$refs_list))
        {
        return 
$images;
        }
    
$refs_list "'" implode("','"$refs_list) . "'";

    
$refs_rtype sql_query("SELECT ref, resource_type FROM resource WHERE ref IN ({$refs_list})"'featured_collections');

    foreach(
$refs_rtype as $ref_rt)
        {
        
$ref $ref_rt['ref'];
        
$resource_type $ref_rt['resource_type'];

        if(
file_exists(get_resource_path($reftrue$sizefalse)) && resource_download_allowed($ref$size$resource_type))
            {
            
$images[] = get_resource_path($reffalse$sizefalse);
            }
        }

    return 
$images;
    }

This article was last updated 20th January 2021 20:05 Europe/London time based on the source file dated 19th January 2021 16:15 Europe/London time.