Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_alternative_file()

Description

Retrieves a specific alternative file associated with a given resource.

Parameters

ColumnTypeDefaultDescription
$resource int The resource ID associated with the alternative file.
$ref int The reference ID of the alternative file to retrieve.

Return

array|bool An associative array containing the alternative file details if found, false otherwise.

Location

include/resource_functions.php lines 5219 to 5224

Definition

 
function get_alternative_file($resource,$ref)
    {
    
# Returns the row for the requested alternative file
    
$return=ps_query("select ref,name,description,file_name,file_extension,file_size,creation_date,alt_type from resource_alt_files where resource=? and ref=?",array("i",$resource,"i",$ref));
    if (
count($return)==0) {return false;} else {return $return[0];}
    }

This article was last updated 17th November 2024 15:05 Europe/London time based on the source file dated 15th November 2024 18:30 Europe/London time.