Find an Event
array('ultize' => '','params' =>array(),),);
$upl_p_header = '
';
$upl_p_numItems = '10';
$upl_p_numChars = '100';
$upl_p_tags = '';
$upl_p_tags = array('LandRoverEvent');
//$upl_p_tags = '';
//$upl_p_resultStyle = 'horizontal';
$upl_p_sort = 'start-date-desc';
$upl_p_showSearchBox = 'yes';
$upl_p_search_icon = '';
$upl_p_srchlbl = 'Find Events';
$upl_p_event_name_srchlbl = '';
$upl_p_event_place_srchlbl = '';
$upl_p_showPagination = 'yes';
$upl_p_no_pages = '5';
$upl_p_paginationAlignment = 'bottom';
$upl_p_showRSSIcon = 'no';
$upl_p_RSSIcon_placement = 'Top Right';
$upl_p_RSSIcon_image = '';
$upl_p_footer = '';
$upl_page_no = EPUtils::getRequestParam('upcomingList_10_page');
$upl_location = EPUtils::getRequestParam('location');
$upl_query = EPUtils::getRequestParam('query');
$pageNumKey = 'upcomingList_1_p_page_no';
$base_query = getenv('PHP_SELF') . '?query='.$upl_query.'&location=' . $upl_location;
$page_no = EPUtils::getRequestParam($pageNumKey);
$num_results = $upl_p_numItems + 1;
if ($page_no != '')
{
$offset = ($page_no - 1) * $upl_p_numItems;
$cnt = $offset + $upl_p_numItems;
}
else
{
$page_no = 1;
$offset = 0;
$cnt = $upl_p_numItems;
}
?>
getImagePath('images/rss_icon_small.gif', false);
}
else
{
$iconImg = $upl_p_RSSIcon_image;
}
$rssTags = implode(',', $upl_p_tags);
$rssParams = array('count' => 100,
'tags' => $rssTags,
'sort' => $upl_p_sort,
'apiName' => 'searchEvents');
$obj_rss = new EPRSSLink();
$rss_link = $obj_rss->getRSSLink($micrositeName, 'UPCOMING', $rssParams);
$iconReference = $ycsObj->getImagePath($iconImg, false);
/*$rss_link = 'rss/ep_rss_generator.php?module_id=UPCOMING&location=' . 'microsite_id=' . $micrositeName . $upl_location . '&sort=' . $upl_p_sort . '&tags=' . $tags . '&query=' . $upl_query .'' ;*/
//$header .= '
';
// $header .= '
';
?>
getLocation($upl_location);
$location_box = $location['location'];
$location_box_value = 'Atlanta, GA, United States';
//this is to keep the text which use searched
if($location_box != '')
$location_box_value = $_REQUEST['location'];
//$sub_header .= '
';
if ($upl_p_showSearchBox == 'yes')
{
$btn = '';
if ($upl_p_search_icon !='')
{
$btn = '
';
}
else
{
$btn = '
';
}
$sub_header .= '
SEARCHBOX;
$sub_header .= '
';
// $sub_header .= '
';
// $sub_header .= '
';
}
?>
$offset,
'count' => $upl_p_numItems,
'results' => $upl_p_numItems * $upl_page_no,
'search_text' => $upl_query,
'sort' => $upl_p_sort,
'page' => $upl_page_no,
'min_date' => $min_date,
'max_date' => $max_date,
'location' => $location_box);
}
else
{
$params = array('start' => $offset,
'count' => $upl_p_numItems,
'results' => $upl_p_numItems * $upl_page_no,
'tags' => $tags,
'location' => $location_box,
'sort' => $upl_p_sort,
'min_date' => $min_date,
'max_date' => $max_date,
'page' => $upl_page_no);
}
}else{
if ($upl_query !== '')
{
$params = array('start' => $offset,
'count' => $upl_p_numItems,
'results' => $upl_p_numItems * $upl_page_no,
'search_text' => $upl_query,
'sort' => $upl_p_sort,
'page' => $upl_page_no,
'location' => $location_box);
}
else
{
$params = array('start' => $offset,
'count' => $upl_p_numItems,
'results' => $upl_p_numItems * $upl_page_no,
'tags' => $tags,
'location' => $location_box,
'sort' => $upl_p_sort,
'page' => $upl_page_no);
}
}
//echo $min_date;
//echo $max_date;
$controllerObj = EPFEController::getInstance();
$requestArr = array();
$requestArr[d_CNT_WIDGET_NAME] = 'Upcoming_List_Widget';
$requestArr[d_CNT_MICROSITE_ID] = $sitename;
$requestArr[d_CNT_MODULE_PARAMS] = $params;
$requestArr[d_CNT_METHOD_NAME] = $method;
$requestArr[d_CNT_TTL] = $ttl;
$response = $controllerObj->fetchContent($requestArr);
$events['events'] = $response['Results'];
$events['count'] = count($events['events']);
$num_results = $events['count'];
/**************** Pagination variable starts here **********************************/
$pageNumber = array_key_exists($pageNumKey, $_REQUEST) ? $_REQUEST[$pageNumKey] : 1;
$baseQuery = '';
foreach($_GET as $key => $val)
{
if ($key != $pageNumKey)
{
$baseQuery .= urlencode($key) . '=' . urlencode($val) . '&';
}
}
$hitsPerPage = $upl_p_numItems;
$totalHits = $response['TotalResultsAvailable'];
$pageLinks = $upl_p_no_pages;
$curPageKey = $pageNumber;
$startIndex = ($pageNumber - 1) * $hitsPerPage;
/**************** Pagination variable ends here **********************************/
?>
';
$current_page = $upl_page_no;
$per_page = $upl_p_numItems;
if ($current_page == '')
{
$current_page = 1;
}
$pages = '';
$pages .= '
';
//$content .= $pages;
$content .= '
';
}
}
$content .= '
';
$count = $events['count'];
if ($count > $upl_p_numItems)
{
$count = $count - 1;
}
$nullResponse = false;
if (array_key_exists('message',$events['events'][0]))
{
$nullResponse = true;
}
if ($count > 0 && $nullResponse != true)
{
$epBlockLink = new EPJavaBlockLink();
for($i = 0; $i < $count ; $i++)
{
$body = '';
if ($events['events'][$i]['start_time'] != '')
{
$whenArr = explode(':', $events['events'][$i]['start_time']);
$hour = $whenArr[0];
$minute = $whenArr[1];
$second = $whenArr[2];
}
else
{
$hour = 0;
$minute = 0;
$second = 0;
}
$dateArr = explode('-', $events['events'][$i]['start_date']);
$year = $dateArr[0];
$month = $dateArr[1];
$date = $dateArr[2];
$when = date("M j, Y, g:i a", mktime($hour, $minute, $second, $month, $date, $year));
$events['events'][$i]['url'] = 'http://upcoming.yahoo.com/event/'. $events['events'][$i]['id'];
$description = strip_tags($events['events'][$i]['description']);
if (EPStringUtils::length($description) > $upl_p_numChars)
{
$desc = EPStringUtils::substring($description, 0, $upl_p_numChars) . '...';
}
else
{
$desc = $description;
}
$event_url = $events['events'][$i]['url'];
$ultize = $ult_params['event']['ultize'];
if ($ultize == true)
{
$link_params = $ult_params['event']['params'];
$event_url = $ultObj->trackLink($event_url,$link_params);
}
$blockLink = $epBlockLink->getJavaBlockLink($method, $events['events'][$i]['cid'], '', $sitename);
if ($blockLink) {
$blocklink = '
Block ';
} else {
$blocklink = '';
}
if ($upl_p_resultStyle == 'vertical')
{
$body .= '
';
$body .= '
' . $when . ' ';
$body .= '
' . $events['events'][$i]['name'] .' '.$blocklink;
if ($desc != '')
{
$body .= '
' . $desc . ' ';
}
$body .= '
' . $events['events'][$i]['venue_address'] . ' ';
$body .= '
' . $events['events'][$i]['venue_city'] . ', ' . $events['events'][$i]['venue_state_name'] . ' ';
$body .= '
';
}
else
{
$body .= '
';
$body .= '
';
$body .= '
';
$body .= '
' . $when . '
';
$body .= '
' . $events['events'][$i]['venue_address'] . ' ';
$body .= '
' . $events['events'][$i]['venue_city'] . ', ' . $events['events'][$i]['venue_state_name'] . ' ';
$body .= '
';
$body .= '
';
$body .= '
';
}
$content .= $body;
}
}
else
{
$content .= '
No results found.
';
}
$content .= '
';
if($upl_p_showPagination == 'yes')
{
if ($upl_p_paginationAlignment == 'bottom' || $upl_p_paginationAlignment == 'both')
{
$content .= '
';?>
{$sub_header}
BODY;
?>
';
$current_page = $page_no;
$per_page = $upl_p_numItems;
if ($current_page == '')
{
$current_page = 1;
}
$prevClass = '';
$nextClass = '';
$startPage = 0;
$endPage = 0;
//
// Pagination : one-based indexing
//
$currentPage = array_key_exists($pageNumKey, $_REQUEST) ? $_REQUEST[$pageNumKey] : 1;
$lastPage = ceil($totalHits / $hitsPerPage);
if ($currentPage == 1)
{
$prevClass = 'class="current inactive"';
$prevLink = '';
}
else
{
$prevPageNum = $currentPage - 1;
$prevLink = "
";
}
if ($currentPage == $lastPage)
{
$nextClass = 'class="current inactive"';
$nextLink = '';
}
else
{
$nextPageNum = $currentPage + 1;
$nextLink = "
";
}
$startPage = $currentPage - ($pageLinks - floor($pageLinks / 2) - 1);
$endPage = $currentPage + floor($pageLinks / 2);
if ($startPage <= 0)
{
$endPage += (1 - $startPage);
$startPage = 1;
}
if ($endPage > $lastPage)
{
$startPage -= ($endPage - $lastPage);
$endPage = $lastPage;
}
if ($startPage <= 0)
{
$startPage = 1;
}
$pageLinksHTML = '';
for ($i = $startPage; $i <= $endPage; $i++)
{
if ($i == $currentPage)
{
$pageLinksHTML .= <<