Animate Font Awesome Icons - New PM or Nofication

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
wads24
Registered User
Posts: 662
Joined: Fri Jun 10, 2005 4:44 am
Name: James

Animate Font Awesome Icons - New PM or Nofication

Post by wads24 »

Hi there!

I would like to animate the font awesome icons when there are new notifications, or new PM's for users when they are logged in. I added faa-ring animated icon-red to the class in navbar_header.html, and it animates all the time. I only want it red and animated when a new PM or Notification appears.

How would I accomplish this :?:

Code: Select all

			<!-- EVENT navbar_header_username_append -->
		</li>
		<!-- IF S_DISPLAY_PM -->
			<li class="rightside" data-skip-responsive="true">
				<a href="{U_PRIVATEMSGS}" role="menuitem">
					<i class="icon fa-inbox fa-fw" aria-hidden="true"></i><span>{L_PRIVATE_MESSAGES} </span><strong class="badge<!-- IF not PRIVATE_MESSAGE_COUNT --> hidden<!-- ENDIF -->">{PRIVATE_MESSAGE_COUNT}</strong>
				</a>
			</li>
		<!-- ENDIF -->
		<!-- IF S_NOTIFICATIONS_DISPLAY -->
			<li class="dropdown-container dropdown-{S_CONTENT_FLOW_END} rightside" data-skip-responsive="true">
				<a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger">
					<i class="icon fa-bell fa-fw faa-ring animated icon-red" aria-hidden="true"></i><span>{L_NOTIFICATIONS} </span><strong class="badge<!-- IF not NOTIFICATIONS_COUNT --> hidden<!-- ENDIF -->">{NOTIFICATIONS_COUNT}</strong>
				</a>
				<!-- INCLUDE notification_dropdown.html -->
			</li>
		<!-- ENDIF -->
				
Last edited by Mick on Fri Nov 23, 2018 9:05 pm, edited 1 time in total.
Thanks in advance for a reply.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: Animate Font Awesome Icons - New PM or Nofication

Post by GanstaZ »

Put that code into an if statement and test how it works:

Code: Select all

{% if NOTIFICATIONS_COUNT %}faa-ring animated icon-red{% endif %}
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
wads24
Registered User
Posts: 662
Joined: Fri Jun 10, 2005 4:44 am
Name: James

Re: Animate Font Awesome Icons - New PM or Nofication

Post by wads24 »

GanstaZ wrote: Sat Nov 24, 2018 12:06 am Put that code into an if statement and test how it works:

Code: Select all

{% if NOTIFICATIONS_COUNT %}faa-ring animated icon-red{% endif %}
Would that work for notifications and private messages?
Thanks in advance for a reply.
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3732
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay
Contact:

Re: Animate Font Awesome Icons - New PM or Nofication

Post by Kailey »

PMs would use PRIVATE_MESSAGE_COUNT. It should work. Try it out and let us know.
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules

If you have any questions about the rules/customs of this website, feel free to send me a PM.
User avatar
wads24
Registered User
Posts: 662
Joined: Fri Jun 10, 2005 4:44 am
Name: James

Re: Animate Font Awesome Icons - New PM or Nofication

Post by wads24 »

kinerity wrote: Sun Nov 25, 2018 1:51 am PMs would use PRIVATE_MESSAGE_COUNT. It should work. Try it out and let us know.
Thanks. You are the best
Thanks in advance for a reply.
Post Reply

Return to “phpBB Custom Coding”