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.

[SOLVED] JomSocial Notifications: show numbers by notifications only when NOT zero?

10 years 3 months ago
  • Ryan's Avatar
    Topic Author
  • Ryan
  • Offline
  • Fresh Boarder
  • Posts: 48
  • Thank you received: 4
Licenses:
JomSocial Expired

Hey guys,

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?

Thanks for your help guys!

Ryan

10 years 3 months ago
  • David Sutanto's Avatar
  • David Sutanto
  • Visitor
  • Thank you received: 0
Licenses:

hi Ryan,

Just go to ROOT/modules/mod_notify/tmpl and open default.php.

search echo "0" and delete it or give a comment line in front of echo..

Warm regards,
David

10 years 3 months ago
  • Ryan's Avatar
    Topic Author
  • Ryan
  • Offline
  • Fresh Boarder
  • Posts: 48
  • Thank you received: 4
Licenses:
JomSocial Expired

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!

10 years 3 months ago
  • David Sutanto's Avatar
  • David Sutanto
  • Visitor
  • Thank you received: 0
Licenses:

Hi Ryan,

You're welcome

Warm Regards,

David

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