<?php
/**
* @version 1.0.0
* @package RSEvents! 1.0.0
* @copyright (C) 2009 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined('_JEXEC') or die('Restricted access');
?>
<?php echo $this->layout;  ?>
<span id="rsevents-clear"></span>
<div id="rsevents-registered">
	<?php if (($this->data->EventShowGuest == 1) && (!empty($this->registeredUsers['data']))) { ?>
	<h3><?php echo JText::_('RSE_REGISTERED_USERS'); ?></h3>
	<ul class="rsevents_registered">
	<?php  
	foreach($this->registeredUsers['data'] as $registeredUser)
	{
		if($this->rseventsConfig['subscribers.link'] == 0)
		echo '<li>'.$registeredUser->username.'</li>';
		elseif ($this->rseventsConfig['subscribers.link'] == 1 && file_exists(JPATH_SITE.DS.'components'.DS.'com_comprofiler'.DS.'comprofiler.php'))
		echo '<li><a href="'.JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='.$registeredUser->id).'">'.$registeredUser->username.'</a></li>';
		elseif ($this->rseventsConfig['subscribers.link'] == 2 && file_exists(JPATH_SITE.DS.'components'.DS.'com_joomunity'.DS.'joomunity.php'))
		echo '<li><a href="'.JRoute::_('index.php?option=com_joomunity&cmd=Profile.View.'.$registeredUser->id).'">'.$registeredUser->username.'</a></li>';
		elseif($this->rseventsConfig['subscribers.link'] == 3 &&  file_exists(JPATH_SITE.DS.'components'.DS.'com_community'.DS.'community.php'))
		echo '<li><a href="'.JRoute::_('index.php?option=com_community&view=profile&userid='.$registeredUser->id).'">'.$registeredUser->username.'</a></li>';
		else echo '<li>'.$registeredUser->username.'</li>';
	}
	$multiple = ($this->registeredUsers['guests'] == 1) ? JText::_('RSE_GUEST') : JText::_('RSE_GUESTS') ;
	if(!empty($this->registeredUsers['guests'])) echo '<li>'.$this->registeredUsers['guests'].' '.$multiple.'</li>';
	
	?>
	</ul>


<?php } ?>
</div>
<br/>
<div class="comments" id="rsevents-comments">
<?php
if($this->data->EventEnableComments ==1)
{
	switch ($this->rseventsConfig['events.commenting']) 
	{
		
		//jcomments integration
		case 1:
			if (file_exists(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php')) :
				require_once(JPATH_SITE.DS.'components'.DS.'com_jcomments'.DS.'jcomments.php');
				echo JComments::showComments($this->data->IdEvent, 'com_rsevents', $this->escape($this->data->EventName));
			endif;
		break;

		//jomcomment integration
		case 2:
			if (file_exists(JPATH_SITE.DS.'plugins'.DS.'content'.DS.'jom_comment_bot.php')) :
	    		require_once(JPATH_SITE.DS.'plugins'.DS.'content'.DS.'jom_comment_bot.php');
	    		echo jomcomment($this->data->IdEvent, 'com_rsevents');
	  		endif;
		break;
	}
}
?>
</div>

