public static function search_dates($option) { $offset = self::$options[$option]["offset"]; $time = time(); $day1 = day_info($time); if (is_int($offset)) { $day2 = day_info($time, $offset); if ($offset > 0) { return array("start" => $day1['gdate'], "end" => $day2['date']); } else { return array("start" => $day2['gdate'], "end" => $day1['date']); } } else { switch ($offset) { case "term": if ($day1['month_num'] < 7) { $end_date = "{$day1['year']}-07-01"; } else { $end_date = "{$day1['year']}-12-31"; } break; case "year": if ($day1['month_num'] < 7) { $end_date = "{$day1['year']}-07-01"; } else { $year = $day1['year'] + 1; $end_date = "{$year}-07-01"; } break; } return array("start" => $day1['gdate'], "end" => $end_date); } }
<?php /** * Copyright (c) 2008 Massachusetts Institute of Technology * * Licensed under the MIT License * Redistributions of files must retain the above copyright notice. * */ // various copy includes require_once "../../config.gen.inc.php"; require_once "data/data.inc.php"; // records stats require_once "../page_builder/page_header.php"; //defines all the variables related to being today require_once "lib/calendar.lib.php"; require_once "lib/textformat.lib.php"; $today = day_info(time()); $search_options = SearchOptions::get_options(); require "templates/{$prefix}/index.html"; $page->output();
* */ // various copy includes require_once "../../config.gen.inc.php"; require_once "data/data.inc.php"; // records stats require_once "../page_builder/page_header.php"; // sets up google calendar classes require_once "lib/google_calendar.init.php"; // defines all the variables related to being today require_once "lib/calendar.lib.php"; require_once "lib/textformat.lib.php"; $time = $_REQUEST['time']; $current = day_info($time); $next = day_info($time, 1); $prev = day_info($time, -1); $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar $client = Zend_Gdata_ClientLogin::getHttpClient($username . '@gmail.com', $password, $service); $gdataCal = new Zend_Gdata_Calendar($client); $query = $gdataCal->newEventQuery(); $query->setUser($calendars['all']['user']); $query->setVisibility('private'); $query->setProjection('full'); $query->setOrderby('starttime'); $query->setSortorder('a'); $query->setStartMin($current['gdate']); $query->setStartMax($next['gdate']); $query->setmaxresults('30'); $error = false; try {