The Spring 2007 will be available in the coming weeks.

The website links on this schedule are not affiliated with or hosted by Manhattan Neighborhood Network, therefore MNN is not responsible for their content.

We apologize but there was an error connecting to the database, the schedule can not be viewed at this time
Please try again later"; error_reporting(0); //Variables $allowed_days_in_past=14; //max days allowed in the past $allowed_days_in_future=14; //max days allowed in the future $channel = 34; //default channel $dayfromuser = time();; //Default date to display $category = ""; //Default category, blanks means all //Grab the GET variables if ($_GET['topic']) { $topic = $_GET['topic']; } if ($_GET['Date']) { $Date = $_GET['Date']; } //Build the start and end times $time = $dayfromuser; //Make sure that the start and end time do not go before or after the allow min/max times $past_time = time() - ($allowed_days_in_past * 24 * 60 * 60); $future_time = time() + ($allowed_days_in_future * 24 * 60 * 60); if ($time < $past_time OR $time > $future_time) { $time = time(); } //Grab the beginning of the day $start_time = mktime(1, 0, 0, date('m', $time),date('d', $time),date('Y', $time)); $end_time = $start_time + (24 * 60 * 60); //Build the Query $query= "SELECT schedule.project_no, project.name, project.narrative, project.runtime, schedule.channel, project.content_type_no, content_type.name, schedule.starts, project.public_email, project.public_url, project.public_contact_info FROM schedule " . "LEFT JOIN project on project.no = schedule.project_no " . "LEFT JOIN project_member on project_member.project_no = project.no AND execute_producer =TRUE " . "LEFT JOIN content_type on project.content_type_no = content_type.no " . "LEFT JOIN topic on project.topic_no = topic.no " . //We have to append 3 zeros to the unixtimestamp because Ocean 7 (developers of the database) decided to //attempt to create a to-the-millisecond unix timestamp although their implementation was very poor "WHERE schedule.starts >= ". $start_time . "000" . " AND " . " schedule.ends <= " . $end_time . "000" . " AND schedule.channel='". $channel."'"; //if there's a topic narrow search to only the topic and escape string if ($topic) { $topic = mysql_real_escape_string($topic); $query .= " AND content_type.name = '$topic' "; } if ($Date) { $Date = mysql_real_escape_string($Date); $query .= " WHERE schedule.starts >= " . '$Date' . "000"; } //**********sorts by start time************ $query .=" ORDER BY schedule.starts, schedule.channel ASC "; //Below this point output is possible so we need to create HTML tags //Add Javascript ?> = 20 ) { $minutes = "30"; } else { $minutes = "00"; } $hours = date('h', $starts); $ampm = date('a', $starts); $oSevenTime = $hours.":".$minutes.$ampm; //oSeven's the var that theme_table uses to populate the start times $row["starts"] = $oSevenTime; $row["title"] = $pgresult[1]; $row["narrative"] = $pgresult['narrative']; $row["topic"] = $pgresult[6]; $rows[] = $row; }; $schedtable = theme_table($header, $rows); //end table definition /* *******************Use forms api to create the dropdowns*************** */ //Go to Postgres and pull the various topics that are available for this date/time/channel. $sql = "SELECT content_type.name, content_type.no FROM schedule ". "LEFT JOIN project on project.no = schedule.project_no ". "LEFT JOIN content_type on project.content_type_no = content_type.no " . //Limit to only the dateselect. minding the starting and end time of the day "WHERE schedule.starts >= ". $start_time . "000" . " AND " . " schedule.ends <= " . $end_time . "000" . " AND schedule.channel='". $channel."'". //Drop the empty names " AND content_type.name <> ''" . " GROUP BY content_type.name, content_type.no ORDER BY content_type.name ASC"; $fieldset = pg_query($sql) or die($DATABASE_ERROR); //****************date selector************** //First today's date $time = time(); //max days prior to today $subtract_days = ($allowed_days_in_past * 24 * 60 * 60); $day_in_past = mktime(0,0,0, date('m', $time), date('d', $time),date('Y', $time)) - $subtract_days; //max days in the future $add_days = ($allowed_days_in_future * 24 * 60 * 60); $day_in_future = mktime(0,0,0, date('m', $time), date('d', $time),date('Y', $time)) + $add_days; //Add the Show All option $Doptions[""] = 'Show All'; //iterate to populate options array for($i = $day_in_past; $i <= $day_in_future; $i = $i + (1 * 24 * 60 * 60)) { $Doptions["?Date=".$i."000"] = t(date('D m/d/y', $i)); } $default_date = t(''); if ($Date) { $default_date = "?Date=".$i."000"; } //name the form $Dformname = "datedropdown"; $form['dates'] = array( '#type' => 'select', '#name' => "$Dformname", '#id' => "$Dformname", '#title' => t('Select a Date'), '#default_value' => $default_date, '#options' => $Doptions, '#description' => '', '#multiple' => $multiple = FALSE, '#required' => $required = FALSE, '#attributes' => array('onChange' => "top.location.href=document.getElementById('$Dformname').options[document.getElementById('$Dformname').selectedIndex].value"), # ); $date_form = drupal_get_form('$Dformname', $form); //*************topic selector************** //Add the Show All option $options[""] = 'Show All'; //Put the data into an options array while($sqlresult = pg_fetch_array($fieldset)) { $options["?topic=".$sqlresult[name]] = t($sqlresult[name]); } $default_topic = t(''); if ($topic) { $default_topic = "?topic=".$topic; } $formname = "topicdropdown"; //reset variable for use of another form $form = array(); $form['topics'] = array( '#type' => 'select', '#name' => "$formname", '#id' => "$formname", '#title' => t('Select a Topic'), '#default_value' => $default_topic, '#options' => $options, '#description' => '', '#multiple' => $multiple = FALSE, '#required' => $required = FALSE, '#attributes' => array('onChange' => "top.location.href=document.getElementById('$formname').options[document.getElementById('$formname').selectedIndex].value"), # ); $topic_form = drupal_get_form('topics', $form); //************Output************ echo $topic_form; echo $date_form; echo $schedtable; ?>