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.
[SOLVED] JomSocial Notifications: show numbers by notifications only when NOT zero?
So far, testing of JomSocial on my site has been going great and I appreciate your support as I address my community's opinions before out site goes public soon!
Many of my members have been messaging me about the JomSocial notifications module and they want it to only show the notification numbers when there is actually a notification. Currently, it has a "0" by the notifications when there is no notification present. How can I hide the "0" and only show the numbers when there is an actual notification?
Okay, awesome...that put me in the right direction! This is what I had to do to get it to fully function if anyone else needs help:
The following instructions will remove the "0" number from the notifications module so that only notification numbers appear when there is a notification.
1) First, open /modules/mod_notify/tmpl/default.php
Then, find the following code (there are three sections of code like this, one for friends, messages, and global notifications):
<i class="tool-icon-notification"></i>
<span class="notifcount">
<?php
if ($newEventInviteCount) {
echo $newEventInviteCount;
} else {
echo "0";
}
?>
</span class="notifcount">
</a>
2) Next, comment out the echo "0"; code as follows by adding a "//" in front of it:
<i class="tool-icon-notification"></i>
<span class="notifcount">
<?php
if ($newEventInviteCount) {
echo $newEventInviteCount;
} else {
// echo "0";
}
?>
</span class="notifcount">
</a>
3) Next, the <span> tags need to be moved into the first "if" statement like so...all of the lines of code you can simply copy and paste since this it the final version:
<i class="tool-icon-notification"></i>
<?php
if ($newEventInviteCount) {
echo '<span class="notifcount">';
echo $newEventInviteCount;
echo '</span></a>';
} else {
// echo "0";
}
?>
Thanks again David - that really helped and it appears to be working a-ok now!