2013-07-24, 10:48 AM
I need some help implanting a code on my site. It uses javascript. i am wanting to import it to mybb and use cookies so my users only see it once instead of everytime loading a page.
i am also trying to find a way to make it into a custom page using a template through mybb template system.
this is the implantation code:
also i am wanting to know how i can add cookie settings to it.
what it looks like on the site:
![[Image: bad_idea.png]](https://camo.mybb.com/b1d0c2b24da6432bebafe5621450846147c866e9/687474703a2f2f7777772e616e696d656e6577732e746b2f6261645f696465612e706e67)
what it is suppose to look like:
![[Image: supposetobe.png]](https://camo.mybb.com/9fe604ab28df3394b8201f5b23c0d83a8af66344/687474703a2f2f7777772e616e696d656e6577732e746b2f737570706f7365746f62652e706e67)
i am also trying to find a way to make it into a custom page using a template through mybb template system.
this is the implantation code:
<script type="text/javascript">
var agreewin=dhtmlmodal.open("agreebox", "iframe", "modalfiles/agreement.htm", "This Page's Terms of service", "width=590px,height=450px,center=1,resize=1,scrolling=0", "recal")
agreewin.onclose=function(){ //Define custom code to run when window is closed
var theform=this.contentDoc.getElementById("eula") //Access form with id="eula" inside iframe
var yesbox=theform.eulabox[0] //Access the first radio button within form
var nobox=theform.eulabox[1] //Access the second radio button within form
if (yesbox.checked==true)
alert("You agreed to the terms")
if (nobox.checked==true)
alert("You havent agreed"),
window.location.href = "http://stackoverflow.com";
return true;
}
</script>
i am wanting to know is how can i get this code to work. i figured out how to show up a template in it but it just loads up to the left and not where i need it to be. also i am wanting to know how i can add cookie settings to it.
what it looks like on the site:
what it is suppose to look like: