Collections functions
General functions
Render functions
Theme permission functions
Resource functions

get_nodes_count()

Description

Get the total number of nodes for a specific field

Parameters

ColumnTypeDefaultDescription
$resource_type_field integer ID of the metadata field
$name string '' Filter by name of node

Return

integer

Location

include/node_functions.php lines 1816 to 1828

Definition

 
function get_nodes_count($resource_type_field$name '')
    {
    
$query="SELECT count(ref) AS `value` FROM node WHERE resource_type_field = ?";
    
$parameters=array("i",$resource_type_field);

    if(
'' != $name)
        {
        
$query .= " AND `name` LIKE ?";
        
$parameters[]="s";$parameters[]="%" $name "%";
        }

    return (int) 
ps_value($query,$parameters0);
    }

This article was last updated 30th September 2022 17:35 Europe/London time based on the source file dated 30th September 2022 14:20 Europe/London time.