The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

New Message text color change

2 posters

Go down

Solved New Message text color change

Post by TheCrow Mon 15 Sep 2014 - 17:44

Hello,

I've noticed that when a user sends a pm the text wont change. I believe that is because my menu bar is changed through the template.
I am leaving the template part below so if someone know how to help me to tell me what i can do.
overall_header template:
What i want is when someone gets the pm the nav bar button named "Μηνύματα" (Messages) to change the color and be red. If someone can help me i would appreciate it.

Regards,
MrMind.


Last edited by MrMind on Tue 16 Sep 2014 - 16:15; edited 1 time in total
TheCrow
TheCrow
Manager
Manager

Male Posts : 6787
Reputation : 788
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur Mon 15 Sep 2014 - 20:13

Hello MrMind,

Go to Administration Panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In all the pages
Paste the code below and submit :
Code:
$(function() {if (/\d+/.test($('#pun-navlinks a[href^="/privmsg"]').text())) $('#nav_app_mailbox a').addClass('new-message')});

We check the default nav to see if the messages text contains a digit, if it does we add a classname to your messages nav. The nav on a new pm usually reads "You have % new message(s)", which is why I check for only a digit.

You can add the color with this rule :
If it doesn't apply add !important
Code:
.new-message { color:red }
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by TheCrow Mon 15 Sep 2014 - 21:03

I think that what you sent me is for the default nav bar. The script and the css did not give any effect to the messages. You can login to the forum with the same pass and username you have from what i sent you the other time.
Perhaps it is because i changed it and it doesn't have the number part that F/M or the other default ones do.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6787
Reputation : 788
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur Tue 16 Sep 2014 - 5:45

It should work fine, I tested it with your template.
New Message text color change Captu158

Did you do the following ?
Ange Tuteur wrote:If it doesn't apply add !important

Code:
.new-message { color:red !important }
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by TheCrow Tue 16 Sep 2014 - 12:57

Ange the forum is not displayed like that to us. We see it like this:
New Message text color change HXwbGEJ
and as you can see i recieved the popup but the text didn't change.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6787
Reputation : 788
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur Tue 16 Sep 2014 - 15:12

I checked your forum and the classname is being added. You forgot to add important to the rule if it did not work the first time. As you can see the rule with .new-message was being overridden :
New Message text color change Captu159

I added important to it. You can check your test account if you want, it should have 1 new message.
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by TheCrow Tue 16 Sep 2014 - 16:09

Ok so it must be something with me or i may have a problem or something! Razz
I just send a pm to me and check the result:
New Message text color change EufmQRe

Ps. I don't know why but my prefixes started not to show all of a sudden!

Edit: Το the test account i can see the red text and the perfixes normally

Edit 2: I had to refresh to see the effect! Thanks a lot! Topic Solved!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6787
Reputation : 788
Language : Greek, English

View user profile https://forumote.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur Tue 16 Sep 2014 - 16:48

You're welcome ^^

If you send a PM to yourself and wait until the redirect the message will be considered "Read" from the navbar. ( It wont say "You have % new message(s)" )

Topic archived

Have a great day. Smile
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13244
Reputation : 2990
Language : English & 日本語
Location : Pennsylvania

View user profile https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum