Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 19th March 2024 08:05 Europe/London time based on the source file dated 6th March 2024 14:45 Europe/London time.