Skip to content

5. Integration with PHP

In case of integration Orthodox Calendar with your PHP script call calendar.php directly. You can use file_get_contents to get Orthodox Calendar HTML code. Then with this code you can do what you want.

In Example 5.1 we will get Orthodox Calendar HTML code for the current date into variable $contents. Then strip off all tags, exept <p>, </p> and <br>. Source code:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Example 5.1</title>
</head>
<body>

<?php
$contents = file_get_contents("http://www.holytrinityorthodox.com/calendar/calendar.php?lives=1&trp=1&scripture=1");
echo strip_tags($contents,'<p></p><br>');
?>

</body>
</html>

PHP parameters for calendar.php:

http://www.holytrinityorthodox.com/calendar/calendar.php
?month=5&today=11&year=2008&dt=1&header=1&lives=1&trp=1&scripture=1

month - Month. If parameter missed then - current Month.

today - Day of Month. If parameter missed then - current day.

year - Year. If parameter missed then - current Year.

dt - if 1, generates date in format Gregorian/Julian.

header - if 1, generates Orthodox Calendar header which follows the date.

lives - generates the Lives of Saints. It can be 0,1,2,3,4,5,6.

0 - do not generate the Lives of Saints.

1 - generate the Lives of all Saints in separate paragraphs.

2 - generate the Lives of all Saints in one paragraphs.

3 - generate the Lives of major Saints in separate paragraphs.

4 - generate the Lives of major Saints in one paragraphs.

5 -generate the Lives of major Saints and New Martyrs in separate paragraphs (Moscow Patriarchate).

6 -generate the Lives of major Saints and New Martyrs in one paragraphs (Moscow Patriarchate).

All other values do not generate the Lives of Saints

trp - generates Troparion. It can be 0,1,2.

0 - do not generate Troparion.
1 - generate Troparion with header (word Troparion).
2 - generate Troparion without header.

All other values do not generate Troparion

scripture - generates the Scripture Readings. It can be 0,1,2.

0 - do not generate the Scripture Readings.
1 - generate the Scripture Readings with header (words The Scripture Readings).
2 - generate the Scripture Readings without header.

All other values do not generate the Scripture Readings