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

save_alternative_file()

Description

Updates the details of an alternative file in the database.

Parameters

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

Return

void

Location

include/resource_functions.php lines 5223 to 5231

Definition

 
function save_alternative_file($resource,$ref)
    {
    
# Saves the 'alternative file' edit form back to the database
    
$name           getval("name","");
    
$description    getval("description","");
    
$alt_type       getval("alt_type","");
    
ps_query("UPDATE resource_alt_files SET name = ?,description = ?,alt_type = ? WHERE resource = ? AND ref = ?",
    array(
"s",$name,"s",$description,"s",$alt_type,"i",$resource,"i",$ref));
    }

This article was last updated 8th December 2024 08:35 Europe/London time based on the source file dated 6th December 2024 14:05 Europe/London time.