$©Ø®Þ!@Ω™
Head - Coder
Scorpian - Beware the Sting!
Posts: 32
|
Post by $©Ø®Þ!@Ω™ on Mar 27, 2006 3:52:46 GMT
This code will pop-up with a box asking if a guest would like to sign the guestbook. If they click "ok", they're redirected to a specified location. If they click "cancel", the box closes. It also sets a cookie, so it will only ask once. It's cross-browser. MAIN HEADER<script type='text/javascript'> <!-- /* Redirect guest to guestbook By Scorpian, roddyinnovations.co.nr*/ var fname = "Our Forum"; //Your forum name var gurl = "index.cgi?board=general"; //URL of Guestbook if (pb_username == "Guest") { if(!document.cookie.match(/\bhasviewed=1/)){ var d = new Date(); d.setTime(d.getTime()+2592000000); var exp = d.toString(); document.cookie = "hasviewed=1; expires="+exp+";"; var confirmbox = confirm("Welcome to "+fname+", Please sign our guestbook."); if (confirmbox == true) { document.location.href=gurl } } } //--> </script>
|
|
|
Post by Selest on Mar 28, 2006 4:53:19 GMT
|
|
$©Ø®Þ!@Ω™
Head - Coder
Scorpian - Beware the Sting!
Posts: 32
|
Post by $©Ø®Þ!@Ω™ on Mar 28, 2006 23:19:00 GMT
Alright, I'll explain it. I forgot to put the "edit this" sectionn up there. My bad. Alright:
Underneath the code header, you'll see these 2 lines:
var fname = "Our Forum"; //Your forum name var gurl = "index.cgi?board=general"; //URL of Guestbook Replace "Our Forum" with your forum name, as it says. BE SURE TO PUT IT IN QUOTES!!! Where it says "index.cgi?board=general", that's where the url goes. It's not required that you put the "http://yoursite.proboardsXX.com/" part in there, but you can. So for you, the code would be this:
<script type='text/javascript'> <!-- /* Redirect guest to guestbook By Scorpian, http://roddyinnovations.... */ var fname = "Cairo, City of Kings"; //Your forum name var gurl = "index.cgi?board=ruelsandoutofcharactertopics&action=display&thread=1113841286l"; //URL of Guestbook
if (pb_username == "Guest") { if(!document.cookie.match(/\bhasviewed=1/)){ var d = new Date(); d.setTime(d.getTime()+2592000000); var exp = d.toString(); document.cookie = "hasviewed=1; expires="+exp+";"; var confirmbox = confirm("Welcome to "+fname+", Please sign our guestbook."); if (confirmbox == true) { document.location.href=gurl } } } //--> </script>
|
|
|
Post by Selest on Mar 30, 2006 12:19:04 GMT
Thanks got the code in and its working a treat......*grins*
|
|
$©Ø®Þ!@Ω™
Head - Coder
Scorpian - Beware the Sting!
Posts: 32
|
Post by $©Ø®Þ!@Ω™ on Mar 31, 2006 4:08:56 GMT
no prob
|
|