Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Duplicate SQL for getting number of guest visiting

10 years 2 weeks ago
  • Tobias's Avatar
    Topic Author
  • Tobias
  • Offline
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Licenses:
JomSocial Expired

When listing events, I noticed dublicate SQL's for getting number of visitors. This is because the getMembersCount function is called twice. This was present in v3 and now also in v4. In v4 this is found in layouts/events/list.php

<a href="<?php echo $event->getGuestLink(
COMMUNITY_EVENT_STATUS_ATTEND
); ?>"><?php echo JText::sprintf(
(!CStringHelper::isSingular(
$event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND)
)) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY_NUMBER' : 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_NUMBER',
$event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND)
); ?></a>

10 years 2 weeks ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

You right, please you change to be like this :

<?php $attendCount = $event->getMembersCount(COMMUNITY_EVENT_STATUS_ATTEND)?>
<a href="<?php echo $event->getGuestLink(COMMUNITY_EVENT_STATUS_ATTEND); ?>"><?php echo JText::sprintf(
(!CStringHelper::isSingular($attendCount)) ? 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_MANY_NUMBER' : 'COM_COMMUNITY_EVENTS_ATTANDEE_COUNT_NUMBER',$attendCount); ?></a>

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW