<?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>
/** * 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(); }
$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 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']; ?> " /> <script src="functions.js" type="text/javascript" language="javascript"></script> </head>