Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: onload modal window (IP Based)

  1. #1
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default onload modal window (IP Based)

    Here's what i'm basically looking for...

    Something like this: http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    but I want it to load up as soon as the page loads (without having to click anything). I'm sure that part is simple enough, but I also want it to ONLY load once for each IP address that visits the site.

    Is this possible? I mean, I'm 100% sure it's possible, but is it far too complex for a "non-scripting" kinda guy like me to understand?
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    This script does open as soon as the page loads. And its not possible unless you wanna use files or a database. You could also use cookies, but then if they clear they're cookies it would be there.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    TheJoshMan (10-23-2008)

  4. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    yea, php and/or database is fine. I suppose it would be ok to use cookies, but I'm afraid that users might get annoyed if they see the message mroe than once, that's why i only wanted to use the IP
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  5. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by Nyne Lyvez View Post
    yea, php and/or database is fine. I suppose it would be ok to use cookies, but I'm afraid that users might get annoyed if they see the message mroe than once, that's why i only wanted to use the IP
    I would use cookies for this. It's all client-side and would work in most situations. Sure, someone may clear their cookies but then they probably understand that their preferences are wiped clean across websites.

    IP isn't a very accurate technology. You would exclude a lot more people and perhaps not show it to all visitors.

  6. The Following User Says Thank You to Medyman For This Useful Post:

    TheJoshMan (10-23-2008)

  7. #5
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    ah, ok... do you have any ideas as to how to implement something like the link i posted but use cookies to control it's display?
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  8. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Yeah, I've done it a few times. But, I just jQuery.

    My modal window script of choice is Facebox. And I accompany that with jQuery Cookie.

    The jQuery might look something like this (very crude but you'll get the idea).

    Code:
    $.cookie('the_cookie', 'the_value'); // set cookie
    if ($.cookie('the_cookie')) { 
       /* do something */ 
    }
    Easy enough for ya? You really gotta learn jQuery man. It's a life saver!

  9. The Following User Says Thank You to Medyman For This Useful Post:

    TheJoshMan (10-23-2008)

  10. #7
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    wow...

    well, i can see this is going to be an "all nighter" for me.

    My javascript skills are minimal at best. LOL

    Facebox won't be a problem as i've used it before... but the jQuery cookie looks more complex than what i'm used to dealing with. (i've never even used cookies) LOL
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  11. #8
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It's really not as hard as you think. My JavaScript skills are minimal as well. But I can hack my way through jQuery. It kind of saves my face and prevents me from really understanding JS.

    It's really not that difficult. I gave you most of the script above It would seriously just be a few lines.

    Code:
    jQuery(document).ready(function($) {
       if ($.cookie('the_cookie')) { 
          alert("cookie is loaded");
       }
       else {
          $('a[rel*=facebox]').facebox() 
          $.cookie('the_cookie', 'the_value'); // set cookie
       }
    })
    The scripts do all of the heavy lifting for you. Note that the above is just theory. There is probably something wrong with it. But you get the idea.

  12. The Following User Says Thank You to Medyman For This Useful Post:

    TheJoshMan (10-23-2008)

  13. #9
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    well, i'll work/play with it tonight and post up solution (if i find one) tomorrow

    Thanks so much medyman, i appreciate the help.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  14. #10
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Excuse me, don't mean to interrupt. But the script you linked to gives exactly what you want!
    Jeremy | jfein.net

  15. The Following User Says Thank You to Nile For This Useful Post:

    TheJoshMan (10-23-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •