|
Post by Wormopolis on May 27, 2012 1:47:40 GMT -8
Browsers tested: IE, FF and Chrome placement: global header
This code will allow you to have popups appear for specific boards in your forum that give instructions or hints to a new user about what that board is for. It activates upon registration and will last for however many days you set it, or if they clear cookies (since that is the only way to do this). the popup will only appear in the thread listing of each board and not inside a thread if they go there first. once they close the popup, they wont have to see it again.
includes a CSS classname so you can style how the popup looks
<style type="text/css"> .NUguideDiv { top:200px; left:25%; background-color:#000000; border:#0044FF solid 2px; height:200px; width: 50%; padding: 10px; } </style>
<script type="text/javascript"> <!-- // new user forum guide // v1.0 // by Wormopolis - www.wormocodes.com // request by Artistic // keep header intact
var NUhowManyDaysCookieWillLast=30; //how many days before cookie expires regardless of them seeing all the popups
var NUguideData=new Array(); NUguideData['community']='This area is for general nonsense type threads. you can pretty much ppost anything you want in here that doesn\'t break any rules.'; NUguideData['commhelp']='This area is for getting help with your proboards basic functions. this isn\'t for making code requests or for asking help with codes you already have installed.'; NUguideData['codesubs']='This area is for new code submissions, either by me or from anyone that wants to submit a code to my database. not all of these codes have been fully tested, so if you install one of them, be sure to let us know if something doesn\'t work. there are also various sub-boards that I use for testing codes in progress.'; NUguideData['codereqs']='This area is for requesting that a new code be created. Depending on its complexity and time to invest in it, the time it takes to complete it varies. This isn\'t an area for help with a code you already have installed.'; NUguideData['codeother']='This area is for help with codes that other people have written. I cannot say if I will be able to help or not, but it never hurts to ask. If the code says it cannot be reposted, please just link to where you got it.'; NUguideData['codedbhtml']='This area is for codes that arent really javascript, but just HTML things you can utilize.'; NUguideData['brutal']='This area is for submitting your forum to have Jah review it. Read the disclaimer.'; NUguideData['gffb']='This area is for guest feedback that doesnt require a login to post.'; NUguideData['gfaf']='This area is for posting an affiliation request. There is a short form to fill out that will actually display your thumbnail next to your board name.'; NUguideData['BOARDID']='CONTENT FOR THE POPUP';
// No need to edit below unless you know what you are doing
if (pb_action=='register2') { //setup cookie var NUcookie=''; for (NUdata in NUguideData) { NUcookie+=NUdata+','; } NUcookie=NUcookie.slice(0,NUcookie.length-1); var expt=new Date(); expt.setDate(expt.getDate()+NUhowManyDaysCookieWillLast); document.cookie="NUDATA="+NUcookie+";expires="+expt; } if (pb_action=='boardindex') { if (document.cookie.match(/NUDATA=(.*?)(;|$)/)) { var NUcookie=RegExp.$1; var boardhold=location.href.split(/board=/)[1]; boardhold=(boardhold.split('&')[0] || boardhold); if (NUcookie.match(new RegExp('(^|\,)'+boardhold+'(\,|$)','')) && NUguideData[boardhold]) { var NUnwdv=document.createElement('div'); NUnwdv.className='NUguideDiv'; NUnwdv.innerHTML="<input type='checkbox' style='float:right' onclick='this.parentNode.style.display=\"none\";'><font style='float:right'>Close</font><br><br><br><center>" + NUguideData[boardhold] + "</center><br><br>"; NUnwdv.style.position='absolute'; document.body.appendChild(NUnwdv); NUcookie=NUcookie.replace(new RegExp('(^|\,)'+boardhold+'(\,|$)',''),','); var expt=new Date(); expt.setDate(expt.getDate()+NUhowManyDaysCookieWillLast); document.cookie="NUDATA="+NUcookie+";expires="+expt; } } }
// --> </script>
Preview: actually using it on this site now if you register as a new account.
|
|