Back To Top
Login
Register
Visit Us At TwitterVisit Us At YouTubeVisit Us At Facebook
KandiChat is in Beta Release. Try It Out
HomeHome  
  • UpdatesUpdates  
  • SearchSearch  
  • Latest imagesLatest images  
  • RegisterRegister  
  • Log inLog in  
  • March 2024
    MonTueWedThuFriSatSun
        123
    45678910
    11121314151617
    18192021222324
    25262728293031

    Calendar Calendar

    Search
     
     

    Display results as :
     


    Rechercher Advanced 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
    RSS feeds


    Poll
    Top posting users this week
    No user


    View previous topic View next topic Go down  Message [Page 1 of 1]

    Mr.EasyBB

    New Message Pop Up [punBB & phpBB2]

    Mr.EasyBB
    03/19/2013
      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
    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 -->
    [/hc]

    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);
    }
    [/hc]

    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!
    Share this post on: reddit

    ConanSSC
    good job

    Post March 21st 2013, 1:46 am by ConanSSC

    Mr.EasyBB
    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.

    Post March 21st 2013, 2:04 am by Mr.EasyBB

    tommycoo
    thanks easy Smile
    this is cool

    Post March 21st 2013, 6:40 am by tommycoo

    tommycoo
    this is possible to make it for phpbb3 version ?

    Post April 29th 2013, 10:22 am by tommycoo

    Mr.EasyBB
    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

    Post April 29th 2013, 4:18 pm by Mr.EasyBB

    Miiko
    Good job Very Happy

    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..

    Post June 19th 2013, 11:15 am by Miiko

    Mr.EasyBB
    Sorry I'm not sure on what you are trying to say

    Post June 19th 2013, 3:33 pm by Mr.EasyBB

    Post  by Sponsored content

    View previous topic View next topic Back to top  Message [Page 1 of 1]