mgd_list_topics

(Midgard 1.4.2 'Bifrost')

mgd_list_topics -- List subtopics

Description

object mgd_list_topics (int topic, string [sort])

Minimum version: Midgard 1.1.1

Lists the subtopics of the topic record with id id . The optional sort argument can be used to specify the order in which the results will be listed. Possible values are: "alpha", "reverse alpha", "name", "reverse name", "score", "reverse score", "revised", "reverse revised". If the sort parameter is omitted, the returned topics are ordered by score (descending) and name (ascending).

You can list the root topics by specifying 0 for the topic parameter.

Returns an object traversable by calling fetch() if successful. Returns FALSE on failure.


<?php
  $lst = mgd_list_topics(17);
  if(!$lst) {
     echo "mgd_list_topics(17) failed.<br>";
     echo "reason: " . mgd_errstr();
  }else{
     while($lst->fetch()){
       echo $lst->name . "<br>\n";
     }
  }
?>