title = "Lectionary Class"; $page->description = "This page describes the Lectionary class and its methods."; $page->content = << The Lectionary class calculates the holy days over a calendar year. Here is some code that demonstrates how to use the object:

EOF; $code = <<get_calendar(); // Loop through each date and print it and the day's title and scripture \$page->content .= "

Lectionary for ".\$year."

\\n"; foreach ( \$l as \$key => \$val) { \$page->content .= '

'.\$lectionary->get_title(\$key,\$val).' (Year '.\$lectionary->get_cycle(\$key).")

\\n"; \$page->content .= "

\\n"; \$page->content .= 'Date: '.\$lectionary->get_long_date(\$key)."
\\n"; \$page->content .= 'Old Testament: ' . \$lectionary->get_scripture(\$key,\$val,'old') . "
\\n"; \$page->content .= 'Psalms: '. \$lectionary->get_scripture(\$key,\$val,'psalms') . "
\\n"; \$page->content .= 'New Testament: '. \$lectionary->get_scripture(\$key,\$val,'new') . "
\\n"; \$page->content .= 'Gospel: '. \$lectionary->get_scripture(\$key,\$val,'gospel') . "
\\n"; \$page->content .= "

\\n"; } ?> CODE; $page->content .= "
\n";
$page->content .= highlight_string($code,TRUE);
$page->content .= "
\n"; $page->content .= "

\n"; $page->content .= "Here is how that code looks when it is run:\n"; $page->content .= "

\n"; $year = intval(strftime("%Y",gmmktime())); if ( $_GET['year'] ) { $year = $_GET['year']; } require_once('Lectionary.class'); $lectionary = new Lectionary($year); $l = $lectionary->get_calendar(); $page->content .= "

Lectionary for ".$year."

\n"; foreach ( $l as $key => $val) { $page->content .= '

'.$lectionary->get_title($key,$val).' (Year '.$lectionary->get_cycle($key).")

\n"; $page->content .= "

\n"; $page->content .= 'Date: '.$lectionary->get_long_date($key)."
\n"; $page->content .= 'Old Testament: ' . $lectionary->get_scripture($key,$val,'old') . "
\n"; $page->content .= 'Psalms: '. $lectionary->get_scripture($key,$val,'psalms') . "
\n"; $page->content .= 'New Testament: '. $lectionary->get_scripture($key,$val,'new') . "
\n"; $page->content .= 'Gospel: '. $lectionary->get_scripture($key,$val,'gospel') . "
\n"; $page->content .= "

\n"; } $page->content .= "

\n"; $page->content .= "Here is the Lectionary object source code. It may run out to the right a bit.\n"; $page->content .= "

\n"; $page->content .= "
\n";
$tmp = file_get_contents("../include/Lectionary.class");
$page->content .= highlight_string($tmp,TRUE);
$page->content .= "
\n"; $page->display(1); ?>