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.

Profile albums and groups: if 0 don't display in the profile

12 years 2 months ago
  • carlatf's Avatar
    Topic Author
  • carlatf
  • Offline
  • Fresh Boarder
  • Posts: 33
  • Thank you received: 1
Licenses:
JomSocial Active

Hi,

I'd like to hide photo, video, group and event info if there's no info on the user.

How can I do it?

thanks very much!

Attachment Untitled-1_2014-08-15.jpg not found

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

Hi carlatf,

Please you open this file components/com_community/templates/default/module/profile/userinfo.php, find this code :

<ul class="inline unstyled">
								<li><a href="#" class="about js-collapse-about-btn"><?php echo JText::_('COM_COMMUNITY_ABOUT_ME')?></a></li>
								<?php if($photoEnabled) {?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=photos&task=myphotos&userid='.$profile->id); ?>">
										<?php echo ($profile->_photos == 1) ? JText::sprintf('COM_COMMUNITY_PHOTOS_COUNT_SINGULAR',$profile->_photos) :  JText::sprintf('COM_COMMUNITY_PHOTOS_COUNT',$profile->_photos) ?>
									</a>
								</li>
								<?php }?>
								<?php if($videoEnabled) {?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=videos&task=myvideos&userid='.$profile->id); ?>">
										<?php echo ($profile->_videos == 1) ?  JText::sprintf('COM_COMMUNITY_VIDEOS_COUNT',$profile->_videos) : JText::sprintf('COM_COMMUNITY_VIDEOS_COUNT_MANY',$profile->_videos) ?>
									</a>
								</li>
								<?php }?>
								<?php if($groupEnabled) {?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=mygroups&userid='.$profile->id); ?>">
										<?php echo ($profile->_groups == 1) ?  JText::sprintf('COM_COMMUNITY_GROUPS_COUNT',$profile->_groups) : JText::sprintf('COM_COMMUNITY_GROUPS_COUNT_MANY',$profile->_groups) ?>
									</a>
								</li>
								<?php }?>
								<?php if($eventEnabled) {?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=myevents&userid='.$profile->id); ?>">
										<?php echo ($profile->_events == 1) ? JText::sprintf('COM_COMMUNITY_EVENTS_COUNT',$profile->_events) : JText::sprintf('COM_COMMUNITY_EVENTS_COUNT_MANY',$profile->_events) ?>
									</a>
								</li>
								<?php }?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=friends&userid='.$profile->id); ?>">
										<?php echo ($profile->_friends == 1) ?  JText::sprintf('COM_COMMUNITY_FRIENDS_COUNT',$profile->_friends) : JText::sprintf('COM_COMMUNITY_FRIENDS_COUNT_MANY',$profile->_friends) ?>
									</a>
								</li>
								<!-- Karma -->
								<?php if($config->get('enablekarma')){ ?>
									<li class="cFocus-karma jomNameTips" title="<?php echo JText::_('COM_COMMUNITY_KARMA'); ?>"><img src="<?php echo $karmaImgUrl; ?>" alt="" /></li>
								<?php } ?>
							</ul>

replace to :
<ul class="inline unstyled">
								<li><a href="#" class="about js-collapse-about-btn"><?php echo JText::_('COM_COMMUNITY_ABOUT_ME')?></a></li>
								<?php if($photoEnabled) {?>
								
								<?php if($profile->_photos>0):?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=photos&task=myphotos&userid='.$profile->id); ?>">
										<?php echo ($profile->_photos == 1) ? JText::sprintf('COM_COMMUNITY_PHOTOS_COUNT_SINGULAR',$profile->_photos) :  JText::sprintf('COM_COMMUNITY_PHOTOS_COUNT',$profile->_photos) ?>
									</a>
								</li>
								<?php endif?>

								<?php }?>


								<?php if($videoEnabled) {?>
								<?php if($profile->_videos>0):?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=videos&task=myvideos&userid='.$profile->id); ?>">
										<?php echo ($profile->_videos == 1) ?  JText::sprintf('COM_COMMUNITY_VIDEOS_COUNT',$profile->_videos) : JText::sprintf('COM_COMMUNITY_VIDEOS_COUNT_MANY',$profile->_videos) ?>
									</a>
								</li>
								<?php endif?>
								<?php }?>
								<?php if($groupEnabled) {?>
								<?php if($profile->_groups>0):?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=groups&task=mygroups&userid='.$profile->id); ?>">
										<?php echo ($profile->_groups == 1) ?  JText::sprintf('COM_COMMUNITY_GROUPS_COUNT',$profile->_groups) : JText::sprintf('COM_COMMUNITY_GROUPS_COUNT_MANY',$profile->_groups) ?>
									</a>
								</li>
								<?php endif?>
								<?php }?>
								<?php if($eventEnabled) {?>
								<?php if($profile->_events>0):?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=events&task=myevents&userid='.$profile->id); ?>">
										<?php echo ($profile->_events == 1) ? JText::sprintf('COM_COMMUNITY_EVENTS_COUNT',$profile->_events) : JText::sprintf('COM_COMMUNITY_EVENTS_COUNT_MANY',$profile->_events) ?>
									</a>
								</li>
								<?php endif?>
								<?php }?>
								<?php if($profile->_friends>0):?>
								<li>
									<a href="<?php echo CRoute::_('index.php?option=com_community&view=friends&userid='.$profile->id); ?>">
										<?php echo ($profile->_friends == 1) ?  JText::sprintf('COM_COMMUNITY_FRIENDS_COUNT',$profile->_friends) : JText::sprintf('COM_COMMUNITY_FRIENDS_COUNT_MANY',$profile->_friends) ?>
									</a>
								</li>
								<?php endif?>
								<!-- Karma -->
								<?php if($config->get('enablekarma')){ ?>
									<li class="cFocus-karma jomNameTips" title="<?php echo JText::_('COM_COMMUNITY_KARMA'); ?>"><img src="<?php echo $karmaImgUrl; ?>" alt="" /></li>
								<?php } ?>
							</ul>

12 years 2 months ago
  • carlatf's Avatar
    Topic Author
  • carlatf
  • Offline
  • Fresh Boarder
  • Posts: 33
  • Thank you received: 1
Licenses:
JomSocial Active

Thanks very much! worked like charm

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