good job
March 2024
Search
Similar topics
Who is online?
In total there are 2 users online :: 0 Registered, 0 Hidden and 2 Guests
None
Most users ever online was 140 on July 4th 2021, 2:03 pm
None
Most users ever online was 140 on July 4th 2021, 2:03 pm
Most Viewed Topics
Top posting users this week
No user |
New Message Pop Up [punBB & phpBB2]
Hello my fellow users, today I was looking through the templates and found this very useful option. This will work so the your users can turn it off or on! All they have to go to Profile>Preferences and find this options :
Display a pop-up window for new private messages :
So here is how we do this...
Step 1: Go to ACP>DISPLAY>TEMPLATES>GENERAL>OVERALL_HEADER then search for this - - Once you find that there will be a "var" under that that says
What we are going to do basically take that entire code out and change it to this:
[hc = View New Code]
Step Two:
Then we will add this CSS to your style sheet
[hc = View New CSS]
That is it, you can change the wording in the JavaScript, as well as the look and feel to it. This code works 100% and it is great because our users have an option to turn this off or back on if they wanted to!
Display a pop-up window for new private messages :
So here is how we do this...
Step 1: Go to ACP>DISPLAY>TEMPLATES>GENERAL>OVERALL_HEADER then search for this - - Once you find that there will be a "var" under that that says
- Code:
pm = window.open('{U_PRIVATEMSGS_POPUP}', '_faprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');
pm.focus();
What we are going to do basically take that entire code out and change it to this:
[hc = View New Code]
- Code:
<!-- BEGIN switch_enable_pm_popup -->
pm = $('body').prepend('<div class="popup_background"><div id="newmessage_popup" style="z-index:99999;"><h3><span class="username">'+_userdata.username+'</span> You Have A New Message!<span id="close_popup"><img src="http://www.sizeis.com/img/closeButton.png"/></span></h3><span class="context_popup">Hey, so it seems you have a new message.<br /> Seems like someone cares about you!<br />Why not check it out.<br /><a href="/privmsg?folder=inbox">Go To Inbox</a></span></div></div>');
$('#close_popup').on('click',function() {
$('.popup_background').remove();
});
<!-- END switch_enable_pm_popup -->
Step Two:
Then we will add this CSS to your style sheet
[hc = View New CSS]
- Code:
#newmessage_popup {
width: 400px;
border: 1px solid #414141;
margin: 15% auto;
height: auto;
border-radius: 10px;
overflow: hidden;
background:#fff;
}
#newmessage_popup h3 {
text-align: center;
background: #E0E0E0;
margin: 0px;
border-bottom: 1px solid #5E5E5E;
color: #666;
position:relative;
}
#close_popup{
position:absolute;
top:0px;
right:0px;
cursor:pointer;
}
.context_popup {
width: 100%;
text-align: center;
float: left;
}
.popup_background{
position: fixed;
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
background:rgba(0,0,0,0.5);
}
That is it, you can change the wording in the JavaScript, as well as the look and feel to it. This code works 100% and it is great because our users have an option to turn this off or back on if they wanted to!
Similar topics
Thank you Conan, I thought it was a very nice little trick to share, and no need for access coding such as see if the user is logged in or not, it is nicely wrapped in the ForuMotion PHP comment lines.
No it Is not possible as we need to have access to the templates, we can completely create a code to work instead of this. Though as of now I'm busy making client stuff and this would be bottom of list. I'm sorry
Good job
Then,my forum keep save from unknowing-coming-private-message
Because my navibar,if there are some new messages,they cannot changed into "new messages" navibar..
Then,my forum keep save from unknowing-coming-private-message
Because my navibar,if there are some new messages,they cannot changed into "new messages" navibar..