Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

getResourceAnnotationsCount()

Description

Get number of annotations available for a resource.

Note: multi page resources will show the total number (ie. all pages)

Parameters

ColumnTypeDefaultDescription
$resource integer Resource ID

Return

integer

Location

include/annotation_functions.php lines 111 to 121

Definition

 
function getResourceAnnotationsCount($resource)
    {
    if(!
is_numeric($resource) || >= $resource)
        {
        return 
0;
        }

    
$resource escape_check($resource);

    return (int) 
sql_value("SELECT count(ref) AS `value` FROM annotation WHERE resource = '{$resource}'"0);
    }

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