Hi, it would be really nice to be able to hide the attendee and seats text
Also the hosted by field...
As the site admin I create events on and behalf of customers so the events are never hosted by me.
But it would be great to be able to hide the attendee and seats field as to is akin to a booking and not really an event.
The event attendees box in the event detail page would also need to be hidden.
I hope that these options will be in back end soon...
I hope you can help.
Hi, Trevor.
Copy this file:
ROOT/components/com_community/templates/jomsocial/layouts/events/single.php
to:
ROOT/templates/your-template/html/com_community/layouts/events (if you don't have any of those folders, feel free to create them)
Edit file, scroll to line 251 and remove those lines:
<li class="full"><?php echo ($event->ticket) ? JText::sprintf('COM_COMMUNITY_EVENTS_TICKET_STATS', $event->ticket, $eventMembersCount, ($event->ticket - $eventMembersCount)) : JText::sprintf('COM_COMMUNITY_EVENTS_UNLIMITED_SEAT'); ?></li>
<li class="full"><a href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=viewguest&eventid=' . $event->id . '&type='.COMMUNITY_EVENT_STATUS_ATTEND )?>"><?php
echo JText::sprintf((CStringHelper::isPlural($eventMembersCount)) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY':'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT', $eventMembersCount);
#echo $eventMembersCount > 1 ? JText::_('COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY') . ' <span class="joms-text--light">' . $eventMembersCount . '</span>' : JText::_('COM_COMMUNITY_EVENTS_ATTANDEE_COUNT') . ' <span class="joms-text--light">' . $eventMembersCount . '</span>'
?></a></li>
<?php if(isset($groupEventDetails) && !empty($groupEventDetails->groupName)){ ?>
<li class="full"><?php echo JText::sprintf('COM_COMMUNITY_GROUP_EVENT_HOSTED_BY',$groupEventDetails->groupLink,$groupEventDetails->groupName,CRoute::_('index.php?option=com_community&view=profile&userid=' . $groupEventDetails->creator->id),$groupEventDetails->creator->getDisplayName()) ?></li>
<?php }else{ ?>
<li class="full"><?php echo JText::sprintf('COM_COMMUNITY_EVENT_HOSTED_BY',CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id), $creator->getDisplayName()) ?></li>
<?php } ?>
Hi thank you it has almost worked..
In the list view it appears to be ok.. I just noticed in the event view it says event created by...
The attendee has gone - thank you....... but it still shows the text unlimited seats - also it still shows hosted by.
In the list view it appears to be ok.. I just noticed in the event view it says event created by...
So maybe in the event detail page I could change the text from hosted by to created by or just remove it...
I get it - think...
so when I edit what is in the main template folder overrides the other files.
Would it be possible for me to add a line of code for the attendee, so it only displays for the user that created it, maybe something like if userid=creator then display
??
That way the admin could always see who is attending the event...
Hi, Trevor.
Yes, it's possible, just don't remove that li's but before them add this:
<?php if($isMine || $isCommunityAdmin || $isAdmin) { ?>
here goes li's <li></li>
And after them:
<?php } ?>
So full code should look like:
<?php if($isMine || $isCommunityAdmin || $isAdmin) { ?>
<li class="full"><?php echo ($event->ticket) ? JText::sprintf('COM_COMMUNITY_EVENTS_TICKET_STATS', $event->ticket, $eventMembersCount, ($event->ticket - $eventMembersCount)) : JText::sprintf('COM_COMMUNITY_EVENTS_UNLIMITED_SEAT'); ?></li>
<li class="full"><a href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=viewguest&eventid=' . $event->id . '&type='.COMMUNITY_EVENT_STATUS_ATTEND )?>"><?php
echo JText::sprintf((CStringHelper::isPlural($eventMembersCount)) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY':'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT', $eventMembersCount);
#echo $eventMembersCount > 1 ? JText::_('COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY') . ' <span class="joms-text--light">' . $eventMembersCount . '</span>' : JText::_('COM_COMMUNITY_EVENTS_ATTANDEE_COUNT') . ' <span class="joms-text--light">' . $eventMembersCount . '</span>'
?></a></li>
<?php if(isset($groupEventDetails) && !empty($groupEventDetails->groupName)){ ?>
<li class="full"><?php echo JText::sprintf('COM_COMMUNITY_GROUP_EVENT_HOSTED_BY',$groupEventDetails->groupLink,$groupEventDetails->groupName,CRoute::_('index.php?option=com_community&view=profile&userid=' . $groupEventDetails->creator->id),$groupEventDetails->creator->getDisplayName()) ?></li>
<?php }else{ ?>
<li class="full"><?php echo JText::sprintf('COM_COMMUNITY_EVENT_HOSTED_BY',CRoute::_('index.php?option=com_community&view=profile&userid=' . $creator->id), $creator->getDisplayName()) ?></li>
<?php } ?>
<?php } ?>
Wow, you are brilliant!! Thank you so much..
In order to hide the attendee tab I also added the line to;
<?php if($isMine || $isCommunityAdmin || $isAdmin) { ?>
<div id="joms-event--attend" class="joms-tab__content">
<div class="joms-module__body">
<?php if($eventMembersCount>0) { ?>
<ul class="joms-list--thumbnail">
<?php foreach($eventMembers as $member) { ?>
<li class="joms-list__item">
<a href="<?php echo CUrlHelper::userLink($member->id); ?>" class="joms-avatar">
<img src="<?php echo $member->getThumbAvatar(); ?>" alt="<?php echo $member->getDisplayName(); ?>" />
</a>
</li>
<?php } ?>
</ul>
<div class="joms-gap"></div>
<a class="joms-button--link" href="<?php echo $handler->getFormattedLink('index.php?option=com_community&view=events&task=viewguest&eventid=' . $event->id . '&type='.COMMUNITY_EVENT_STATUS_ATTEND );?>"><?php echo JText::_('COM_COMMUNITY_VIEW_ALL');?> </a>
<?php } else {
echo JText::_('COM_COMMUNITY_EVENTS_NO_USER_ATTENDING_MESSAGE');
} ?>
</div>
</div>
<?php } ?>