item->params;
$images  = json_decode($this->item->datimage);
$attribs = json_decode($this->item->attribs);
$user    = JemFactory::getUser();
$jemsettings = JemHelper::config();
$document    = JFactory::getDocument();
// Add expiration date, if old events will be archived or removed
if ($jemsettings->oldevent > 0) {
  $enddate = strtotime($this->item->enddates?:$this->item->dates);
  $expDate = date("D, d M Y H:i:s", strtotime('+1 day', $enddate));
  $document->addCustomTag('
	
		 $this->item->slug, 'print_link' => $this->print_link);
		echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
		?>
	
	 
	params->get('show_page_heading', 1)) : ?>
		
			escape($this->params->get('page_heading')); ?>
		 
	
	 
	
	
		item);
		echo JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditEvent, 'editevent');
		echo JemOutput::copybutton($this->item, $params, $attribs, $this->permissions->canAddEvent, 'editevent');
		?>
	 
	item, $this->dimage, 'event'); ?>
	
		get('event_show_detailstitle',1)) : ?>
		: 
		escape($this->item->title); ?> 
		
		: 
		
			item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
			echo JemOutput::formatSchemaOrgDateTime($this->item->dates, $this->item->times,$this->item->enddates, $this->item->endtimes);
			?>
		 
		item->locid != 0) : ?>
		: 
		get('event_show_detlinkvenue') == 1) && (!empty($this->item->url))) :
				?>escape($this->item->venue); ?> get('event_show_detlinkvenue') == 2) && (!empty($this->item->venueslug))) :
				?>item->venue; ?> get('event_show_detlinkvenue') == 0)*/ :
				echo $this->escape($this->item->venue);
			endif;
			# will show "venue" or "venue - city" or "venue - city, state" or "venue, state"
			$city  = $this->escape($this->item->city);
			$state = $this->escape($this->item->state);
			if ($city)  { echo ' - ' . $city; }
			if ($state) { echo ', ' . $state; }
			?>
		 
		categories) ? count($this->categories) : 0;
		?>
		: 
		
		categories as $category) :
			?>escape($category->catname); ?> 
		 
		item->{'custom'.$cr};
			if (preg_match('%^http(s)?://%', $currentRow)) {
				$currentRow = ''.$this->escape($currentRow).' ';
 			}
			if ($currentRow) {
			?>
				: 
				: 
		item->hits); ?> 
		
	
		get('event_show_author') && !empty($this->item->author)) : ?>
		: 
		
			item->created_by_alias ? $this->item->created_by_alias : $this->item->author; ?>
			item->contactid2) && $params->get('event_link_author') == true) :
				$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid2;
				$menu = JFactory::getApplication()->getMenu();
				$item = $menu->getItems('link', $needle, true);
				$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
				echo JText::sprintf('COM_JEM_EVENT_CREATED_BY', JHtml::_('link', JRoute::_($cntlink), $author));
			else :
				echo JText::sprintf('COM_JEM_EVENT_CREATED_BY', $author);
			endif;
			?>
		 
		
	
		showeventstate) && isset($this->item->published)) : ?>
		: 
		
			item->published) {
			case  1: echo JText::_('JPUBLISHED');   break;
			case  0: echo JText::_('JUNPUBLISHED'); break;
			case  2: echo JText::_('JARCHIVED');    break;
			case -2: echo JText::_('JTRASHED');     break;
			} ?>
		 
		
	 
	
	get('event_show_description','1') && ($this->item->fulltext != '' && $this->item->fulltext != '
' || $this->item->introtext != '' && $this->item->introtext != '
')) { ?>
	
	
	
	get('event_show_contact') && !empty($this->item->conid )) : ?>
	
	
		: 
		
		item->conname;
		if ($params->get('event_link_contact') == true) :
			$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->conid;
			$menu = JFactory::getApplication()->getMenu();
			$item = $menu->getItems('link', $needle, true);
			$cntlink2 = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
			echo JText::sprintf('COM_JEM_EVENT_CONTACT', JHtml::_('link', JRoute::_($cntlink2), $contact));
		else :
			echo JText::sprintf('COM_JEM_EVENT_CONTACT', $contact);
		endif;
		?>
		 
		item->contelephone) : ?>
		: 
		
			escape($this->item->contelephone); ?>
		 
		
	 
	
	attachments = $this->item->attachments; ?>
	loadTemplate('attachments'); ?>
	
	item->locid != 0) && !empty($this->item->venue)) : ?>
	
	
		
			item ? $this->item->id : 0 ;
			echo JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditVenue, 'editvenue');
			echo JemOutput::copybutton($this->item, $params, $attribs, $this->permissions->canAddVenue, 'editvenue');
			?>
		 
		item, $this->limage, 'venue'); ?>
		
			: 
			
				item->venueslug)) :
					echo '' . $this->escape($this->item->venue) . ' ';
				else :
					echo $this->escape($this->item->venue);
				endif;
				if (!empty($this->item->url)) :
					echo ' - ' . JText::_('COM_JEM_WEBSITE') . ' ';
				endif;
				?>
			 
		 
		get('event_show_detailsadress', '1')) : ?>
		
			item->street) : ?>
			: 
			
				escape($this->item->street); ?>
			 
			
			item->postalCode) : ?>
			: 
			
				escape($this->item->postalCode); ?>
			 
			
			item->city) : ?>
			: 
			
				escape($this->item->city); ?>
			 
			
			item->state) : ?>
			: 
			
				escape($this->item->state); ?>
			 
			
			item->country) : ?>
			: 
			
				item->countryimg ? $this->item->countryimg : $this->item->country; ?>
				 
			
			
			showvenuestate) && isset($this->item->locpublished)) : ?>
			: 
			
				item->locpublished) {
				case  1: echo JText::_('JPUBLISHED');   break;
				case  0: echo JText::_('JUNPUBLISHED'); break;
				case  2: echo JText::_('JARCHIVED');    break;
				case -2: echo JText::_('JTRASHED');     break;
				} ?>
			 
			
			item->{'venue'.$cr};
				if (preg_match('%^http(s)?://%', $currentRow)) {
					$currentRow = '' . $this->escape($currentRow) . ' ';
				}
				if ($currentRow) {
					?>
					: 
					 
			get('event_show_mapserv') == 2) : ?>
				item, 'event', $params); ?>
			
			get('event_show_mapserv') == 3) : ?>
				
				item, 'event', $params); ?>
			
		
		get('event_show_locdescription', '1') && $this->item->locdescription != ''
		       && $this->item->locdescription != '
') : ?>
		
			item->locdescription; ?>
		
		
		attachments = $this->item->vattachments; ?>
		loadTemplate('attachments'); ?>
	
 
	
	
	showAttendees) : ?>
		
		: 
		loadTemplate('attendees'); ?>
	
	item->pluginevent->onEventEnd)) : ?>
		
		
		item->pluginevent->onEventEnd; ?>