Example #1
0
        }
        $summary = $row[1];
        $description = $hc_cfg[109] > 0 ? clean_truncate(strip_tags($row[2]), $hc_cfg[109]) . ' ' . $hc_lang_event['ReadMore'] . ' ' . CalRoot . '/?eID=' . $row[0] : $row[2];
        $location = $row[13] > 0 ? $row[24] . ' - ' . str_replace('<br />', ' ', buildAddress($row[25], $row[26], $row[27], $row[28], $row[29], $row[30])) : $row[16] . ' - ' . str_replace('<br />', ' ', buildAddress($row[17], $row[18], $row[19], $row[20], $row[21], $row[22]));
        $descFooter = "\\n______________________________\\niCalendar Feed powered by OU Calendar";
        echo "BEGIN:VEVENT\r\n";
        echo "URL;VALUE=URI:" . CalRoot . "/index.php?eID=" . $row[0] . "\r\n";
        if ($allDay == false) {
            echo "DTSTART:" . $startDate . "\r\n";
            echo "DTEND:" . $endDate . "\r\n";
        } else {
            echo "DTSTART;VALUE=DATE:" . $startDate . "\r\n";
            echo "DTEND;VALUE=DATE:" . $endDate . "\r\n";
        }
        echo "SUMMARY:" . str_replace(";", "\\;", str_replace(",", "\\,", html_entity_decode(cOut(cleanSpecialChars(strip_tags($summary)))))) . "\r\n";
        echo "DESCRIPTION:" . str_replace(";", "\\;", str_replace(",", "\\,", html_entity_decode(cOut(cleanSpecialChars(strip_tags(cleanBreaks($description))))) . $descFooter)) . "\r\n";
        echo "LOCATION:" . str_replace(";", "\\;", str_replace(",", "\\,", html_entity_decode(cOut($location)))) . "\r\n";
        echo "CATEGORIES:" . CalName . " Events\r\n";
        echo "PRIORITY:0\r\n";
        echo "TRANSP:TRANSPARENT\r\n";
        echo "END:VEVENT\r\n";
    }
    echo "END:VCALENDAR";
    fwrite($fp, ob_get_contents());
    fclose($fp);
    ob_end_clean();
}
include HCPATH . '/cache/ical' . SYSDATE;
function purge_icalendar()
{
    if (count(glob(HCPATH . '/cache/ical*')) > 0) {
Example #2
0
}
if (hasRows($result) && $myName != '' && $myEmail != '' && $friendName != '' && $friendEmail != '') {
    $message = '<p>' . cOut($sendMsg) . '</p>';
    $message .= '<p><b>' . mysql_result($result, 0, 0) . '</b><br />';
    if ($tID == 0) {
        $where = '/index.php?com=send&eID=';
        $subject = CalName . " " . $hc_lang_sendtofriend['SubjectE'] . " " . $myName;
        $message .= stampToDate(mysql_result($result, 0, 1), $hc_cfg[14]) . ' - ';
        if (mysql_result($result, 0, 3) == 0) {
            $message .= stampToDate("1980-01-01 " . mysql_result($result, 0, 2), $hc_cfg[23]);
        } elseif (mysql_result($result, 0, 3) == 1) {
            $message .= $hc_lang_sendtofriend['AllDay'];
        } elseif (mysql_result($result, 0, 3) == 2) {
            $message .= $hc_lang_sendtofriend['TBA'];
        }
        $message .= '<br /><a href="' . CalRoot . '/index.php?eID=' . $eID . '">' . CalRoot . '/index.php?eID=' . $eID . '</a></p>';
    } else {
        $where = '/index.php?com=send&lID=';
        $subject = CalName . " " . $hc_lang_sendtofriend['SubjectL'] . " " . $myName;
        $message .= buildAddress(mysql_result($result, 0, 1), mysql_result($result, 0, 2), mysql_result($result, 0, 3), mysql_result($result, 0, 4), mysql_result($result, 0, 5), mysql_result($result, 0, 6), $hc_lang_config['AddressType']);
        $message .= '<br /><a href="' . CalRoot . '/index.php?com=location&lID=' . $eID . '">' . CalRoot . '/index.php?com=location&lID=' . $eID . '</a></p>';
    }
    $message .= '<p>' . $hc_lang_sendtofriend['From'] . '<br />' . $myName . ' (' . $myEmail . ')</p>';
    $message .= '<p>' . $hc_lang_sendtofriend['AutoNotice'] . ' ' . $hc_cfg[78];
    reMail($friendName, $friendEmail, $subject, $message, $myName, $myEmail);
    doQuery("INSERT INTO " . HC_TblPrefix . "sendtofriend(MyName, MyEmail, RecipientName, RecipientEmail, Message, EntityID, IPAddress, SendDate, TypeID)\r\n\t\t\t\tValues('" . $myName . "', '" . $myEmail . "', '" . $friendName . "', '" . $friendEmail . "', '" . cleanSpecialChars(str_replace('<br>', '\\n', $message)) . "', '" . $eID . "',\r\n\t\t\t\t'" . cIn(strip_tags($_SERVER["REMOTE_ADDR"])) . "', '" . date("Y-m-d") . "', '" . $tID . "')");
    doQuery("UPDATE " . HC_TblPrefix . "events SET EmailToFriend = EmailToFriend + 1 WHERE PkID = '" . $eID . "'");
    header("Location: " . CalRoot . $where . $eID . "&msg=1");
} else {
    header("Location: " . CalRoot . "/");
}