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.
The forum of the forums
2 posters

    Don't show this again

    Niko
    Niko
    Helper
    Helper


    Male Posts : 3233
    Reputation : 249
    Language : English, Italian, French
    Location : Italy

    Solved Don't show this again

    Post by Niko April 27th 2012, 8:40 pm

    Hello,

    I made a search on Google
    Spoiler:
    and I haven't found anything...

    Well, I want to create a pop-up message that when you click on it it will close and it won't appear again (for the same member)... I have this "table" for now...

    Code:
    <div id="popup1" onclick="$('#popup').toggle('fast');">Message</div>
    What Can I do? Thanks for your help Mr. Green

    Notes: I use PunBB and Google Chrome; I will put the code in templates (Forum link in the profile)

    Friendly,


    Last edited by Niko! on April 29th 2012, 4:39 pm; edited 1 time in total
    LGforum
    LGforum
    Hyperactive


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

    Solved Re: Don't show this again

    Post by LGforum April 28th 2012, 1:46 am

    You must save a cookie in order to know whether or not the user has experienced the pop up.

    You can save cookie's using the functions already in forumotions system scripts. my_getcookie() and my_setcookie();

    Code:

    if(!my_getcookie('popup')) {
      // Java script to pop up your box...

      my_setcookie('popup',1,true);
    }
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3233
    Reputation : 249
    Language : English, Italian, French
    Location : Italy

    Solved Re: Don't show this again

    Post by Niko April 28th 2012, 3:42 pm

    Well, I didn't understand...
    Can you make it easier for me? Smile
    LGforum
    LGforum
    Hyperactive


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

    Solved Re: Don't show this again

    Post by LGforum April 29th 2012, 2:02 am

    Not really lol its as easy as it gets Razz

    I suppose this might be easier...
    Code:

    <div id="popupbox" style="display:none">
    STYLE THIS BOX AND PUT YOUR MESSAGE AND STUFF HERE.
    </div>
    <script>
    if(!my_getcookie('popup')) {
      document.getElementById('popupbox').style.display = '';
      my_setcookie('popup',1,true);
    }
    </script>
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3233
    Reputation : 249
    Language : English, Italian, French
    Location : Italy

    Solved Re: Don't show this again

    Post by Niko April 29th 2012, 4:36 pm

    Solved!! Mr. Green

      Current date/time is September 23rd 2024, 4:18 pm