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.

How to change notification box color

10 years 2 months ago
  • The's Avatar
    Topic Author
  • The
  • Offline
  • Fresh Boarder
  • Posts: 52
  • Thank you received: 1
Licenses:
JomSocial Expired

We need to change notification background color to read if there is any new notification. How can we do it?

Attachments:
10 years 2 months ago
Licenses:

Hi, The.

You'll need to edit this file (as I see you want to achieve it in Hello me module. Copy this file:

ROOT/modules/mod_hellome/tmpl/default.php

to

ROOT/templates/your_current_template/html/mod_hellome (if you don't have "html" or "mod_hellome" folders - feel free to create them.

Now edit this file in line 89, change this:

                <div class="cMod-Notify">
                    <a href="javascript:joms.notifications.showWindow();"  title="<?php echo JText::_('COM_COMMUNITY_NOTIFICATIONS_GLOBAL'); ?>">
                        <i class="tool-icon-notification"></i>
                        <span class="notifcount"><?php echo ($newEventInviteCount) ? $newEventInviteCount : 0 ;?></span>
                    </a>
                    <a href="<?php echo CRoute::_('index.php?option=com_community&view=friends&task=pending'); ?>" onclick="joms.notifications.showRequest();return false;"  title="<?php echo JText::_('COM_COMMUNITY_NOTIFICATIONS_INVITE_FRIENDS'); ?>">
                        <i class="tool-icon-friend"></i>
                        <span class="notifcount"><?php echo ($newFriendInviteCount) ? $newFriendInviteCount : 0 ;?></span>

                    </a>
                    <a href="<?php echo CRoute::_('index.php?option=com_community&view=inbox'); ?>"   onclick="joms.notifications.showInbox();return false;" title="<?php echo JText::_('COM_COMMUNITY_NOTIFICATIONS_INBOX'); ?>">
                        <i class="tool-icon-inbox"></i>
                        <span class="notifcount"><?php echo ($newMessageCount) ? $newMessageCount : 0 ;?></span>
                    </a>
                </div>

to this:
                <div class="cMod-Notify">
                    <a href="javascript:joms.notifications.showWindow();"  title="<?php echo JText::_('COM_COMMUNITY_NOTIFICATIONS_GLOBAL'); ?>">
                        <i class="tool-icon-notification"></i>
                        <?php if($newEventInviteCount > 0) {
                        		$changecolor1 = "red";
                        	} else {
                        		$changecolor1 = "";
                        		}
                        		if($newFriendInviteCount > 0) {
                        		$changecolor2 = "red";
                        	} else {
                        		$changecolor2 = "";
                        		}
                        		if($newMessageCount > 0) {
                        		$changecolor3 = "red";
                        	} else {
                        		$changecolor3 = "";
                        		}
                        	?>
                        <span class="notifcount <?php echo $changecolor1; ?>"><?php echo ($newEventInviteCount) ? $newEventInviteCount : 0 ;?></span>
                    </a>
                    <a href="<?php echo CRoute::_('index.php?option=com_community&view=friends&task=pending'); ?>" onclick="joms.notifications.showRequest();return false;"  title="<?php echo JText::_('COM_COMMUNITY_NOTIFICATIONS_INVITE_FRIENDS'); ?>">
                        <i class="tool-icon-friend"></i>
                        <span class="notifcount <?php echo $changecolor2; ?>"><?php echo ($newFriendInviteCount) ? $newFriendInviteCount : 0 ;?></span>

                    </a>
                    <a href="<?php echo CRoute::_('index.php?option=com_community&view=inbox'); ?>"   onclick="joms.notifications.showInbox();return false;" title="<?php echo JText::_('COM_COMMUNITY_NOTIFICATIONS_INBOX'); ?>">
                        <i class="tool-icon-inbox"></i>
                        <span class="notifcount <?php echo $changecolor3; ?>"><?php echo ($newMessageCount) ? $newMessageCount : 0 ;?></span>
                    </a>
                </div>

Now each time there will be new message, friend invitation or notification, new class "red" will be add to containers. So now you'll need to add this class to:

ROOT/templates/shaper_university/css/template.css
.cMod-Notify .red {
background: red;
}

Tell me if it works for you or you want to have it in toolbar.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
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