Example #1
0
function buildIt($content, $row)
{
    global $expVars, $hc_cfg, $ext, $curDate, $curCategory, $sortBy, $dateFormat;
    $built = "";
    $built = $content;
    $i = 1;
    $stop = count($expVars);
    while ($i <= $stop) {
        $replace = 'BLANK';
        switch ($expVars[$i]['tag']) {
            case '[event_time_start]':
            case '[event_time_end]':
                if ($row[$expVars[$i]['field']] != '') {
                    switch ($dateFormat) {
                        case 0:
                        case 1:
                            $timepart = explode(":", $row[$expVars[$i]['field']]);
                            $replace = strftime($hc_cfg[23], mktime($timepart[0], $timepart[1], $timepart[2]));
                            break;
                        case 2:
                            $replace = timeToAP($row[$expVars[$i]['field']]);
                            break;
                    }
                }
                break;
            case '[loc_name]':
                $replace = $row[11] == 0 ? $row[12] : $row[19];
                break;
            case '[loc_address]':
                $replace = $row[11] == 0 ? $row[13] : $row[20];
                break;
            case '[loc_address2]':
                $replace = $row[11] == 0 ? $row[14] : $row[21];
                break;
            case '[loc_city]':
                $replace = $row[11] == 0 ? $row[15] : $row[22];
                break;
            case '[loc_region]':
                $replace = $row[11] == 0 ? $row[16] : $row[23];
                break;
            case '[loc_postal]':
                $replace = $row[11] == 0 ? $row[17] : $row[24];
                break;
            case '[loc_country]':
                $replace = $row[11] == 0 ? $row[18] : $row[25];
                break;
            case '[loc_url]':
            case '[contact_url]':
                if ($row[$expVars[$i]['field']] != 'http://') {
                    $replace = $row[$expVars[$i]['field']];
                }
                break;
            case '[cal_url]':
                $replace = CalRoot;
                break;
            case '[date_series]':
                if ($row[27] != '') {
                    $replace = $row[27] != $row[28] && $row[28] != '' ? stampToDate($row[27], $hc_cfg[24]) . ' - ' . stampToDate($row[28], $hc_cfg[24]) : stampToDate($row[27], $hc_cfg[24]);
                }
                break;
            case '[event_date]':
                if ($row[$expVars[$i]['field']] != '') {
                    switch ($dateFormat) {
                        case 0:
                        case 1:
                            $timepart = explode(":", $row[$expVars[$i]['field']]);
                            $replace = $dateFormat == 0 ? stampToDate($row[$expVars[$i]['field']], $hc_cfg[14]) : stampToDate($row[$expVars[$i]['field']], $hc_cfg[24]);
                            break;
                        case 2:
                            $replace = stampToDateAP($row[$expVars[$i]['field']], 1);
                            break;
                    }
                }
                break;
            case '[date_unique]':
                if ($curDate != $row[$expVars[$i]['field']] && $row[$expVars[$i]['field']] != '') {
                    $curDate = $row[$expVars[$i]['field']];
                    $curCategory = $sortBy == 1 ? '' : $curCategory;
                    switch ($dateFormat) {
                        case 0:
                        case 1:
                            $timepart = explode(":", $row[$expVars[$i]['field']]);
                            $replace = $dateFormat == 0 ? stampToDate($row[$expVars[$i]['field']], $hc_cfg[14]) : stampToDate($row[$expVars[$i]['field']], $hc_cfg[24]);
                            break;
                        case 2:
                            $replace = stampToDateAP($row[$expVars[$i]['field']], 1);
                            break;
                    }
                }
                break;
            case '[category_unique]':
                if ($curCategory != $row[$expVars[$i]['field']]) {
                    $curCategory = $row[$expVars[$i]['field']];
                    $replace = $row[$expVars[$i]['field']];
                    $curDate = $sortBy == 0 ? '' : $curDate;
                }
                break;
            case '[desc_notags]':
                if ($row[$expVars[$i]['field']] != '') {
                    $replace = strip_tags(cleanBreaks($row[$expVars[$i]['field']]));
                }
                break;
            default:
                if ($row[$expVars[$i]['field']] != '') {
                    $replace = cleanBreaks($row[$expVars[$i]['field']]);
                }
                break;
        }
        $built = $ext == '.csv' ? str_replace($expVars[$i]['tag'], str_replace(",", "", $replace), $built) : str_replace($expVars[$i]['tag'], $replace, $built);
        ++$i;
    }
    return $built;
}
Example #2
0
"/>
	<meta property="og:type" content="article"/>
	<meta property="og:url" content="<?php 
