Collections functions
General functions
Render 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 108 to 116

Definition

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

    return (int) 
ps_value("SELECT count(ref) AS `value` FROM annotation WHERE resource = ?",array("i",$resource), 0);
    }

This article was last updated 29th January 2023 23:05 Europe/London time based on the source file dated 29th December 2022 17:10 Europe/London time.