$myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $yearID = false; // GET variable for the year (set in Active Calendar Class), init false to display current year $monthID = false; // GET variable for the month (set in Active Calendar Class), init false to display current month $dayID = false; // GET variable for the day (set in Active Calendar Class), init false to display current day extract($_GET); /* ******************************************************************************** Create a calendar object ******************************************************************************** */ require_once "../source/activecalendar.php"; $cal = new activeCalendar($yearID, $monthID, $dayID); /* ******************************************************************************** Gets all dates from your database and set the calendar events html classes (for the layout) ******************************************************************************** */ $eventID = "event"; // sets the name of the generated HTML class on the event day (css layout) while ($data = @mysql_fetch_array($sqlID, MYSQL_BOTH)) { $mysqlDay = date("j", $data[$tblDateName]); // makes a day out of the database date $mysqlMonth = date("n", $data[$tblDateName]); // makes a month out of the database date $mysqlYear = date("Y", $data[$tblDateName]); // makes a year out of the database date $mysqlContent = $data[$tblContent];
<?php require_once "../source/activecalendar.php"; $cal = new activeCalendar(); $cal->enableWeekNum("Week"); // enables week number column ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?> " /> </head> <body> <center> <?php print $cal->showYear(3); // '3' sets 3 months in each row ?> <br /> <a href="../examples.php">Back to examples.php</a> </center> </body> </html>
with event days as well as days with event content (optionally linkable). Moreover, different month and day names will be set, than the ones used in the configuration. (The layout may be not the best in this case, but I have chosen the year view for this examples, as it gives a better overview of the methods output) ******************************************************************************** */ include "activecalendar.php"; $myurl = $_SERVER['PHP_SELF']; // the links url is this page in this case $yearID = false; // GET variable for the year (set in Active Calendar Class), init false to display current year $monthID = false; // GET variable for the month (set in Active Calendar Class), init false to display current month $dayID = false; // GET variable for the day (set in Active Calendar Class), init false to display current day extract($_GET); $cal = new activeCalendar($yearID, $monthID, $dayID); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class Year View with Events Example</title> <link rel="stylesheet" type="text/css" href="activecalendar1.css" /> </head> <body> <center> <?php $monthName = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"); // The months will not have a name, just a number $dayName = array("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"); // The days will be in german language $cal->monthYearDivider = " / ";
******************************************************************************** This simple example script demontrates how you could create a calendar month with a date picker control, navigation links and linkable days ******************************************************************************** */ include "activecalendar.php"; $myurl = $_SERVER['PHP_SELF']; // the links url is this page in this case $yearID = false; // GET variable for the year (set in Active Calendar Class), init false to display current year $monthID = false; // GET variable for the month (set in Active Calendar Class), init false to display current month $dayID = false; // GET variable for the day (set in Active Calendar Class), init false to display current day extract($_GET); $cal = new activeCalendar($yearID, $monthID, $dayID); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class Month View Example</title> <link rel="stylesheet" type="text/css" href="activecalendar.css" /> </head> <body> <center> <?php $cal->enableMonthNav(); // this enables the month's navigation controls $cal->enableDatePicker(2002, 2006, $myurl); // this enables the date picker controls $cal->enableDayLinks($myurl);
$myurl = $_SERVER['PHP_SELF']; // the links url is this page in this case $yearID = 2005; // GET variable for the year, init 2005 to display the year of the event file $monthID = 4; // GET variable for the month, init 4 to display the month of the event file $dayID = false; // GET variable for the day, init false to display current day extract($_GET); /* ******************************************************************************** Create a calendar object ******************************************************************************** */ include "activecalendar.php"; $cal = new activeCalendar($yearID, $monthID, $dayID); /* ******************************************************************************** Read the event file and set the events ******************************************************************************** */ $filePath = "flatevents.txt"; // the path of the events flat file $divideStr = "~"; // the divider between events in the events flat file $eventID = "event"; // sets the name of the generated HTML class on the event day (css layout) $evts = eventsFromFile($filePath, $divideStr); if ($evts) { for ($x = 0; $x < count($evts); $x++) { //$cal->setEvent(@$evts[$x][0],@$evts[$x][1],@$evts[$x][2],$eventID);
<?php require_once "../source/activecalendar.php"; $cal = new activeCalendar(); ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?> " /> </head> <body> <center> <?php print $cal->showYear(12, 5); // '12' sets 3 months in each row, '5' sets the starting month (May) ?> <br /> <a href="../examples.php">Back to examples.php</a> </center> </body> </html>
/** * Returns the calendar boxes * * @param integer $boxes Number of boxes * @param year $year Year * @param integer $month month * @param integer $day day * @param integer $catid category id * * @return string calendar boxes */ function getBoxes($boxes, $year, $month = 0, $day = 0, $catid = 0) { global $_ARRAYLANG, $objInit; if ($catid != 0 && !empty($catid)) { $url_cat = "&catid={$catid}"; } else { $url_cat = ""; } $url = htmlentities($this->calendarBoxUrl, ENT_QUOTES, CONTREXX_CHARSET) . $url_cat; $firstblock = true; $month = intval($month); $year = intval($year); $day = intval($day); $monthnames = explode(",", $_ARRAYLANG['TXT_CALENDAR_MONTH_ARRAY']); $daynames = explode(',', $_ARRAYLANG['TXT_CALENDAR_DAY_ARRAY']); $calenderBoxes = ''; for ($i = 0; $i < $boxes; $i++) { $cal = new \activeCalendar($year, $month, $day); $cal->setMonthNames($monthnames); $cal->setDayNames($daynames); if ($firstblock) { $cal->enableMonthNav($url); } else { // This is necessary for the modification of the linkname // The modification makes a link on the monthname $cal->urlNav = $url; } // for seperate variable for the month links if (!empty($this->calendarBoxMonthNavUrl)) { $cal->urlMonthNav = htmlentities($this->calendarBoxMonthNavUrl, ENT_QUOTES, CONTREXX_CHARSET); } //load events foreach ($this->eventList as $objEvent) { if ($objEvent->access && $objInit->mode == 'frontend' && !\Permission::checkAccess(116, 'static', true)) { continue; } $startdate = $objEvent->startDate; $enddate = $objEvent->endDate; $eventYear = date("Y", $startdate); $eventMonth = date("m", $startdate); $eventDay = date("d", $startdate); $eventEndDay = date("d", $enddate); $eventEndMonth = date("m", $enddate); // do only something when the event is in the current month if ($eventMonth <= $month && $eventEndMonth >= $month) { // if the event is longer than one day but every day is in the same month if ($eventEndDay > $eventDay && $eventMonth == $eventEndMonth) { $curday = $eventDay; while ($curday <= $eventEndDay) { $eventurl = $url . "&yearID={$eventYear}&monthID={$month}&dayID={$curday}" . $url_cat; $cal->setEvent("{$eventYear}", "{$eventMonth}", "{$curday}", false, $eventurl); $curday++; } } elseif ($eventEndMonth > $eventMonth) { if ($eventMonth == $month) { // Show the part of the event in the starting month $curday = $eventDay; while ($curday <= 31) { $eventurl = $url . "&yearID={$eventYear}&monthID={$month}&dayID={$curday}" . $url_cat; $cal->setEvent("{$eventYear}", "{$eventMonth}", "{$curday}", false, $eventurl); $curday++; } } elseif ($eventEndMonth == $month) { // show the part of the event in the ending month $curday = $eventEndDay; while ($curday > 0) { $eventurl = $url . "&yearID={$eventYear}&monthID={$month}&dayID={$curday}" . $url_cat; $cal->setEvent("{$eventYear}", "{$eventEndMonth}", "{$curday}", false, $eventurl); $curday--; } } elseif ($eventMonth < $month && $eventEndMonth > $month) { foreach (range(0, 31, 1) as $curday) { $eventurl = $url . "&yearID={$eventYear}&monthID={$month}&dayID={$curday}" . $url_cat; $cal->setEvent("{$eventYear}", "{$month}", "{$curday}", false, $eventurl); } } } else { $eventurl = $url . "&yearID={$eventYear}&monthID={$month}&dayID={$eventDay}" . $url_cat; $cal->setEvent("{$eventYear}", "{$eventMonth}", "{$eventDay}", false, $eventurl); } } } $calenderBoxes .= $cal->showMonth(false, true); if ($month == 12) { $year++; $month = 1; } else { $month++; } $day = 0; $firstblock = false; } return $calenderBoxes; }
$myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $yearID = 2005; // GET variable for the year, init 2005 to display the year of the event file $monthID = 10; // GET variable for the month, init 10 to display the month of the event file $dayID = false; // GET variable for the day, init false to display current day extract($_GET); /* ******************************************************************************** Create a calendar object ******************************************************************************** */ require_once "../source/activecalendar.php"; $cal = new activeCalendar($yearID, $monthID, $dayID); /* ******************************************************************************** Set the path and the tag names, used in the xml file ******************************************************************************** */ $filePath = "xmlevents.xml"; // the path of the events xml file $eventYearTag = "eventyear"; // unique name for the event year $eventMonthTag = "eventmonth"; // unique name for the event month $eventDayTag = "eventday"; // unique name for the event day $eventStyleTag = "eventstyle"; // unique name for the event ID (CSS layout)
require_once "../source/activecalendar.php"; $myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $yearID = false; // init false to display current year $monthID = false; // init false to display current month $dayID = false; // init false to display current day extract($_GET); // get the new values (if any) of $yearID,$monthID,$dayID $arrowBack = "<img src=\"img/back.png\" border=\"0\" alt=\"<<\" />"; // use png arrow back $arrowForw = "<img src=\"img/forward.png\" border=\"0\" alt=\">>\" />"; // use png arrow forward $cal = new activeCalendar($yearID, $monthID, $dayID); $cal->enableMonthNav($myurl, $arrowBack, $arrowForw); // enables navigation controls $cal->enableDatePicker(2000, 2010, $myurl); // enables date picker (year range 2000-2010) ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?>
<?php require_once "../source/activecalendar.php"; $myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $cal = new activeCalendar(); $cal->enableDayLinks($myurl); // enables day links $thisYear = $cal->actyear; // get the current year $cal->setEvent($thisYear, "1", "17", "event"); // create a class="event" on the 17th Jan each year for ($x = 10; $x <= 20; $x++) { $cal->setEvent($thisYear, "3", $x); } // create a class="event" from 10th till 20th on March each year for ($x = 5; $x <= 12; $x++) { $cal->setEvent($thisYear, $x, "24"); } // create a class="event" on the 23th from May till December each year ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?>
<html> <header> <title>Extia Events</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="../css/styleev.css"> <link rel="stylesheet" type="text/css" href="../activecalendar/data/css/plain.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <?php include "headerconnect.php"; ?> </header> <body> <?php include '../php/config.php'; require_once "../activecalendar/source/activecalendar.php"; $cal = new activeCalendar(); try { $conn = new PDO("mysql:host={$dbhost};dbname={$dbname};charset=utf8", $dbuser, $dbpass); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { echo "Connection failed (check config.php): " . $e->getMessage(); } $result = $conn->prepare("SELECT * FROM Event"); $result->execute(); while ($donnees = $result->fetch()) { $date = strtotime($donnees['Darte']); $y = date('Y', $date); $m = date('m', $date); $d = date('d', $date); $h = date('H', $date);
$myurl = $_SERVER['PHP_SELF']; // the links url is this page in this case $yearID = 2005; // GET variable for the year, init 2005 to display the year of the event file $monthID = 10; // GET variable for the month, init 4 to display the month of the event file $dayID = false; // GET variable for the day, init false to display current day extract($_GET); /* ******************************************************************************** Create a calendar object ******************************************************************************** */ include "activecalendar.php"; $cal = new activeCalendar($yearID, $monthID, $dayID); /* ******************************************************************************** Set the path and the tag names, used in the xml file ******************************************************************************** */ $filePath = "xmlevents.xml"; // the path of the events xml file $eventYearTag = "eventyear"; // unique name for the event year $eventMonthTag = "eventmonth"; // unique name for the event month $eventDayTag = "eventday"; // unique name for the event day $eventStyleTag = "eventstyle"; // unique name for the event ID (CSS layout)
<?php require_once "../source/activecalendar.php"; $myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $cal = new activeCalendar("2007", "11"); $cal->enableDayLinks($myurl); // enables day links $cal->enableWeekNum("Week", $myurl); // enables week number column with linkable week numbers ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?> " /> </head> <body> <center> <?php print $cal->showMonth(); ?> <br /> <a href="../examples.php">Back to examples.php</a> </center>
/* ******************************************************************************** This example script will generate a year calendar with day links that call a javascript function, instead of a page url. The simple javacript function of this script should demonstrate that. You can write your own javascript function, to adjust the script to your needs. ******************************************************************************** */ include "activecalendar.php"; $yearID = false; // GET variable for the year (set in Active Calendar Class), init false to display current year $monthID = false; // GET variable for the month (set in Active Calendar Class), init false to display current month $dayID = false; // GET variable for the day (set in Active Calendar Class), init false to display current day extract($_GET); $cal = new activeCalendar($yearID, $monthID, $dayID); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class Year View with JavaScript Example</title> <link rel="stylesheet" type="text/css" href="activecalendar.css" /> </head> <body> <script type="text/javascript"> function selectDate(year,month,day){ document.selectform.yearselection.value=year; document.selectform.monthselection.value=month; document.selectform.dayselection.value=day; } </script>
/** * Loads datepicker * * @param object &$datePicker * @param integer $cat * * @return null */ function loadDatePicker(&$datePicker, $cat = null) { global $_CORELANG; if ($this->_objTpl->placeholderExists($this->moduleLangVar . '_DATEPICKER')) { $timestamp = time(); $datePickerYear = $_REQUEST["yearID"] ? $_REQUEST["yearID"] : date('Y', $timestamp); $datePickerMonth = $_REQUEST["monthID"] ? $_REQUEST["monthID"] : date('m', $timestamp); $datePickerDay = $_REQUEST["dayID"] ? $_REQUEST["dayID"] : date('d', $timestamp); $datePicker = new \activeCalendar($datePickerYear, $datePickerMonth, $datePickerDay); $datePicker->enableMonthNav("?section=Calendar"); $datePicker->enableDayLinks("?section=Calendar"); $datePicker->setDayNames(explode(',', $_CORELANG['TXT_DAY_ARRAY'])); $datePicker->setMonthNames(explode(',', $_CORELANG['TXT_MONTH_ARRAY'])); $eventManagerAllEvents = new \Cx\Modules\Calendar\Controller\CalendarEventManager(null, null, $cat, null, true, false, true); $eventManagerAllEvents->getEventList(); $events = $eventManagerAllEvents->getEventsWithDate(); foreach ($events as $event) { $datePicker->setEvent($event["year"], $event["month"], $event["day"], " withEvent"); } $datePicker = $datePicker->showMonth(); } }
<?php include "activecalendar.php"; $yearID = false; $monthID = false; $dayID = false; $weekID = false; $showcal = false; extract($_GET); $cal = new activeCalendar($weekID, $yearID, $monthID, $dayID); echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"activecalendar.css\"></link>\n"; ?> <style type="text/css"> <!-- .code {font-family: "Courier New", Courier, Arial, mono; font-size: 12px; font-weight: bold; color: #000099; text-align: right} .explain {font-family: Tahoma, Arial, mono; font-size: 12px; font-weight: bold; color: #000000; text-align: left} .explain2 {font-family: "Courier New", Courier, Arial, mono; font-size: 12px; font-weight: bold; color: #000099; text-align: left} .mtable {border-width: 2px; border-style:outset; border-color: #eeeeee;} .small { font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 10px} --> </style> </head> <body> <center> <h2>Calendario</h2> <?php $cal->enableDatePicker(2000, 2010); $cal->enableDayLinks(); $cal->enableWeekLinks(); $cal->enableDatePicker(); $out = $cal->showMonth();
$out = "<a href=\"" . $suiteurl . "\">Check another function</a>"; $out .= "<table><tr><td bgcolor=\"#ffff99\" class=\"code\">"; $out .= "Functions <b>setEventContent(2007,1,11,\"some content\",\"" . $suiteurl . "\") + showMonth(2007,1)</b> generate the following calendar:"; $out .= "</td></tr></table><br />"; $cal = new activeCalendar(2007, 1); $cal->setEventContent(2007, 1, 11, "some content", $suiteurl); $out .= $cal->showMonth(); $out .= "<br /><a href=\"http://validator.w3.org/check?uri=referer\" target=\"_blank\">Validate this XHTML <span class=\"small\">(results in a new window)</span></a>"; echo $out; } if ($showcal == 9) { $out = "<a href=\"" . $suiteurl . "\">Check another function</a>"; $out .= "<table><tr><td bgcolor=\"#ffff99\" class=\"explain2\">"; $out .= "\$eventContent=array(\"content1\",\"content2\",\"content3\"); <br />Functions <b>setEventContent(2007,1,11,\$eventContent) + showMonth(2007,1)</b> generate the following calendar:"; $out .= "</td></tr></table><br />"; $cal = new activeCalendar(2007, 1); $eventContent = array("content1", "content2", "content3"); $cal->setEventContent(2007, 1, 11, $eventContent); $out .= $cal->showMonth(); $out .= "<br /><a href=\"http://validator.w3.org/check?uri=referer\" target=\"_blank\">Validate this XHTML <span class=\"small\">(results in a new window)</span></a>"; echo $out; } ?> <hr></hr> <table width="100%" border="0" bgcolor="#ffffff"> <tr> <td class="small" align="center"> <a href="http://freshmeat.net/redir/activecalendar/53267/url_demo/index.html" class="small">Active Calendar Class Online (documentation, demo, contact, downloads)</a> </td> </tr> <tr>
require_once "../source/activecalendar.php"; $myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css'] . "&calmode=" . @$_GET['calmode']; // the links url is this page $yearID = false; // init false to display current year $monthID = false; // init false to display current month $dayID = false; // init false to display current day extract($_GET); // get the new values (if any) of $yearID,$monthID,$dayID $arrowBack = "<img src=\"img/back.png\" border=\"0\" alt=\"<<\" />"; // use png arrow back $arrowForw = "<img src=\"img/forward.png\" border=\"0\" alt=\">>\" />"; // use png arrow forward $cal = new activeCalendar($yearID, $monthID, $dayID); if (@$_GET['calmode'] == "start") { $cal->enableDayLinks(false, "getStartDate"); } elseif (@$_GET['calmode'] == "end") { $cal->enableDayLinks(false, "getEndDate"); } elseif (@$_GET['calmode'] == "eu") { $cal->enableDayLinks(false, "getEUDate"); } elseif (@$_GET['calmode'] == "us") { $cal->enableDayLinks(false, "getUSDate"); } // enables day links with javascript function getUSDate $cal->enableMonthNav($myurl, $arrowBack, $arrowForw); // enables navigation controls $cal->setFirstWeekDay(1); // '0' -> Sunday , '1' -> Monday ?>
<?php require_once "../source/activecalendar.php"; $myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $cal = new activeCalendar("2007", "11"); $cal->setEvent("2007", "11", "17", "event"); // create a class="event" $cal->setEvent("2007", "11", "7"); // create a class="event" (defaul) $cal->setEvent("2007", "11", "20", "event", $myurl); // create a class="event" and an <a href="this_page.php"> for ($x = 27; $x <= 30; $x++) { $cal->setEvent("2007", "11", $x); } // create a class="event" from 27th till 30th ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?> " /> </head> <body> <center>
$myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $yearID = 2005; // GET variable for the year, init 2005 to display the year of the event file $monthID = 4; // GET variable for the month, init 4 to display the month of the event file $dayID = false; // GET variable for the day, init false to display current day extract($_GET); /* ******************************************************************************** Create a calendar object ******************************************************************************** */ require_once "../source/activecalendar.php"; $cal = new activeCalendar($yearID, $monthID, $dayID); /* ******************************************************************************** Read the event file and set the events ******************************************************************************** */ $filePath = "flatevents.txt"; // the path of the events flat file $divideStr = "~"; // the divider between events in the events flat file $eventID = "event"; // sets the name of the generated HTML class on the event day (css layout) $evts = eventsFromFile($filePath, $divideStr); if ($evts) { for ($x = 0; $x < count($evts); $x++) { //$cal->setEvent(@$evts[$x][0],@$evts[$x][1],@$evts[$x][2],$eventID);
/** * Returns the source-code for a calendar in the "month"-view. * * @param integer $intYear: This year will be selected. If empty it will be used the current year. * @param integer $intMonth: This month will be selected. If empty it will be used the current month. * @param integer $intDay: This day will be selected. If empty it will be used the current day. * @return strign html-source for the calendar. */ function getCalendar($intYear = 0, $intMonth = 0, $intDay = 0) { global $_ARRAYLANG; $intYear = intval($intYear); $intMonth = intval($intMonth); $intDay = intval($intDay); $objCalendar = new \activeCalendar($intYear, $intMonth, $intDay); $objCalendar->setMonthNames(explode(',', $_ARRAYLANG['TXT_BLOG_LIB_CALENDAR_MONTHS'])); $objCalendar->setDayNames(explode(',', $_ARRAYLANG['TXT_BLOG_LIB_CALENDAR_WEEKDAYS'])); $objCalendar->setFirstWeekDay(1); $objCalendar->enableMonthNav('index.php?section=Blog&cmd=search&mode=date'); $arrEntriesInPeriod = $this->getEntriesInPeriod(mktime(0, 0, 0, $intMonth, 1, $intYear), mktime(0, 0, 0, $intMonth, 31, $intYear)); if (count($arrEntriesInPeriod) > 0) { foreach ($arrEntriesInPeriod as $intTimeStamp) { $objCalendar->setEvent($intYear, $intMonth, date('d', $intTimeStamp), null, 'index.php?section=Blog&cmd=search&mode=date&yearID=' . $intYear . '&monthID=' . $intMonth . '&dayID=' . date('d', $intTimeStamp)); } } return $objCalendar->showMonth(); }
<?php require_once "../source/activecalendar.php"; $cal = new activeCalendar(); $cal->enableWeekNum("Week"); // enables week number column $cal->setFirstWeekDay(0); // '0' -> Sunday , '1' -> Monday ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?> " /> </head> <body> <center> <?php print $cal->showMonth(true); // 'true' to display no current month days as well ?> <br /> <a href="../examples.php">Back to examples.php</a> </center> </body>
require_once "../source/activecalendar.php"; $myurl = $_SERVER['PHP_SELF'] . "?css=" . @$_GET['css']; // the links url is this page $yearID = false; // init false to display current year $monthID = false; // init false to display current month $dayID = false; // init false to display current day extract($_GET); // get the new values (if any) of $yearID,$monthID,$dayID $arrowBack = "<img src=\"img/back.png\" border=\"0\" alt=\"<<\" />"; // use png arrow back $arrowForw = "<img src=\"img/forward.png\" border=\"0\" alt=\">>\" />"; // use png arrow forward $cal = new activeCalendar($yearID, $monthID, $dayID); $cal->enableYearNav($myurl, $arrowBack, $arrowForw); // enables navigation controls $cal->enableDatePicker(2000, 2010, $myurl); // enables date picker (year range 2000-2010) ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?>
<?php require_once "../source/activecalendar.php"; $cal = new activeCalendar("2007", "11"); $cal->setEventContent("2007", "11", "2", "Google", "http://www.google.com"); $cal->setEventContent("2007", "11", "12", "<img src=\"img/pager.png\" border=\"0\" alt=\"\" /> meeting"); $cal->setEventContent("2007", "11", "24", "<img src=\"img/ok.png\" border=\"0\" alt=\"\" /> birthday"); $multipleLinesEvent = array("Title: News", "Time: 16.00", "Status: ok"); for ($x = 6; $x <= 10; $x++) { $cal->setEventContent("2007", "11", $x, $multipleLinesEvent); } ?> <?php print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><title>Active Calendar Class :: Example</title> <link rel="stylesheet" type="text/css" href="<?php print @$_GET['css']; ?> " /> </head> <body> <center> <?php print $cal->showMonth(); ?> <br /> <a href="../examples.php">Back to examples.php</a>