if (isset($_GET['q'])) { $calendarArgs['query'] = filter_var($_GET['q'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_ENCODE_HIGH); } // Did the user specify a category? if (isset($_GET['c'])) { $calendarArgs['category'] = filter_var($_GET['c'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_ENCODE_HIGH); } // If a date and/or mode were given, validate them. if (isset($_GET['date']) && preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/', $_GET['date'])) { $calendarArgs['date'] = $_GET['date']; } if (isset($_GET['mode']) && in_array($_GET['mode'], array('day', 'week', 'month', 'index'))) { $calendarArgs['mode'] = $_GET['mode']; } // Initialize the calendar class. $cal = new UniversityCalendar($calendarArgs); // Did the user specify the bounds? if (isset($_GET['s']) && filter_var($_GET['s'], FILTER_VALIDATE_INT, array('options' => array('min_range' => 0)))) { $feedArgs['limitStart'] = $_GET['s']; } if (isset($_GET['e']) && filter_var($_GET['e'], FILTER_VALIDATE_INT, array('options' => array('min_range' => 1)))) { $feedArgs['limitEnd'] = $_GET['e']; } // Only show featured events? if (isset($_GET['featured'])) { $feedArgs['showFeatured'] = filter_var($_GET['featured'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); } // Should we display full descriptions? if (isset($_GET['fulldesc'])) { $feedArgs['showFullDesc'] = filter_var($_GET['fulldesc'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); }
<?php session_start(); require_once 'lib/university_calendar.php'; // Initiate the calendar. $cal = new UniversityCalendar(array()); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Millersville University - Events Calendar</title> <meta content="text/html; charset=UTF-8" http-equiv="Content-type"/> <meta content="en-us" http-equiv="Content-Language"/> <meta content="calendar, millersville university" name="keywords"/> <meta content="Events Calendar" name="description"/> <link href="../lib/css/core.2.1.css" media="all" rel="stylesheet" type="text/css"/> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/redmond/jquery-ui.css" media="screen" rel="stylesheet" type="text/css"/> <link href="lib/calendar.css" media="screen, print" rel="stylesheet" type="text/css"/> <style media="screen, print" type="text/css"> #event-request-form label { overflow: visible; } .tooltip { background-color: #005f9b; border-radius: 3px; -moz-border-radius: 3px;
$args['pathToCalendar'] = $_SERVER['DOCUMENT_ROOT'] . '/fornathan/calendar/'; // Grab the query and category parameters and run some sanitization (i.e. remove tags and encode special characters). $args['query'] = isset($_GET['q']) ? filter_var($_GET['q'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_ENCODE_HIGH) : ''; $args['category'] = isset($_GET['c']) ? filter_var($_GET['c'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_ENCODE_HIGH) : ''; // Was a date and/or mode specified? if (!isset($_GET['date']) && !isset($_GET['mode'])) { $args['date'] = $time_now; $args['mode'] = 'index'; } else { // If a date and/or mode were given, validate them. $args['date'] = isset($_GET['date']) && preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/', $_GET['date']) ? $_GET['date'] : $time_now; $args['mode'] = isset($_GET['mode']) && in_array($_GET['mode'], array('day', 'week', 'month', 'index')) ? $_GET['mode'] : 'month'; } // Initiate the calendar. $cal_data = array('query' => $args['query'], 'category' => $args['category'], 'date' => $args['date'], 'mode' => $args['mode']); $cal = new UniversityCalendar($args); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Millersville University - University Calendar</title> <meta content="text/html; charset=UTF-8" http-equiv="Content-type"/> <meta content="en-us" http-equiv="Content-Language"/> <meta content="calendar, millersville university" name="keywords"/> <meta content="Events Calendar" name="description"/> <link href="../lib/css/core.2.1.css" media="all" rel="stylesheet" type="text/css"/> <link href="lib/calendar.css" media="screen, print" rel="stylesheet" type="text/css"/>
// If a date was specified, there is a potential it may be from another year, // so we need to override the _SESSION date. if (isset($_GET['date'])) { $time_now = getdate(); $time_now = mktime(0, 0, 0, $time_now['mon'], $time_now['mday'], $time_now['year']); $args['date'] = preg_match('/^[0-9]{2}-[0-9]{2}-[0-9]{4}$/', $_GET['date']) ? $_GET['date'] : $time_now; } else { // Try to grab the date that the user was looking prior to getting here. // This will help us search the appropriate XML file. preg_match('/date=([0-9]{2}-[0-9]{2}-[0-9]{4})/', $_SESSION['QUERY_STRING'], $matches); $args['date'] = $matches[1]; } require_once 'lib/university_calendar.php'; $args['urlToCalendar'] = 'http://www.millersville.edu/calendar/'; $args['pathToCalendar'] = $_SERVER['DOCUMENT_ROOT'] . '/calendar/'; $cal = new UniversityCalendar($args); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Millersville University - University Calendar Event Details</title> <meta content="text/html; charset=UTF-8" http-equiv="Content-type"/> <meta content="en-us" http-equiv="Content-Language"/> <meta content="calendar, millersville university" name="keywords"/> <meta content="Events Calendar" name="description"/> <link href="../lib/css/core.2.1.css" media="all" rel="stylesheet" type="text/css"/>