I am looking for a way to have a thickbox or lightbox open on page load once per session where a person agrees to enter at own risk. and if they want to leave i direct them to google.
Anyone know of how i can do this?
Basically just a div that loads into the box if possible?
I have this but it shows every page load.
Code:
<!-- Duly served from memcache (0.101513147354) --><div class="TB_overlayBG" id="TB_overlay"></div><div style="margin-left: -195px; width: 390px; margin-top: -200px; display: block;" id="TB_window"><div id="TB_ajaxContent" class="TB_modal" style="width: 360px; height: 355px;"><style type="text/css" media="screen">
.exit {
font-weight:bold;
font-size: 28px;
}
.exit a {
color: #666;
margin-right: 8px;
margin-left: 8px;
}
.enter {
font-weight:bold;
font-size: 28px;
}
.enter a {
color: #009900;
font-weight:bolder;
}
.help_title_disc {
font-size:30px;
color: #3F8EFF;
font-weight: bold;
}
.enterexit {
font-size: 18px;
text-align:left;
margin-top:20px;
margin-right:0px;
}
</style>
<div style="padding: 6px;">
<div class="help_title_disc" style="line-height: 100%; margin-bottom: 20px;">
This website contains explicit adult material.
</div>
<div style="font-size: 14px; line-height: 120%;">
By entering this site I am agreeing with the following statements:<br>
<br> - I am familiar with all local laws in my area that pertain to my right to view adult-oriented materials. <br>
- I am at least 18 years of age, and may view adult materials without violating the legal standards of my community.
</div>
<div class="enterexit">
<span class="enter"><a style="color: rgb(0, 153, 0);" href="#" onclick="$('#disc_fla').css('display','inline');tb_remove();document.cookie = 'disclaimer=true; expires=Thu, 2 Aug 2010 20:00:00 UTC; path=/';return false;" title="I agree">Enter</a></span>
<span class="exit"><a style="color: rgb(204, 204, 204);" href="http://www.wikipedia.org/" id="leave">Leave</a></span>
<p style="font-size: 14px;">
Cookies must be <a target="_blank" href="http://www.google.com/support/accounts/bin/answer.py?answer=61416&hl=en&ctx=ch_ServiceLoginAuth&p=mail" title="click here if you don't know how to enable cookies">enabled</a>
</p>
</div></div>
</div>
Basically i pulled that out of some source code of a site that has what i want.
its an adult site so i dont want to put it on here. Unless i can link it???
Last edited by davidjmorin; June 14th, 2010 at 04:33 PM.
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
What i like about the lightbox/TB is that it produces an overlay of the main page.
Is that possible in the method you suggested?
Oh and that code i used above is just ugly coding not mine of course
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
oh i want to mention that i would like to have it as a per session popup as well
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
How about a way to pop a link open automatically using lightbox and js?
If you go to that page now you will see a link on the left and when clicked it opens LB. i want that to open automatically
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
There are both positives and negatives to using JavaScript's confirm(). Using lightbox frameworks will require some editing since they can easily be dismissed by just clicking around them. So, you would have to write your own, or modify previously existing ones. This could take some time.
If you use Javascript's confirm(), then you will lose some extra graphical possibilites, but you will easily be able to ask the user if he/she is 18 or older. This shows modally, so you cannot just dismiss it without answering.
To solve the "once per session" issue is by using a cookie.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
There are both positives and negatives to using JavaScript's confirm(). Using lightbox frameworks will require some editing since they can easily be dismissed by just clicking around them. So, you would have to write your own, or modify previously existing ones. This could take some time.
If you use Javascript's confirm(), then you will lose some extra graphical possibilites, but you will easily be able to ask the user if he/she is 18 or older. This shows modally, so you cannot just dismiss it without answering.
To solve the "once per session" issue is by using a cookie.
Hmmmm i guess i have some more digging. What i really am looking for is not age verification but a pop up that has links in it
Just so happens that the look i like was on an adult site (referenced in another forum )
one for members---------login page
and one to registe----->goes to registration page
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
ok so i have the following code working but how in the heck do i get it to load on page load per user session?
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="thickbox.js"></script>
<link rel="stylesheet" href="thickbox.css" type="text/css" media="screen" />
</head>
<body>
<a href="ajaxOverFlow.html?height=300&width=300" title="add a caption to title attribute / or leave blank" class="thickbox">Scrolling content</a>
<a href="ajax.PHP?height=220&width=400" class="thickbox" title="add a caption to title attribute / or leave blank">No-scroll content</a>
<a href="ajaxLogin.html?height=85&width=250&modal=true" class="thickbox" title="Please Sign In">login (modal)</a>
<a href="ajaxTBcontent.html?height=200&width=300" class="thickbox" title="">Update ThickBox content</a>
</body>
</html>
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
Use a cookie with 0 lifetime. Check to see if the cookie exists...if it doesn't show the lightbox and create the cookie.
Ok so i found exactly what im looking for
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
<link rel="meta" href="http://fantasti.cc/labels.rdf" type="application/rdf+xml" title="ICRA labels">
<!--[if IE 6]> <link rel="stylesheet" type="text/css" href="http://knapsack.fantasti.cc/templates/site/ie.css" > <![endif]-->
<link rel="stylesheet" href="rtainment_files/fantasticc_styles.css" type="text/css" media="screen">
<script type="text/javascript" src="rtainment_files/jquery.js"></script>
<script type="text/javascript" src="rtainment_files/jquery-ui.js"></script>
<script type="text/javascript" src="rtainment_files/thesocialcell.js"></script>
</head>
<body>
<div class="TB_overlayBG" id="TB_overlay"></div>
<div style="margin-left: -195px; width: 390px; margin-top: -200px; display: block;" id="TB_window">
<div id="TB_ajaxContent" class="TB_modal" style="width: 360px; height: 355px;">
<div style="padding: 6px;">
<div class="help_title_disc" style="line-height: 100%; margin-bottom: 20px;">
This website needs members to be registered
</div>
<div style="font-size: 14px; line-height: 120%;">
By entering this site I am agreeing with the following statements:<br>
I am a member
</div>
<div class="enterexit">
<span class="enter"><a style="color: rgb(0, 153, 0);" href="#" onclick="$('#disc_fla').css('display','inline');tb_remove();document.cookie = 'disclaimer=true; expires=Thu, 2 Aug 2010 20:00:00 UTC; path=/';return false;" title="I agree">Enter</a></span>
<span class="exit"><a style="color: rgb(204, 204, 204);" href="http://www.wikipedia.org/" id="leave">Leave</a></span>
<p style="font-size: 14px;">
Cookies must be <a target="_blank" href="http://www.google.com/support/accounts/bin/answer.py?answer=61416&hl=en&ctx=ch_ServiceLoginAuth&p=mail" title="click here if you don't know how to enable cookies">enabled</a>
</p>
</div></div>
</div></div><div style="position: absolute; display: none;" id="jHelperTipContainer"></div><div style="display: none;" id="reportx"></div><div style="position: absolute; display: none;" id="jHelperTipAttrContainer"></div><div style="display: none;" id="helpx"></div>
</body></html>
But cookies are not working. i want it to only show per session
grrrrrrrrrrrrrrrr
Peej thanks for the help BTW.
I attached files
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
That's because you aren't doing what I mentioned in the previous post.
Code:
<script type="text/javascript">
if (document.cookie.indexOf("lightbox=") == -1) {
var now = new Date();
document.cookie = "lightbox=yes";
// code to show the lightbox here
}
</script>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Last edited by davidjmorin; June 15th, 2010 at 12:15 PM.
New to PHP and MySql. Started looking at scripts about a week ago. So far have very little understanding of it. So please be easy with me if I ask a stupid question.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.