updateStats

Description

Updates various stats.

Syntax

void updateStats (string $type[, mixed $parameter1[, mixed $parameter2]])



Parameter $type

Expected type: Enumerated String
Description: What type of statistics to update

Possible string values
Allowed values Description
'member' Updates the latest member, the total member count, and the number of unapproved members. Can be called with a member ID for parameter1 and a username for parameter2 to update the latest member after registration. Can be called with true or false for parameter1 to specify whether to update statistics if approval is off.
'message' Changes the total number of messages, and the highest message id by ID_MSG - which can be parameters 1 and 2, respectively.
'postgroups' the 'postgroups' case updates those members who match condition's post-based membergroups in the database (restricted by parameter1).
'subject' Updates the log_search_subjects table (search index). parameter1 is the topic ID and parameter2 is the subject.
'topic' Updates the total number of topics, or if parameter1 is true, simply increments them.



Parameter $parameter1

Expected type: Mixed
Description: Used to specify additional information for updating statistics



Parameter $parameter2

Expected type: Mixed
Description: Used to specify additional information/restrictions for updating statistics.


Notes

  • Statistic can be 'member', 'message', 'topic', or 'postgroups'.
  • parameter1 and parameter2 are optional, and are used to update only those stats that need updating.
  • The 'member' statistic updates the latest member, the total member count, and the number of unapproved members.
  • 'member' also only counts approved members when approval is on, but is much more efficient with it off.
  • Updating 'message' changes the total number of messages, and the highest message id by ID_MSG - which can be parameters 1 and 2, respectively.
  • 'topic' updates the total number of topics, or if parameter1 is true simply increments them.
  • The 'postgroups' case updates those members who match condition's post-based membergroups in the database (restricted by parameter1).
  • 'calendar' type removed in 2.0 (possibly in favor of new "calendar_updated" variable in Settings.php?)
Advertisement: