Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
2 posters
Page 1 of 1
Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
Hello again!
I'm working on a custom navbar, and have mostly gotten it to work the way I want. However, there's one last bit I can't figure out, so here I am. Again.
I want to change the text of (or add an icon to) the "inbox" part whenever a user gets a new PM.
This is the full navbar code. You can see it working here: https://ryya.swedishforum.se/
I want this part:
I've managed to find that the global phpbb variable { S_NEW_PM } should return "true" if there's a new message. However, I don't know how to translate that into code that does anything.
After a lot of googling the other day, I tried adding an if/else like this:
Any ideas on how to change "inbox" when a user gets a message?
As always incredibly thankful for your help!
(Edit: Sorry! I should probably have added this to "Forum Design & Appearance Help", not "Other Problems". Is it possible to move it?)
I'm working on a custom navbar, and have mostly gotten it to work the way I want. However, there's one last bit I can't figure out, so here I am. Again.
I want to change the text of (or add an icon to) the "inbox" part whenever a user gets a new PM.
This is the full navbar code. You can see it working here: https://ryya.swedishforum.se/
- Code:
<!-- BEGIN switch_user_logged_in -->
<div class="topnav" id="myTopnav">
<a href="/portal">Hem</a>
<a href="/forum">Forum</a>
<a href="/privmsg?folder=inbox">Inbox</a>
<div class="dropdown">
<button class="dropbtn">Konto
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content hidden">
<a href="" class="simple-profile">Profil</a>
<a href="/profile?mode=editprofile">Inställningar</a>
<a href="/search?search_id=watchsearch">Mina Rollspel</a>
</div>
</div>
<a href="/h1-regler-samlingssida">Regler</a>
<div class="dropdown">
<button class="dropbtn">Om (Sida)
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/h4-raser">Raser</a>
<a href="https://numoori.fandom.com/wiki/Krafter_i_Numoori" target="_blank">Krafter</a>
<a href="/h9-sprak">Språk</a>
<a href="/h6-historia">Historia</a>
<a href="/h7-religion">Religion</a>
<a href="https://numoori.fandom.com/wiki/Main_Page" target="_blank">Wiki</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Kartor
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/h12-lightbox-test">Områden</a>
<a href="/h12-lightbox-test">Flockar</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Medlemmar
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/memberlist">Medlemslista</a>
<a href="/h10-dodslista">Dödslista</a>
<a href="/h10-dodslista">Register</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Hjälp
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/h13-kom-igang">Guide: Kom igång</a>
<a href="/h17-guide-sida">Guide: Karaktärer och Rollspel</a>
<a href="/faq">FAQ: Vanliga frågor</a>
<a href="/search">Sök</a>
</div>
</div>
<a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
</div>
<!-- END switch_user_logged_in -->
<!-- BEGIN switch_user_logged_out -->
<div class="topnav" id="myTopnav">
<a href="/portal">Hem</a>
<a href="/forum">Forum</a>
<a href="/h1-regler-samlingssida">Regler</a>
<div class="dropdown">
<button class="dropbtn">Om (Sida)
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/h4-raser">Raser</a>
<a href="https://numoori.fandom.com/wiki/Krafter_i_Numoori" target="_blank">Krafter</a>
<a href="/h9-sprak">Språk</a>
<a href="/h6-historia">Historia</a>
<a href="/h7-religion">Religion</a>
<a href="https://numoori.fandom.com/wiki/Main_Page" target="_blank">Wiki</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Kartor
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/h12-lightbox-test">Områden</a>
<a href="/h12-lightbox-test">Flockar</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Medlemmar
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/memberlist">Medlemslista</a>
<a href="/h10-dodslista">Dödslista</a>
<a href="/h10-dodslista">Register</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Hjälp
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="/h13-kom-igang">Guide: Kom igång</a>
<a href="/h17-guide-sida">Guide: Karaktärer och Rollspel</a>
<a href="/faq">FAQ: Vanliga frågor</a>
<a href="/search">Sök</a>
</div>
</div>
<a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
</div>
<!-- END switch_user_logged_out -->
I want this part:
- Code:
<a href="/privmsg?folder=inbox">Inbox</a>
I've managed to find that the global phpbb variable { S_NEW_PM } should return "true" if there's a new message. However, I don't know how to translate that into code that does anything.
After a lot of googling the other day, I tried adding an if/else like this:
- Code:
<!-- IF S_NEW_PM -->
X
<!-- ELSE -->
Y
<!-- ENDIF -->
Any ideas on how to change "inbox" when a user gets a message?
As always incredibly thankful for your help!
(Edit: Sorry! I should probably have added this to "Forum Design & Appearance Help", not "Other Problems". Is it possible to move it?)
Re: Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
The topic was posted in the wrong section, so I have moved it to the correct section.
|
Re: Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
Thanks for moving it!
Ape likes this post
Re: Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
It's the "Inbox" part of the navbar, at the top of the forum, that I'm trying to change when there's a new message. This part here:
Larger image
So that when a user gets a message the text changes from "inbox" to "new pm", or adds an icon on top to indicate there's a message waiting.
Larger image
So that when a user gets a message the text changes from "inbox" to "new pm", or adds an icon on top to indicate there's a message waiting.
Re: Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
oh right most forums have that has Messages Not inbox on the toolbar / Navbar
I don't think it can be changed in the templates as it would need to change when you get a PM or unread PM and the only way to do this would to make a image but it would not count the number of PM's with a image.
I don't think it can be changed in the templates as it would need to change when you get a PM or unread PM and the only way to do this would to make a image but it would not count the number of PM's with a image.
Re: Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
I'm a little late to reply, thanks for being patient.
I know that it's possible to change the image with the regular/standard navbar.
I've made a custom one (code in my first post) so it doesn't use the standard navbar or images. I've managed to add dropdowns, and got help a little while back with adding a link to users simple profile (here). Stuff that the standard navbar doesn't include or can't do, so that's why I'm working on a custom one.
There are phpbb variables which return true if there's a new PM, such as the previously mentioned { S_NEW_PM }, or that count how many new messages a user has, { S_USER_NEW_PRIVMSG }. These variables need to get that information somewhere, so I'm thinking it should be possible to make something that uses that same, sorry I forget the words, English isn't my first language, the same source? Function? That, when there's a new PM, changes a bit of custom text to something else. But I don't know How to do that. I've been looking at different java- and php-scripts, but I have no coding education, and don't really understand any of it, so here I am haha
I know that it's possible to change the image with the regular/standard navbar.
I've made a custom one (code in my first post) so it doesn't use the standard navbar or images. I've managed to add dropdowns, and got help a little while back with adding a link to users simple profile (here). Stuff that the standard navbar doesn't include or can't do, so that's why I'm working on a custom one.
There are phpbb variables which return true if there's a new PM, such as the previously mentioned { S_NEW_PM }, or that count how many new messages a user has, { S_USER_NEW_PRIVMSG }. These variables need to get that information somewhere, so I'm thinking it should be possible to make something that uses that same, sorry I forget the words, English isn't my first language, the same source? Function? That, when there's a new PM, changes a bit of custom text to something else. But I don't know How to do that. I've been looking at different java- and php-scripts, but I have no coding education, and don't really understand any of it, so here I am haha
Re: Trying to change "inbox" to "new PM!" in custom navbar when user gets a message
The problem is most of that data is saved server side and it can't be changed that easy and any change made server side would change this for everyone who has a forum in your Language.
Using JavaScripts to change this will only slow your forum down if you have a lot of them running in the background.
Using JavaScripts to change this will only slow your forum down if you have a lot of them running in the background.
Similar topics
» Message Inbox Capacity
» NEWS: increase in the number of private message in the Inbox
» Just one custom field change
» Adding drop down menu to a custom navbar
» One message requirement for new user.
» NEWS: increase in the number of private message in the Inbox
» Just one custom field change
» Adding drop down menu to a custom navbar
» One message requirement for new user.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum