|
Post by Wormopolis on Apr 3, 2010 20:49:55 GMT -8
Browser tested: IE and FF placement: top of global header, global footer + special
Create an element with id='boomerang' somewhere on your site, wether in the side tables or main body, wherever (as long as it appears before the footer code portion runs). This script will create a login button that is global in your site, and will remember where you are when you push it. it will take you to the login screen, and after logging in will take you right back to where you were.
code:
<script type="text/javascript"> <!-- // Boomerang Login Button // GLOBAL HEADER PART // By Wormopolis // Do not repost - keep header intact
if (!location.href.match(/action=(login|register)/i)) { if (pb_username!='Guest' && document.cookie.match(/boomerang=(.*?)(;|$)/)) { gobackURL=RegExp.$1; gobackto=unescape(gobackURL); date_exp=new Date(); date_exp.setFullYear(date_exp.getFullYear()-1); document.cookie="boomerang=erase; expires="+date_exp; if (gobackto !='erase') location.href=gobackto; } } // --> </script>
<script type="text/javascript"> <!-- // Boomerang Login Button // GLOBAL FOOTER // By Wormopolis // Do not repost - keep header intact
// Have a spot with id='boomerang' ready
var buttonBoxTitle="Site Login"; //leave blank if no title desired
buttonbuilder='<center><font size=2>'+buttonBoxTitle+'</font><br><input type="button" value="Login" onclick="document.cookie=\'boomerang='+escape(location.href)+';\'; location.href=\'/index.cgi?action=login\';"></center>'; if (pb_username=='Guest' && document.getElementById('boomerang')) document.getElementById('boomerang').innerHTML=buttonbuilder;
// --> </script>
Preview: currently on this site.. but unless you register you wont be able to test it.
|
|