New messages link Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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

    New messages link

    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved New messages link

    Post by Niko Sun Apr 22, 2012 11:57 am

    Hello,I created an extra navbar... And I want to change the "mailbox link" when I receive new messages...I know this problem was posted on this forum many times but i can't find it...please, Help me...Thanks


    Last edited by Niko! on Fri May 04, 2012 1:56 pm; edited 3 times in total
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Sun Apr 22, 2012 1:56 pm

    I want to have You have no new messages and You have Xnew messages with a customized navbar in templates... (:
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: New messages link

    Post by LGforum Sun Apr 22, 2012 3:06 pm

    [Have you removed the old navbar? As you should keep it in your page but hidden in order to access this information.

    If you have kept the old navbar you can do this:
    Code:

    if(document.getElementById('i_icon_mini_new_message')) {
      //the user has a new message, do something.
    }
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Wed Apr 25, 2012 6:13 am

    LGforum wrote:[Have you removed the old navbar? As you should keep it in your page but hidden in order to access this information.

    If you have kept the old navbar you can do this:
    Code:

    if(document.getElementById('i_icon_mini_new_message')) {
      //the user has a new message, do something.
    }

    No, I have a new navbar...
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: New messages link

    Post by LGforum Wed Apr 25, 2012 3:13 pm

    I'd recommend adding it back into the page but in a hidden DIV, so you can access the information it provides.
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Thu Apr 26, 2012 11:17 am

    LGforum wrote:I'd recommend adding it back into the page but in a hidden DIV, so you can access the information it provides.

    Which infos do I need? Mr. Green
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: New messages link

    Post by LGforum Thu Apr 26, 2012 8:45 pm

    Well you need the private message info, thats what this thread is about Razz

    Just put the old navigation bar back, but in a div with style display:none. I know you know what I mean lol.

    then the script in my posts above can be used.
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Fri Apr 27, 2012 11:41 am

    Well, I'm trying on my test forum...
    I have the default navbar Smile

    But what I have to edit? O.o

    LGforum wrote:
    Code:
    if(document.getElementById('i_icon_mini_new_message')) {
      //the user has a new message, do something.
    }
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: New messages link

    Post by LGforum Fri Apr 27, 2012 4:57 pm

    Rideem is right, just anything in the IF statement.

    The best thing to do (imo) is to have a widget/announcement (anywhere which takes HTML) and design yourself a pop up. Make it look nice and however you want it then stick 'style="display:none" on it so it is hidden. Then in the if statement put:
    Code:
    document.getElementById('ID_OF_POPUP').style.display='';

    Which will mean your pop up will popup whenever there is a new message.

    I also shared a tutorial on your site of a good way of making a nice pop up using a template trick.
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Sat Apr 28, 2012 7:53 am

    Well,

    I added this code:
    Code:
    <div style="display: none;">{GENERATED_NAV_BAR}</div>
    now, I want to have this popup (example) when I receive a private message:

    Code:
    <div class="popupclass" id="popupid">You received a new message. Read it</div>
    .
    Which code I need to put? Can you gt it ready for me? U.u
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Solved Re: New messages link

    Post by LGforum Sat Apr 28, 2012 5:04 pm

    Put this in an announcement or template or somthing:

    Code:

    <div class="popupclass" id="privmsgpopup">You received a new message. Read it</div>
    <script>
    if(document.getElementById('i_icon_mini_new_message')) {
      document.getElementById('privmsgpopup').style.display = '';   
    }
    </script>
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Sun Apr 29, 2012 7:31 am

    It doesn't work Sad
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3231
    Reputation : 248
    Language : English, Italian, French
    Location : Italy

    Solved Re: New messages link

    Post by Niko Thu May 03, 2012 2:37 pm

    Solved Smile
    I tried to do the opposite...