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.

simulate users online

12 years 2 weeks ago
Licenses:
JomSocial Expired

Hello,

When no one is logged, I wish simulate users online (Example 4/5 fictitious users)
(COM_COMMUNITY_FRONTPAGE_WHOSE_ONLINE => mod_community_whosonline)

Impression that there is always someone on site...

Thanks

12 years 2 weeks ago
Licenses:

Hi Adrien,

you can do it by using override. here the steps:
1. copy default.php from /modules/mod_community_whosonline/tmpl/ to /templates/rt_acacia/html/mod_community_whosonline/
2. edit it, after this code

<?php for ( $i = 0; $i < count( $onlineMembers ); $i++ ) { ?>
	<?php $row =& $onlineMembers[$i]; ?>
	<div class="js-col4 bottom-gap">
		<a href="<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$row->id ); ?>">
			<img class="cAvatar jomNameTips" src="<?php echo $row->user->getThumbAvatar(); ?>" title="<?php echo CTooltip::cAvatarTooltip($row->user); ?>" alt="<?php echo CStringHelper::escape($row->user->getDisplayName()); ?>" />
		</a>
	</div>
<?php } ?>
put this new code
<?php if (count( $onlineMembers ) == 0) { ?>
	<div class="js-col4 bottom-gap">
		<a href="/index.php?option=com_community&amp;view=profile&amp;userid=467&amp;Itemid=143">
			<img alt="name1" src="/components/com_community/assets/user-Male-thumb.png" class="cAvatar jomNameTips" original-title="name1">
		</a>
	</div>
	<div class="js-col4 bottom-gap">
		<a href="/index.php?option=com_community&amp;view=profile&amp;userid=467&amp;Itemid=143">
			<img alt="name2" src="/components/com_community/assets/user-Male-thumb.png" class="cAvatar jomNameTips" original-title="name2">
		</a>
	</div>
	<div class="js-col4 bottom-gap">
		<a href="/index.php?option=com_community&amp;view=profile&amp;userid=467&amp;Itemid=143">
			<img alt="name3" src="/components/com_community/assets/user-Male-thumb.png" class="cAvatar jomNameTips" original-title="name3">
		</a>
	</div>
	<div class="js-col4 bottom-gap">
		<a href="/index.php?option=com_community&amp;view=profile&amp;userid=467&amp;Itemid=143">
			<img alt="name4" src="/components/com_community/assets/user-Male-thumb.png" class="cAvatar jomNameTips" original-title="name4">
		</a>
	</div>
<?php } ?>

you can changing name1 - 4 with your purpose.

Regards,
Albert

The following user(s) said Thank You: Adrien
11 years 11 months ago
Licenses:
JomSocial Expired

Hi,

instead of "onlineMembers 0" I would like to :
<?php if (count( $onlineMembers ) == 0) { ?>
If 0-3 users
+ users onlines

maybe something like this :

<?php if (count( $onlineMembers ) == 0-3 ; $i++) { ?>
<?php $row =& $onlineMembers[$i]; ?>
	<div class="js-col4 bottom-gap">
		<a href="<?php echo CRoute::_('index.php?option=com_community&view=profile&userid='.$row->id ); ?>">
			<img class="cAvatar jomNameTips" src="<?php echo $row->user->getThumbAvatar(); ?>" title="<?php echo CTooltip::cAvatarTooltip($row->user); ?>" alt="<?php echo CStringHelper::escape($row->user->getDisplayName()); ?>" />
		</a>
	</div>
	<div class="js-col4 bottom-gap">
		<a href="/index.php?option=com_community&amp;view=profile&amp;userid=467&amp;Itemid=143">
			<img alt="name1" src="/components/com_community/assets/user-Male-thumb.png" class="cAvatar jomNameTips" original-title="name1">
		</a>
	</div>
	<div class="js-col4 bottom-gap">
		<a href="/index.php?option=com_community&amp;view=profile&amp;userid=467&amp;Itemid=143">
			<img alt="name2" src="/components/com_community/assets/user-Male-thumb.png" class="cAvatar jomNameTips" original-title="name2">
		</a>
	</div>
<?php } ?>

(This will allow for online users and fictitious users simultaneously)

Thnaks

11 years 11 months ago
  • Dimas Tekad Santosa's Avatar
  • Dimas Tekad Santosa
  • Visitor
  • Thank you received: 0
Licenses:

You can use this conditional :

<?php if (count( $onlineMembers ) >= 0 && count( $onlineMembers ) < 3 ) { ?>

11 years 11 months ago
Licenses:
JomSocial Expired

Tank you, it's ok with :
<?php for ( $i = 0; $i < count( $onlineMembers ); $i++ ) { ?>
and
<?php if (count( $onlineMembers ) == 0) { ?>

11 years 11 months ago
Licenses:

Hi Adrien,

how is it going with this customization? anything I can help again?

Regards,
Albert

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