Collections functions
Encryption functions
General 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 132 to 149

Definition

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

    
$resource escape_check($resource);
    
$page     escape_check($page);

    
$sql_page_filter 'AND `page` IS NULL';
    if(
$page)
        {
        
$sql_page_filter "AND `page` IS NOT NULL AND `page` = '{$page}'";
        }

    return 
sql_query("SELECT * FROM annotation WHERE resource = '{$resource}{$sql_page_filter}");
    }

This article was last updated 16th July 2020 01:05 Europe/London time based on the source file dated 17th January 2020 16:11 Europe/London time.