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 5th October 2022 04:35 Europe/London time based on the source file dated 29th July 2022 11:20 Europe/London time.