Collections functions
General functions
Render functions
Theme permission functions
Resource 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 4th October 2022 17:35 Europe/London time based on the source file dated 29th July 2022 11:20 Europe/London time.