echo cal_url() . '/index.php?com=series&amp;sID=' . $myMeta[2];
?>
"/>
	<meta property="og:image" content="<?php 
echo cal_url() . '/img/like/event.png';
?>
"/>
	<meta property="og:site_name" content="<?php 
echo cal_name();
?>
"/>
	<meta property="og:description" content="<?php 
echo str_replace('"', "'", cleanBreaks(strip_tags($myMeta[1])));
?>
"/>
</head>
<body onload="map_init()" id="top" itemscope itemtype="http://schema.org/WebPage">
	<a name="top"></a>
	<div id="fb-root"></div>
	<script>(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>
<?php 
$crumbs = array_merge(array(cal_url() . '/index.php?com=digest' => 'Home', cal_url() => 'Calendar'), $crmbAdd);
Example #3
0
"/>
	<meta property="og:type" content="article"/>
	<meta property="og:url" content="<?php 
echo cal_url() . '/index.php?com=location&lID=' . $myLoc['LocID'];
?>
"/>
	<meta property="og:image" content="<?php 
echo cal_url() . '/img/like/venue.png';
?>
"/>
	<meta property="og:site_name" content="<?php 
echo cal_name();
?>
"/>
	<meta property="og:description" content="<?php 
echo str_replace('"', "'", cleanBreaks(strip_tags($myLoc['Description'])));
?>
"/>
	<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=true"></script>
	<script>
	//<!--
	function togThis(doTog, doLink){
		if(document.getElementById(doTog).style.display == 'none'){
			document.getElementById(doTog).style.display = 'block';
			document.getElementById(doLink).innerHTML = '<?php 
echo location_lang('Less');
?>
';
		} else {
			document.getElementById(doTog).style.display = 'none';
			document.getElementById(doLink).innerHTML = '<?php 
Example #4
0
include dirname(__FILE__) . '/loader.php';
action_headers();
post_only();
include HCLANG . '/public/rsvp.php';
$proof = $challenge = '';
if ($hc_cfg[65] == 1) {
    $proof = isset($_POST['proof']) ? $_POST['proof'] : NULL;
    $challenge = isset($_SESSION['hc_cap']) ? $_SESSION['hc_cap'] : NULL;
} elseif ($hc_cfg[65] == 2) {
    $proof = isset($_POST["recaptcha_response_field"]) ? $_POST["recaptcha_response_field"] : NULL;
    $challenge = isset($_POST["recaptcha_challenge_field"]) ? $_POST["recaptcha_challenge_field"] : NULL;
}
spamIt($proof, $challenge, 3);
$eID = isset($_POST['eID']) && is_numeric($_POST['eID']) ? cIn(strip_tags($_POST['eID'])) : 0;
$regName = isset($_POST['hc_f1']) ? cIn(strip_tags(cleanBreaks($_POST['hc_f1']))) : '';
$regEmail = isset($_POST['hc_f2']) ? cIn(strip_tags(cleanBreaks($_POST['hc_f2']))) : '';
$phone = isset($_POST['hc_f3']) ? cIn(strip_tags($_POST['hc_f3'])) : '';
$address = isset($_POST['hc_f4']) ? cIn(strip_tags($_POST['hc_f4'])) : '';
$address2 = isset($_POST['hc_f5']) ? cIn(strip_tags($_POST['hc_f5'])) : '';
$city = isset($_POST['hc_f6']) ? cIn(strip_tags($_POST['hc_f6'])) : '';
$state = isset($_POST['locState']) ? cIn(strip_tags($_POST['locState'])) : '';
$country = isset($_POST['hc_f9']) ? cIn(strip_tags($_POST['hc_f9'])) : '';
$zip = isset($_POST['hc_f8']) ? cIn(strip_tags($_POST['hc_f8'])) : '';
$partySize = is_numeric($_POST['hc_f7']) ? cIn(strip_tags($_POST['hc_f7'])) + 1 : 0;
$result = doQuery("SELECT PkID FROM " . HC_TblPrefix . "registrants WHERE Email = '" . $regEmail . "' AND EventID = '" . $eID . "'");
if (hasRows($result)) {
    header("Location: " . CalRoot . "/index.php?com=rsvp&eID=" . $eID . "&msg=1");
} else {
    $result = doQuery("SELECT Title, StartDate, StartTime, TBD, ContactEmail FROM " . HC_TblPrefix . "events WHERE PkID = '" . $eID . "'");
    $eventTitle = cOut(mysql_result($result, 0, 0));
    $eventDate = stampToDate(mysql_result($result, 0, 1), $hc_cfg[14]);
Example #5
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 #6
0
post_only();
include HCLANG . '/public/send.php';
$proof = $challenge = '';
if ($hc_cfg[65] == 1) {
    $proof = isset($_POST['proof']) ? $_POST['proof'] : NULL;
    $challenge = isset($_SESSION['hc_cap']) ? $_SESSION['hc_cap'] : NULL;
} elseif ($hc_cfg[65] == 2) {
    $proof = isset($_POST["recaptcha_response_field"]) ? $_POST["recaptcha_response_field"] : NULL;
    $challenge = isset($_POST["recaptcha_challenge_field"]) ? $_POST["recaptcha_challenge_field"] : NULL;
}
spamIt($proof, $challenge, 2);
$myName = cIn(strip_tags(cleanBreaks($_POST['hc_fx1'])));
$myEmail = cIn(strip_tags(cleanBreaks($_POST['hc_fx2'])));
$friendName = cIn(strip_tags(cleanBreaks($_POST['hc_fx3'])));
$friendEmail = cIn(strip_tags(cleanBreaks($_POST['hc_fx4'])));
$sendMsg = cleanBreaks(nl2br(strip_tags($_POST['hc_fx5'])));
$eID = isset($_POST['eID']) && is_numeric($_POST['eID']) ? cIn(strip_tags($_POST['eID'])) : 0;
$tID = isset($_POST['tID']) && is_numeric($_POST['tID']) ? cIn(strip_tags($_POST['tID'])) : 0;
if ($tID == 0) {
    $result = doQuery("SELECT Title, StartDate, StartTime, TBD FROM " . HC_TblPrefix . "events WHERE PkID = '" . $eID . "'");
} else {
    $result = doQuery("SELECT Name, Address, Address2, City, State, Zip, Country FROM " . HC_TblPrefix . "locations WHERE PkID = '" . $eID . "'");
}
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) {
Example #7
0
/**
 * @package Helios Calendar
 * @license GNU General Public License version 2 or later; see LICENSE
 */
define('isHC', true);
define('isAction', true);
include '../loader.php';
include HCPATH . HCINC . '/functions/api.php';
include_once HCLANG . '/public/api.php';
define('APIVersion', "{$hc_cfg['133']}");
header('content-type: text/plain; charset=' . $hc_lang_config['CharSet']);
api_active();
$user = isset($_GET['u']) ? utf8_decode(cIn(htmlspecialchars(strip_tags(cleanBreaks($_GET['u']))))) : '';
$key = isset($_GET['k']) ? cIn(htmlspecialchars(strip_tags(cleanBreaks($_GET['k'])))) : '';
$api_type = isset($_GET['data']) ? cIn(htmlspecialchars(strip_tags(cleanBreaks($_GET['data'])))) : '';
$api_data = api_user_authenticate($user, $key);
if ($api_data == '') {
    switch ($api_type) {
        case 'events_c':
            $api_data = api_get_events(1);
            break;
        case 'events_b':
            $api_data = api_get_events(2);
            break;
        case 'events_p':
            $api_data = api_get_events(3);
            break;
        case 'events_n':
            $api_data = api_get_events(4);
            break;
Example #8
0
/**
 * Include theme header file (header.php)
 * @since 2.0.0
 * @version 2.0.0
 * @param string $title [optional] page title (only used for location & event page, all other pages use SEO settings)
 * @param string $desc [optional] meta tag description (only used for location & event page, all other pages use SEO settings)
 * @return void
 */
function get_header()
{
    global $eID, $sID, $lID, $hc_meta, $meta, $hc_lang_core, $title, $desc;
    switch (HCCOM) {
        case 'searchresult':
        case 'newsletter':
        case 'archive':
        case 'tools':
        case 'signup':
        case 'filter':
        case 'search':
        case 'submit':
        case 'digest':
        case 'signin':
        case 'acc':
            $meta = array_map('cOut', $hc_meta[HCCOM]);
            break;
        case 'send':
            $meta = array_map('cOut', $hc_meta[HCCOM]);
            $meta['title'] .= $title;
            break;
        case 'rsvp':
            $meta = array_map('cOut', $hc_meta[HCCOM]);
            $meta['title'] .= $title;
            break;
        case 'edit':
            $meta = array_map('cOut', $hc_meta['signup']);
            break;
        case 'location':
            array_map('cOut', $hc_meta[2]);
            if ($lID > 0) {
                $meta = array('title' => strip_tags($title), 'keywords' => $hc_meta[2]['keywords'], 'desc' => str_replace('"', "'", cleanBreaks(strip_tags($desc))));
            } else {
                $meta = $hc_meta[2];
            }
            break;
        case 'serieslist':
        case 'detail':
        default:
            array_map('cOut', $hc_meta[1]);
            if ($eID > 0 || $sID != '') {
                $meta = array('title' => strip_tags($title), 'keywords' => $hc_meta[1]['keywords'], 'desc' => str_replace('"', "'", cleanBreaks(strip_tags($desc))));
            } else {
                $meta = $hc_meta[1];
            }
    }
    if (!file_exists(HCPATH . '/themes/' . $_SESSION['Theme'] . '/header.php')) {
        echo '<b>' . $_SESSION['Theme'] . '</b> ' . $hc_lang_core['Missing'] . ' <i>header.php</i>';
        exit(-1);
    }
    include_once HCPATH . '/themes/' . $_SESSION['Theme'] . '/header.php';
}
Example #9
0
/**
 * Generate and send new/updated public event submission notice email to subscribed admin users.
 * @since 2.2.0
 * @version 2.2.0
 * @param string $subName Name of event submitter
 * @param string $subEmail Email address of event submitter
 * @param string $adminMessage Message to admin user from event submitter
 * @param integer $locID Location ID
 * @param string $locName Location Name
 * @param string $locAddress Location Address
 * @param string $locAddress2 Location Address Extra Line
 * @param string $locCity Location City
 * @param string $locState Location State
 * @param string $locCountry Location Country
 * @param string $locZip Location Zip
 * @param string $eventTitle Submitted Event Title
 * @param string $eventDesc Submitted Event Description
 * @param string $eventDates String describing date range
 * @param integer $occurs Number of event occurrences
 * @return void
 */
function notice_public_event($subName, $subEmail, $adminMessage, $locID, $locName, $locAddress, $locAddress2, $locCity, $locState, $locCountry, $locZip, $eventTitle, $eventDesc, $eventDates, $occurs)
{
    global $hc_cfg, $hc_lang_config, $hc_lang_submit;
    $resultE = doQuery("SELECT a.FirstName, a.LastName, a.Email\r\n\t\t\t\t\t\tFROM " . HC_TblPrefix . "adminnotices n\r\n\t\t\t\t\t\t\tLEFT JOIN " . HC_TblPrefix . "admin a ON (n.AdminID = a.PkID)\r\n\t\t\t\t\t\tWHERE a.IsActive = 1 AND n.IsActive = 1 AND n.TypeID = 0");
    if (hasRows($resultE)) {
        $toNotice = array();
        while ($row = mysql_fetch_row($resultE)) {
            $toNotice[trim($row[0] . ' ' . $row[1])] = $row[2];
        }
        $user_level = isset($_SESSION['UserLevel']) ? cIn($_SESSION['UserLevel']) : 0;
        $subject = $hc_lang_submit['NoticeSubject'] . ' - ' . CalName;
        $message = '<p>' . $hc_lang_submit['NoticeEmail1'] . '</p>
<p>
	<b>' . $hc_lang_submit['NoticeEmail2'] . '</b> ' . $subName . ' - ' . $subEmail . '<br />
	<b>' . $hc_lang_submit['NoticeEmail5'] . '</b> ' . $hc_lang_submit['NoticeEmail5' . $user_level] . '<br />
	<b>' . $hc_lang_submit['NoticeEmail3'] . '</b> ' . strip_tags($_SERVER['REMOTE_ADDR']) . '
</p>
';
        $message .= $adminMessage != '' ? '<p><b>' . $hc_lang_submit['NoticeEmail4'] . '</b> ' . cOut(str_replace('<br />', ' ', strip_tags(cleanBreaks($adminMessage), '<br>'))) . '</p>' : '';
        $message .= '
<p>
';
        if ($locID == 0) {
            $message .= $locName . ', ';
            $message .= str_replace('<br />', ' ', strip_tags(buildAddress($locAddress, $locAddress2, $locCity, $locState, $locZip, $locCountry, $hc_lang_config['AddressType']), '<br>'));
        } else {
            $result = doQuery("SELECT Name, Address, Address2, City, State, Country, Zip FROM " . HC_TblPrefix . "locations WHERE PkID = '" . cIn($locID) . "'");
            $message .= mysql_result($result, 0, 0) . ', ';
            $message .= str_replace('<br />', ' ', strip_tags(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']), '<br>'));
        }
        $message .= '
</p>
<p>
	<b>' . $hc_lang_submit['EventTitle'] . '</b> ' . cOut($eventTitle) . '<br />
	' . ($occurs > 0 ? '<b>' . $hc_lang_submit['Occurs'] . '</b> ' . cOut($eventDates) . ' (x' . $occurs . ')<br />' : '') . '
</p>
<p>' . cOut(strip_tags($eventDesc)) . '</p>
<p><a href="' . AdminRoot . '">' . AdminRoot . '</a></p>';
        reMail('', $toNotice, $subject, $message);
    }
}
Example #10
0
            $startTimeMins = date("i", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10)));
            $startTimeAMPM = date("A", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10)));
            if (mysql_result($result, 0, 12) != '') {
                $endTimeHour = date($hc_time['format'], strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 12)));
                $endTimeMins = date("i", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 12)));
                $endTimeAMPM = date("A", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 12)));
            } else {
                $endTimeHour = date($hc_time['format'], strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10) . ' +1 hour'));
                $endTimeAMPM = date("A", strtotime(mysql_result($result, 0, 9) . ' ' . mysql_result($result, 0, 10) . ' +1 hour'));
                $noEndTime = 1;
            }
        }
        $stime_disabled = $tbd > 0 ? ' disabled="disabled"' : '';
        $etime_disabled = isset($noEndTime) || $tbd > 0 ? ' disabled="disabled"' : '';
        $emailAccept = cleanBreaks('<p>' . $subName . ',</p>' . $hc_cfg[3]);
        $emailDecline = cleanBreaks('<p>' . $subName . ',</p>' . $hc_cfg[4]);
        appInstructions(0, "Pending_Events", $hc_lang_event['TitlePendingB'], $hc_lang_event['InstructPendingB']);
        if ($followup == 0) {
            $hc_Side[] = array('javascript:;', 'followup.png', $hc_lang_core['LinkFollow'], 0, 'follow_up();');
        }
        echo '
			<form name="frmEventApprove" id="frmEventApprove" method="post" action="' . AdminRoot . '/components/EventPendingAction.php" onsubmit="return validate();">';
        set_form_token();
        echo '
			<input type="hidden" name="eID" id="eID" value="' . $eID . '" />
			<input type="hidden" name="sID" id="sID" value="' . $series . '" />
			<input type="hidden" name="fID" id="fID" value="' . $fID . '" />
			<input type="hidden" name="editString" id="editString" value="' . $editString . '" />
			<input type="hidden" id="locPreset" name="locPreset" value="' . $locID . '" />
			<input type="hidden" id="locPresetName" name="locPresetName" value="' . $locName . '" />
			<input type="hidden" name="prevStatus" id="prevStatus" value="' . $eventStatus . '" />