Including an age verification popup on WebTVs with adult content
support, ws.webtv, home, installation, cookies, info
We have prepared a basic age verification script (with text in English...) for you to include into your WebTV. This script will overlay a dark red layer (94% opaque) over the WebTV, with an age verification box, so that visitors have to confirm that they have the required age in order to view the WebTV normally or exit otherwise.
NOTE: After a visitor
confirms its age, the script will save a cookie named age_verification_notice_visibility, with an expiration of 1 day.
Use this as a starting point:
Feel free to customize it!.
1) Copy the code you'll find below and paste it into Configuration » General » Additional HTML Code... » Statistics & </body> section HTML code
2) Change
the default value of the required_age variable (18) as required.
3) Save
<script>
var required_age = 18;
function checkAgeVerificationNoticeVisibility()
{
var cookieNoticeVisibility = getCookie('age_verification_notice_visibility');
if ( !cookieNoticeVisibility || cookieNoticeVisibility == 1 )
{
$('div.pageWrapper').prepend(
'<div id="age_notice" style="display:block; width:100%; height:3000px; position:fixed; background:#200; background:rgba(35,0,0,0.94); top:0; z-index:999;">'+
' <br>'+
' <div style="display:block; background:#000; border: 2px solid #b44; border-radius:10px; width:80%; margin:0 auto; margin-top: 20%; padding:15px; text-align:center; color:#fff; line-height:20px; font-size:13px; box-shadow: 0px 0px 20px rgba(0,0,0,1);">'+
' <strong>CONTENT WARNING</strong><br>'+
' <div style="display:block; padding:10px;">'+
' This site may contain adult content. It is intended only for ADULTS. If you are under the age of '+required_age+' or if such material offends you, please EXIT now<br>'+
' </div>'+
' <a href="#" style="display:inline-block; float:none; margin:5px; margin-bottom:0; padding:6px; text-decoration:none; background:#007700; color:#fff; border-radius: 5px;" onclick="hideAgeVerificationNotice(); return false;"><strong>'+required_age+'+ ENTER</strong></a>'+
' <a href="#" style="display:inline-block; float:none; margin:5px; margin-bottom:0; padding:6px; text-decoration:none; background:#880000; color:#fff; border-radius: 5px;" onclick="exitPage();return false;"><strong>EXIT: I AM UNDER '+required_age+'</strong></a>'+
' <br>'+
' </div>'+
'</div>'
);
}
};
function exitPage()
{
window.location.href="http://www.google.com";
}
function hideAgeVerificationNotice()
{
setCookie('age_verification_notice_visibility',0,1);
$('#age_notice').remove();
}
checkAgeVerificationNoticeVisibility();
</script>