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 September 15th 2014, 5:44 pm

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 September 16th 2014, 4:15 pm; edited 1 time in total
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur September 15th 2014, 8:13 pm

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 : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by TheCrow September 15th 2014, 9:03 pm

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.


New Message text color change Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur September 16th 2014, 5:45 am

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 : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by TheCrow September 16th 2014, 12:57 pm

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.


New Message text color change Thecro10
Forum of the Forums

Forumotion Rules | Tips & Tricks |
FAQ | Did you forget your password?



*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur September 16th 2014, 3:12 pm

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 : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: New Message text color change

Post by TheCrow September 16th 2014, 4:09 pm

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 : 6916
Reputation : 795
Language : Greek, English

https://www.inforumgr.com

Back to top Go down

Solved Re: New Message text color change

Post by Ange Tuteur September 16th 2014, 4:48 pm

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 : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

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