Example #1
0
/**
 * Output event browse navigation links & event list by date.
 * @since 2.0.0
 * @version 2.1.0
 * @param integer $show_images Include event images with browse output. 0 = Do NOT include images, 1 = Include images. (Default: 0)
 * @param string $nav_function [optional] Browse Navigation function to use. (Default: event_browse_bs_nav)
 * @return void
 */
function event_browse_bs($show_images = 0)
{
    global $lID, $hc_cfg, $hc_lang_event, $favQ1, $favQ2, $resultEB, $mybsNav;
    $location = $lID > 0 ? '&lID=' . $lID : '';
    $cnt = $date = 0;
    echo $mybsNav;
    if (!hasRows($resultEB)) {
        no_event_notice();
        return 0;
    }
    while ($row = mysql_fetch_row($resultEB)) {
        $limit = $row[8] > 0 ? cOut($row[8]) : $hc_cfg[134];
        $expire = $limit > 0 ? date("Y-m-d", strtotime($date) + $limit * 86400) : '';
        $eID = $row[0];
        if ($row[7] > 0) {
            $cls = ' panel-primary';
        } else {
            $cls = ' panel-default';
        }
        $desc = $row[20];
        $desc = strip_tags(html_entity_decode($desc));
        //$desc = preg_replace("/<img[^>]+\>/i", "", $desc);
        //$desc = preg_replace('~</?p[^>]*>~i','', $desc);
        $desc = strlen($desc) >= $hc_cfg[107] ? clean_truncate($desc, $hc_cfg[107]) : $desc;
        $marker = $row[14];
        $marker = $row[14] != '' ? '<a href="' . CalRoot . '/index.php?com=location&amp;lID=' . $row[9] . '"><span class="pull-right"><i class="fa  fa-map-marker"></i> ' . $row[14] . '</span></a>' : $marker;
        if ($row[5] == 0) {
            $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
            $time .= $row[4] != '' ? ' - ' . stampToDate($row[4], $hc_cfg[23]) : '';
            $stamp = date("Y-m-d\\Th:i:00", strtotime($row[2] . trim(' ' . $row[3]))) . HCTZ;
        } else {
            $time = $row[5] == 1 ? $hc_lang_event['AllDay'] : $hc_lang_event['TBA'];
            $stamp = date("Y-m-d", strtotime($row[2]));
        }
        echo '
			<div class="panel' . $cls . ' event-item">
			<div class="panel-heading"><h4 class="panel-title"><a itemprop="url" href="' . CalRoot . '/index.php?eID=' . $row[0] . $location . '"' . ($expire <= SYSDATE ? ' rel="nofollow"' : '') . '><span itemprop="name">' . cOut($row[1]) . '</span></a><span class="badge pull-right">' . stampToDate($row[2], $hc_cfg[14]) . '</span></h4></div>
			<div ' . ($cls != '' ? 'class="panel-body ' . trim($cls) . '" ' : '') . 'itemscope itemtype="http://schema.org/Event">
				' . ($show_images == 1 && $row[6] != '' ? ' <a itemprop="url" href="' . CalRoot . '/index.php?eID=' . $row[0] . $location . '"' . ($expire <= SYSDATE ? ' rel="nofollow"' : '') . '>
				<img alt="' . cOut($row[1]) . '" itemprop="image" src="' . $row[6] . '" class="img-thumbnail pull-left" /></a>' : '') . '
				<p>' . $desc . '</p><div>';
        cat_buttons($row[0]);
        echo '</div></div>				
			<div class="panel-footer panel-info"><time itemprop="startDate" datetime="' . $stamp . '">' . $time . '</time>' . $marker . '</div>
			</div>';
        ++$cnt;
    }
    echo $mybsNav;
}
Example #2
0
function sr_event_browse($show_images = 0)
{
    global $lID, $hc_cfg, $hc_lang_event, $favQ1, $favQ2, $resultEB, $myNav;
    $location = $lID > 0 ? '&amp;lID=' . $lID : '';
    $cnt = $date = 0;
    $row_number = 1;
    echo $myNav;
    if (!hasRows($resultEB)) {
        no_event_notice();
        return 0;
    }
    while ($row = mysql_fetch_row($resultEB)) {
        //echo print_r($row);
        $color_class = sr_colorizer($row_number);
        $description = $hc_cfg[107] > 0 ? clean_truncate($row[21], $hc_cfg[107]) : $row[21];
        $categories = explode(",", $row[20]);
        //filtering out ACE
        switch (count($categories)) {
            case 0:
                $category = 'No Category';
                break;
            case 1:
                $category = substr($categories[0], 3);
                break;
            default:
                $category = substr($categories[0], -4) != '_ACE' ? substr($categories[0], 3) : substr($categories[1], 3);
                break;
        }
        $category = '<h4>' . $category . '</h4>';
        if ($date != $row[2]) {
            $date = $row[2];
            echo $cnt > 0 ? '</ul>' : '';
            echo '<h2>' . stampToDate($row[2], '%A, %B %d, %Y') . '</h2><ul>';
            $cnt = 1;
        }
        $limit = $row[8] > 0 ? cOut($row[8]) : $hc_cfg[134];
        $expire = $limit > 0 ? date("Y-m-d", strtotime($date) + $limit * 86400) : '';
        $cls = $cnt % 2 == 0 ? 'hl' : '';
        $cls .= $row[7] > 0 ? ' featured' : '';
        if ($row[5] == 0) {
            $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
            $time .= $row[4] != '' ? ' - ' . stampToDate($row[4], $hc_cfg[23]) : '';
            //$stamp = date("Y-m-d\Th:i:00",strtotime($row[2] . trim(' '.$row[3]))) . HCTZ;
            $stamp = stampToDate($row[2], '%A, %B %d');
            //$hc_cfg[14]
        } else {
            $time = $row[5] == 1 ? $hc_lang_event['AllDay'] : $hc_lang_event['TBA'];
            $stamp = $row[2];
            $stamp = stampToDate($row[2], '%A, %B %d');
        }
        echo '
        <li ' . ($cls != '' ? 'class="' . $color_class . ' ' . trim($cls) . '" ' : 'class="' . $color_class . '"') . 'itemscope itemtype="http://schema.org/Event">
            <a href="' . CalRoot . '/index.php?eID=' . $row[0] . $location . '">' . '<div class="event-content-container">' . $category . '<h3 itemprop="name">' . cOut($row[1]) . '</h3><div class="date-time">
            <span itemprop="startDate" datetime="' . $stamp . '">' . $stamp . ', ' . $time . '</span>
            <span class="location"><i class="fa fa-map-marker"></i> ' . $row[14] . ($row[22] != '' ? ' - ' . $row[22] : '') . '</span></div><p>' . strip_tags(cOut($description)) . '<span class="readmore">&nbsp;READ MORE</span></p></div>' . ($show_images == 1 && $row[6] != '' ? '<div class="event-image-container" style="background-image: url(' . $row[6] . '); min-width:' . (strlen($row[1]) > 43 ? 325 : 287) . 'px;"></div>' : '') . '</a></li>';
        //'<span class="readmore">&nbsp;READ MORE</span></p></div>'.(($show_images == 1 && $row[6] != '') ? '<div class="event-image-container"><img itemprop="image" src="'.$row[6].'" class="eimage_b" /></div>':'').'</a></li>'
        ++$cnt;
        ++$row_number;
    }
    echo '
        </ul>
    ' . $myNav;
}
Example #3
0
/**
 * Output event browse navigation links & event list by date.
 * @since 2.0.0
 * @version 2.1.0
 * @param integer $show_images Include event images with browse output. 0 = Do NOT include images, 1 = Include images. (Default: 0)
 * @param string $nav_function [optional] Browse Navigation function to use. (Default: event_browse_nav)
 * @return void
 */
