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

get_alternative_files()

Parameters

ColumnTypeDefaultDescription
$resource
$order_by ""
$sort ""
$type ""

Location

include/resource_functions.php lines 4267 to 4281

Definition

 
function get_alternative_files($resource,$order_by="",$sort="",$type="")
    {
    
# Returns a list of alternative files for the given resource
    
if ($order_by!="" && $sort!=""){
        
$ordersort=$order_by." ".$sort.",";
    } else {
        
$ordersort="";
    }
    
$extrasql=hook("get_alternative_files_extra_sql","",array($resource));
    
    
# Filter by type, if provided.
    
if ($type!="") {$extrasql.= " and alt_type='" escape_check($type) . "'";}

    return 
sql_query("select ref,name,description,file_name,file_extension,file_size,creation_date,alt_type from resource_alt_files where resource='".escape_check($resource)."' $extrasql order by ".escape_check($ordersort)." name asc, file_size desc");
    }

This article was last updated 25th November 2020 07:35 Europe/London time based on the source file dated 13th November 2020 16:50 Europe/London time.