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 25th May 2022 05:35 Europe/London time based on the source file dated 1st February 2022 16:00 Europe/London time.