function event_browse($show_images = 0)
{
    global $lID, $hc_cfg, $hc_lang_event, $favQ1, $favQ2, $resultEB, $myNav;
    $location = $lID > 0 ? '&amp;lID=' . $lID : '';
    $cnt = $date = 0;
    echo $myNav;
    if (!hasRows($resultEB)) {
        no_event_notice();
        return 0;
    }
    while ($row = mysql_fetch_row($resultEB)) {
        if ($date != $row[2]) {
            $date = $row[2];
            echo $cnt > 0 ? '
			</ul>' : '';
            echo '
			<header>' . stampToDate($row[2], $hc_cfg[14]) . '</header>
			<ul>';
            $cnt = 1;
        }
        $limit = $row[8] > 0 ? cOut($row[8]) : $hc_cfg[134];
        $expire = $limit > 0 ? date("Y-m-d", strtotime($date) + $limit * 86400) : '';
        $cls = $cnt % 2 == 0 ? 'hl' : '';
        $cls .= $row[7] > 0 ? ' featured' : '';
        if ($row[5] == 0) {
            $time = $row[3] != '' ? stampToDate($row[3], $hc_cfg[23]) : '';
            $time .= $row[4] != '' ? ' - ' . stampToDate($row[4], $hc_cfg[23]) : '';
            $stamp = date("Y-m-d\\Th:i:00", strtotime($row[2] . trim(' ' . $row[3]))) . HCTZ;
        } else {
            $time = $row[5] == 1 ? $hc_lang_event['AllDay'] : $hc_lang_event['TBA'];
            $stamp = date("Y-m-d", strtotime($row[2]));
        }
        echo '
			<li ' . ($cls != '' ? 'class="' . trim($cls) . '" ' : '') . 'itemscope itemtype="http://schema.org/Event">
				<time itemprop="startDate" datetime="' . $stamp . '">' . $time . '</time><a itemprop="url" href="' . CalRoot . '/index.php?eID=' . $row[0] . $location . '"' . ($expire <= SYSDATE ? ' rel="nofollow"' : '') . '><span itemprop="name">' . cOut($row[1]) . '</span></a>' . ($show_images == 1 && $row[6] != '' ? '
				<img itemprop="image" src="' . $row[6] . '" class="eimage_b" />' : '') . '
			</li>';
        ++$cnt;
    }
    echo '
			</ul>
		' . $myNav;
}