Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video 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 1556 to 1566

Definition

 
function get_nodes_count($resource_type_field$name '')
    {
    
$resource_type_field escape_check($resource_type_field);
    
$filter_by_name '';
    if(
'' != $name)
        {
        
$filter_by_name " AND `name` LIKE '%" escape_check($name) . "%'";
        }

    return (int) 
sql_value("SELECT count(ref) AS `value` FROM node WHERE resource_type_field = '{$resource_type_field}'{$filter_by_name}"0);
    }

This article was last updated 2nd December 2020 00:35 Europe/London time based on the source file dated 30th November 2020 09:45 Europe/London time.