mgd_list_topic_calendar_all

Name

mgd_list_topic_calendar_all -- List articles under topic (sub)tree in a time window

Synopsis

object mgd_list_topic_calendar_all(int topic, int [type]);

object mgd_list_topic_calendar_all(int topic, int start, int stop, string [sort], int [type]);

Description

Minimum version: Midgard 1.1.1 (Iron River)

Lists calendar entry articles under the topic tree starting at topic with id topic. Normally the function returns the calendar entries that are currently happening or happen in future. The entries are sorted by date. To list old calendar entries or to limit a query to a specific time range, use the alternative function signature.

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

Example

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