mgd_list_topic_articles_all

Name

mgd_list_topic_articles_all -- List articles under topic tree

Synopsis

object mgd_list_topic_articles_all(int topic, string [sort], int [type]);

Description

Minimum version: Midgard 1.1.1 (Iron River)

Lists all articles that reside under the topic tree starting at topic with id topic. The optional parameter sort is used to sort the articles, and can be one of: "alpha", "reverse alpha", "name", "reverse name", "score", "reverse score", "calendar", "revised", "reverse revised". Default sort is by created date. The optional parameter type can be used to filter articles. Default value is no filter.

Returns an object traversable by calling fetch if successfull. Returns false on failure.

Example

<?php
  $topic = 123;
  if($article = mgd_list_topic_articles_all( $topic, "score")){
    while( $article->fetch() ) {
     echo $article->name . " by " . $article->authorname . "<br>\n";
    }
    echo "$article->N article", ($article->N == 1) ? '' : 's';
  } else {
    echo "No articles";
?>