|
Post by Wormopolis on Dec 19, 2008 14:29:17 GMT -8
Browser Tested: IE and FF Placement: Global header AND Global Footer
Replaces Reply/new post buttons with ones that will force a member to login or create an acct. Once created, will return person to the post they originally wanted to make.
<script type="text/javascript"> <!-- // Tricky reply buttons // GLOBAL HEADER PART // By Wormopolis - concept by PM // Do not repost - keep header intact
if (!location.href.match(/ion=login/i) && !location.href.match(/ion=register/i)) { if (document.cookie.indexOf("wherewasI=")>-1) { var placer=document.cookie.indexOf("wherewasI=")+10; var placer_end=document.cookie.indexOf(";",placer); if (placer_end==-1) placer_end=document.cookie.length; gobackto=unescape(document.cookie.substring(placer,placer_end)); date_exp=new Date(); date_exp.setMinutes(date_exp.getMinutes()-10); document.cookie="wherewasI="+escape(gobackto)+"; expires="+date_exp; location.href=gobackto; } } // --> </script>
<script type="text/javascript"> <!-- // Tricky reply buttons // By Wormopolis // Do Not repost // THIS PART GOES GOES IN GLOBAL FOOTER
if (pb_username=='Guest' && location.href.match(/board=/i)) { var nwThrdImg="http://s3.images.proboards.com/buttons/newthread.gif"; var nwRplyImg="http://s4.images.proboards.com/buttons/reply.gif";
function storePlace(url) { date_exp=new Date(); date_exp.setMinutes(date_exp.getMinutes()+10); document.cookie="wherewasI="+escape(url)+"; expires="+date_exp; location.href="/index.cgi?action=login"; }
var earl=location.href;
var nwUrl=earl.split('action='); if (nwUrl[1]) { nwUrl2=nwUrl[1].split('&'); earl=nwUrl[0]+"action=post&"+nwUrl2[1]; } else { earl+='&action=post'; } if (earl.match(/board=/)) { var butnImg=nwThrdImg; if (earl.match(/thread=/)) butnImg=nwRplyImg;
nwBtn=document.createElement('a'); nwImg=document.createElement('img'); nwImg.src=butnImg; nwImg.border=0; nwBtn.appendChild(nwImg); nwBtn.href="javascript:storePlace(earl);"; iFnts=document.getElementsByTagName('a'); for (a=0; a<iFnts.length; a++) { if (iFnts[a].href.match(/searchpopup/i)) { spc=iFnts[a].parentNode; if (spc.tagName=='FONT') { spc=spc.parentNode.nextSibling.firstChild; } else { spc=spc.nextSibling; } spc.insertBefore(nwBtn.cloneNode(true),spc.lastChild); } }
} } // --> </script>
Preview: kinda self explanatory
|
|