Open Source Content Management System

mgd_walk_topic_tree

  1. Description

mgd_walk_topic_tree -- Walk a topic tree

Description

`bool **mgd_walk_topic_tree** (string func, int root, int maxlevel, mixed &xparam, bool order, string sort)`

Minimum version: Midgard 1.4 (Bifrost); the optional parameter sort was added in Midgard 1.4.1 (Bifrost)

Walks the topic tree starting at the topic record with id root to a level of _ maxlevel_ levels of depth. For each topic the user defined call-back function func is called.

The call-back function func must conform to the following signature:

`void **callback** (int id, int level, mixed &xparam)`

The parameters explained: id is the id of the topic currently being walked, level the level of descendance from the root level and &xparam a variable passed through by the user.

If the parameter order is FALSE or not defined, each topic will be processed after all its children, otherwise it will be processed before them. If given, the optional sort parameter contains an SQL-like SORT statement such as "score DESC".

Returns TRUE on success, FALSE on failure.

Designed by Nemein, hosted by Anykey