8,10d7
< $emailto = "";
< $interactive = true;
< $posttz = ",";
147c144
< input { width:35%; }
---
> input { width:30%; }
171c168
< alert(tdd.options[tdd.selectedIndex].title);
---
> //alert(tdd.options[tdd.selectedIndex].title);
251c248
<
---
>
259c256
<
---
>
261c258
< Subtitle:
---
> Address:
263d259
< :
265a262
> Subtitle:
267c264
<
---
>
276c273
< } else { // filled in form
---
> } else {
302,310d298
< if (isset($_GET['emode'])) {
< if (strpos(urldecode($_GET['emode']), "To") !== false) {
< //echo "99huh";
< if (urldecode($_GET['emode']) == "To") $interactive = false;
< if (strpos(urldecode($_GET['address']), "@") !== false && strpos(urldecode($_GET['address']), " ") === false) {
< $emailto = urldecode($_GET['address']);
< }
< }
< }
321,329d308
< if (isset($_POST['emode'])) {
< if (strpos(urldecode($_POST['emode']), "To") !== false) {
< //echo "979huh";
< if (urldecode($_POST['emode']) == "To") $interactive = false;
< if (strpos(urldecode($_POST['address']), "@") !== false && strpos(urldecode($_POST['address']), " ") === false) {
< $emailto = urldecode($_POST['address']);
< }
< }
< }
349c328
< global $start_end_offsets, $posttz;
---
> global $start_end_offsets;
357c336
< $posttz=urldecode($_GET['tz']);
---
> $posttz=$_GET['tz'];
359c338
< $posttz=urldecode($_POST['tz']);
---
> $posttz=$_POST['tz'];
361,362c340,341
< if (strpos(($posttz), ",") !== false) {
< $ourtzs=explode(",", ($posttz));
---
> if (strpos(urldecode($posttz), ",") !== false) {
> $ourtzs=explode(",", urldecode($posttz));
394,400c373
< if (strpos($di, ".25") !== false) {
< $parsed_date->sub(new DateInterval(explode(".",$di)[0] . "H"));
< $parsed_date->sub(new DateInterval("PT15M"));
< } else if (strpos($di, ".75") !== false) {
< $parsed_date->sub(new DateInterval(explode(".",$di)[0] . "H"));
< $parsed_date->sub(new DateInterval("PT45M"));
< } else if (strpos($di, ".") !== false) {
---
> if (strpos($di, ".") !== false) {
404,407d376
< // if (strpos($_GET['tz'], "Perth") !== false) {
< // echo $event['datestart'] . " " . $ts . " " . $_GET['tz'] . " " . $thisi . " " . $start_end_offsets[$thisi] . " " . $di;
< // exit;
< // }
414,420c383
< if (strpos($di, ".25") !== false) {
< $parsed_date->add(new DateInterval(explode(".",$di)[0] . "H"));
< $parsed_date->add(new DateInterval("PT15M"));
< } else if (strpos($di, ".75") !== false) {
< $parsed_date->add(new DateInterval(explode(".",$di)[0] . "H"));
< $parsed_date->add(new DateInterval("PT45M"));
< } else if (strpos($di, ".") !== false) {
---
> if (strpos($di, ".") !== false) {
437,442d399
< $proposed_url='http://www.rjmprogramming.com.au/PHP/ics_attachment.php?msg=' . $event['id'];
< if (isset($_POST['url'])) {
< if (strpos(urldecode($_POST['url']), "http") !== false) $proposed_url=urldecode($_POST['url']);
< } else if (isset($_GET['url'])) {
< if (strpos(urldecode($_GET['url']), "http") !== false) $proposed_url=urldecode($_GET['url']);
< }
454c411
< URL;VALUE=URI:' . $proposed_url . '
---
> URL;VALUE=URI:http://www.rjmprogramming.com.au/PHP/ics_attachment.php?msg=' . $event['id'] . '
462,516c419,422
< if ($event['id'] >= 0) {
< if ($emailto != "") {
< $eol = PHP_EOL;
< $headers = 'From: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
< $headers .= 'Reply-To: ' . 'rmetcalfe@rjmprogramming.com.au' . $eol;
<
< $filename="rjmprogramming-event.ics";
< if (strpos($posttz,",") === false) $posttz='' . $start_end_offsets[1] . ',' . $posttz;
< $subject = $event['title'] . ' ... ' . $event['address'] . ' ... Calendar Start: ' . $event['datestart'] . ' ' . str_replace('() ',' ','(' . explode(',',($posttz . ','))[0] . ') ') . ' End: ' . $event['dateend'] . ' ' . str_replace('()','','(' . explode(',',($posttz . ','))[1] . ')');
< $content = chunk_split(base64_encode($ical));
< //$uid = md5(uniqid(time()));
<
< // a random hash will be necessary to send mixed content
< $separator = md5(time());
<
< $headers .= "MIME-Version: 1.0" . $eol;
< $headers .= "Content-Type: multipart/mixed; boundary=\"" . $separator . "\"" . $eol . $eol;
< $headers .= "Content-Transfer-Encoding: 7bit" . $eol;
< $headers .= "This is a MIME encoded message." . $eol . $eol;
<
< // message
< $headers .= "--" . $separator . $eol;
< $headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"" . $eol;
< $headers .= "Content-Transfer-Encoding: 8bit" . $eol . $eol;
<
< $headers .= "Please see attachment below:" . $eol . $eol;
<
< //ourpremail($tem, $mysubject, "", $headers . "--" . $separator . "--");
<
< // attachment
< $headers .= "--" . $separator . $eol;
< //$headers .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"" . $eol;
< $headers .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"" . $eol;
< $headers .= "Content-Transfer-Encoding: base64" . $eol;
< $headers .= "Content-Disposition: attachment;filename=\"" . $filename . "\"" . $eol;
< $headers .= $content . $eol . $eol;
<
< $headers .= "--" . $separator . "--";
<
< mail($emailto, $subject, "", $headers);
< }
< if ($interactive) {
< header('Content-type: text/calendar; charset=utf-8');
< header('Content-Disposition: attachment; filename=rjmprogramming-event.ics');
< echo $ical;
< } else if ($emailto == "") { // for debugging purposes
< header('Content-type: text/html; charset=utf-8');
< header('Content-Disposition: attachment; filename=rjmprogramming-event.html');
< echo "
<
<
< Calendar *.ics file creation - RJM Programming - November, 2016
<
< " . $ical . "
";
< }
---
> if ($event['id']) {
> header('Content-type: text/calendar; charset=utf-8');
> header('Content-Disposition: attachment; filename=rjmprogramming-event.ics');
> echo $ical;