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

getResourceAnnotations()

Description

Get annotations for a specific resource

Parameters

ColumnTypeDefaultDescription
$resource integer Resource ID
$page integer 0 Page number of a document. Non documents will have 0

Return

array

Location

include/annotation_functions.php lines 127 to 144

Definition

 
function getResourceAnnotations($resource$page 0)
    {
    if(
>= $resource)
        {
        return array();
        }

    
$parameters=array("i",$resource);
    
$sql_page_filter 'AND `page` IS NULL';

    if(
$page)
        {
        
$sql_page_filter "AND `page` IS NOT NULL AND `page` = ?";
        
$parameters=array_merge($parameters, array("i",$page));
        }

    return 
ps_query("SELECT " columns_in("annotation") . " FROM annotation WHERE resource = ? {$sql_page_filter}"$parameters);
    }

This article was last updated 7th November 2024 20:35 Europe/London time based on the source file dated 6th March 2024 14:45 Europe/London time.