# Exponent is free software; you can redistribute # it and/or modify it under the terms of the GNU # General Public License as published by the Free # Software Foundation; either version 2 of the # License, or (at your option) any later version. # # GPL: http://www.gnu.org/licenses/gpl.txt # ################################################## /** @define "BASE" "../../.." */ if (!defined('EXPONENT')) { exit(''); } //filter the message thru the form template for formatting $msgtemplate = new formtemplate('forms/calendar', '_' . $_POST['formname']); $msgtemplate->assign('post', $_POST); $msg = $msgtemplate->render(); $ret = false; //make sure this is from a valid event and that the email addresses are listed, then mail if (isset($_POST['id'])) { $event = $db->selectObject('calendar', 'id=' . intval($_POST['id'])); $email_addrs = array(); if ($event->feedback_email != '') { $email_addrs = explode(',', $event->feedback_email); //This is an easy way to remove duplicates $email_addrs = array_flip(array_flip($email_addrs)); $email_addrs = array_map('trim', $email_addrs); $ret = 0; $mail = new expMail(); $ret += $mail->quickSend(array("text_message" => $msg, 'to' => $email_addrs, 'from' => trim(SMTP_FROMADDRESS), 'subject' => $_POST['subject'])); }
//get interger for hour of time returned from strtime, which should take DST from locale into consideration, //(so our data should be portable). If they are off, then create the adjustment +/- and correct //eventstart and eventend $timeHourStart = intval($item->eventstart / 3600); $strHourStart = intval(strftime("%H", $eventdate->date + $item->eventstart)); $timeHourEnd = intval($item->eventend / 3600); $strHourEnd = intval(strftime("%H", $eventdate->date + $item->eventend)); $adjustStart = ($timeHourStart - $strHourStart) * 3600; //could be + or - or 0 (most of the time); $adjustEnd = ($timeHourEnd - $strHourEnd) * 3600; //could be + or - or 0 (most of the time); $item->eventstart += $eventdate->date + $adjustStart; $item->eventend += $eventdate->date + $adjustEnd; $template = new template("calendarmodule", "_view", $loc); if ($item->feedback_form != "") { $formtemplate = new formtemplate('email', $item->feedback_form); $formtemplate->assign('formname', $item->feedback_form); $formtemplate->assign('module', 'calendarmodule'); $formtemplate->assign('loc', $loc); $formtemplate->assign('action', 'send_feedback'); $formtemplate->assign('id', $item->id); $form = $formtemplate->render(); $template->assign('form', $form); } $template->assign("item", $item); $template->assign("directory", "files/calendarmodule/" . $loc->src); $template->register_permissions(array("post", "edit", "delete", "administrate", "manage_approval"), $loc); $template->output(); } else { echo SITE_404_HTML; }