mgd_list_topic_calendar_all

(Midgard 1.4.2 'Bifrost')

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

Description

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])

Minimum version: Midgard 1.1.1

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 successful. Returns FALSE on failure.


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