Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 26th April 2024 21:35 Europe/London time based on the source file dated 6th March 2024 14:45 Europe/London time.