Author Topic: Request Popup box  (Read 834 times)

0 Members and 0 Guests are viewing this topic.

Offline terrel8125

  • Jr. Member
  • **
  • Posts: 90
  • Karma: 3
    • View Profile
Request Popup box
« on: October 23, 2012, 01:38:56 pm »
I would like to find a code for a popup box or alert box for my forums can someone help me please

Share on Facebook Share on Twitter


Offline Griff Grof

  • Full Member
  • ***
  • Posts: 151
  • Karma: 0
  • cachewalker.co.uk
    • View Profile
    • CacheWalker
Re: Request Popup box
« Reply #1 on: October 23, 2012, 07:19:55 pm »
Good idea, I think a code for this would be useful  :)

Offline Andrew

  • Andrew at your service
  • Global Moderator
  • *****
  • Posts: 175
  • Karma: 11
  • Gender: Male
    • View Profile
    • The Tech Cadet Blog
Re: Request Popup box
« Reply #2 on: October 24, 2012, 02:14:18 am »
What would be the purpose of the alert box? Making a code for this would be fairly simple. Would you want it to display everywhere each time the page is refreshed?
Please do not PM for support. General Support FAQ | Guides Index | Code Index

Offline terrel8125

  • Jr. Member
  • **
  • Posts: 90
  • Karma: 3
    • View Profile
Re: Request Popup box
« Reply #3 on: October 24, 2012, 02:59:45 am »
no just every 24 hours for each member since i created the forums for an rsps (runescape private server) i want them to have a reminder to vote every 24 hours.

Offline starlit night

  • Jr. Member
  • **
  • Posts: 54
  • Karma: 1
  • Gender: Female
    • View Profile
    • Starlit Night Falls Ageplay Community
Re: Request Popup box
« Reply #4 on: October 25, 2012, 11:13:27 pm »
This is a great suggestion. I would find something like that very useful in my forum.

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
Re: Request Popup box
« Reply #5 on: October 26, 2012, 01:19:03 am »
I can't seem to produce a code for this easily, I doubt it will be much use anyways because it's not like I log in one day and log in the next exactly 24 hours after the first time, most users would miss the message being sent out.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline terrel8125

  • Jr. Member
  • **
  • Posts: 90
  • Karma: 3
    • View Profile
Re: Request Popup box
« Reply #6 on: October 26, 2012, 02:00:10 am »
I found the code and dont worry it happens when they come onto the forums so its diff for every ip.. idk how the code writers managed it but it worked... i asked my members if when they logged on if they got a pop up request and they said they did so... it worked..


Code is this!
Put that in your meta tag section of the forums(unfortunately i was unable to find a popup where u could customize it with your own text this is just a link to a url so ull have to make an entire new page for the custom text sorry)

Code: [Select]
<<script type="text/javascript">


//Time controlled Pop-under window- By JavaScriptKit.com
//This credit notice must stay intact for use
//Visit [url]http://www.javascriptkit.com[/url] for this script and 400+ more!


//1) specify URLs to randomly select from and pop-under:
//To display a single URL, just remove all but the first entry below:
var popunder=new Array()
popunder[0]="[url]http://www.freewarejava.com[/url]"
popunder[1]="[url]http://www.dynamicdrive.com[/url]"
popunder[2]="[url]http://www.webmasterpick.com[/url]"
popunder[3]="[url]http://www.codingforums.com[/url]"


//2) specify popunder window features
//set 1 to enable a particular feature, 0 to disable
var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"


//3) Control frequency of the pop up:
//"always", for every time page loads OR
//"x hours" for once per x hours, where x is an integer (ie: 12 hours)


var popfrequency="24 hours"


///No editing beyond here required/////


function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}


function resetcookie(){
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()-10)
document.cookie = "tcpopunder=;path=/;expires=" + expireDate.toGMTString()
}


function loadornot(){
if (get_cookie('tcpopunder')==''){
loadpopunder()
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()+parseInt(popfrequency))
document.cookie = "tcpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString()
}
}


function loadpopunder(){
win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"",winfeatures)
win2.blur()
window.focus()
}


if (popfrequency=="always"){
resetcookie()
loadpopunder()
}
else{
if (get_cookie('tcpopunder')!=parseInt(popfrequency))
resetcookie()
loadornot()
}
</script>

* Moderator edit: Added code tags
« Last Edit: November 01, 2012, 11:52:58 pm by Andrew »

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
1170 Views
Last post August 09, 2010, 10:18:31 am
by Thornton136
4 Replies
367 Views
Last post October 24, 2012, 02:50:16 am
by terrel8125
0 Replies
1013 Views
Last post May 18, 2015, 05:04:54 am
by SWAT4SAMP
0 Replies
633 Views
Last post December 21, 2016, 11:32:40 pm
by DarkRazor
CSR request

Started by Canne « 1 2 » General Support

17 Replies
487 Views
Last post August 28, 2018, 04:48:20 pm
by CreateAForum