Hello Me module has neat feature that displays count for Friends, Groups, Photos, Videos and Events. Since Hello Me is redundant to me, but I do like those counters we can implement those in JS Toolbar or mod_community_bar. Don't forget to update override if some changes are made in original mod_community_bar. Don't do this if you are not comfortable with editing php since I cannot be blamed for any damage on your site.
This works only when names of Links in Toolbar are Friends, Groups, Photos, Videos and Events. For different name and language specific names changes are needed.
1) Make Joomla template override for module by copying :
...\modules\mod_community_bar\tmpl\default.php
to
...\templates\MY_JOOMLA_TEMAPLTE\html\mod_community_bar\default.php
2) On line 29 (after line "$newEventInviteCount += $newNotificationCount;") of new file insert:
//video count
$videoModel = CFactory::getModel('Videos');
$totalVideos = $videoModel->getVideosCount($user->id);
//photo count
$photosModel = CFactory::getModel('photos');
$totalPhotos = $photosModel->getPhotosCount($user->id);
//group count
$groupmodel = CFactory::getModel('groups');
$totalGroups = $groupmodel->getGroupsCount($user->id);
//event count
$eventmodel = CFactory::getModel('events');
$totalEvents = $eventmodel->getEventsCount($user->id);
<?php if($moduleParams->get('navigationmenu')) { ?>
<?php foreach ($navMenuItems as $item): ?>
<li><a href="<?php echo CRoute::_($item->link); ?>"><?php echo JText::_($item->title); ?></a></li>
<?php endforeach; ?>
<?php
foreach ($navMenuItems as $item) {
switch ($item->title){
case "Friends":
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '<span class="counter"> ' . $user->_friendcount . '</span></a></li>';
break;
case "Groups":
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '<span class="counter"> ' . $totalGroups . '</span></a></li>';
break;
case "Photos":
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '<span class="counter"> ' . $totalPhotos . '</span></a></li>';
break;
case "Videos":
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '<span class="counter"> ' . $totalVideos . '</span></a></li>';
break;
case "Events":
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '<span class="counter"> ' . $totalEvents . '</span></a></li>';
break;
default:
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '</a></li>';
break;
}
}
?>
...
case "Amici":
case "Друзья":
case "Freunde":
case "Friends":
echo '<li><a href="' . CRoute::_($item->link) . '">' . JText::_($item->title) . '<span> ' . $user->_friendcount . '</span></a></li>';
break;
...
.joms-toolbar--desktop > ul > li > a > span.counter {
opacity: 0.5;
}
Hi,
Thank you for sharing we appreciate it.. please you also share this topic on our community group
www.jomsocial.com/community/groups/viewg...omsocial-tips-tricks
thank you!
+1 :)