I did something I thought was kinda a neat on my site's homepage. A login/welcome box on my home page that checks a visitors infopop cookie to see if they are logged in or not. If they are logged in it displays a Welcome Username message and if not displays a login box that redirects back to the home page. Note I just swiped infopop's stuff to do this, I didnt program it myself. Im fairly certain it will only work on infopop hosted sites.
I put this in the head section of my webpage...
<script id="siteGlobalsJS" type="text/javascript">
// set globals localised for site
var site_id_cookie = 'site_XXXXXXXXX'; // this is the unique site login info cookie
</script>
<script id="constructorJS" type="text/javascript" src="/infopop/jscript/constructor.js"></script>
You need to replace XXXXXXXXX with your site id, you can view source on your boards main page to see what it should be.
In the body area I put this:
<table width="98%" border="1">
<tr>
<td id="gs_login_text">
<form method="POST" action="http://yoururl.com/6/ubb.x" name="LOGIN">
<p>Username:
<input maxlength="40" name="LOGIN_USERNAME" size="13" value="">
</p>
<p> Password:
<input maxlength="50" name="LOGIN_PASSWORD" size="13" type="password">
<input type="hidden" name="IS_USING_ENABLE_COOKIES" value="Y">
<input type="hidden" name="IS_COOKIE_ENABLED" value="Y">
<input type="hidden" name="IS_ADVANCED_UI_DISABLED">
<input type="hidden" name="s" value="XXXXXXXXX">
<input type="hidden" name="ra" value="http://yoururl.com/yourcallingpage.html?s=458609942&ORIGINAL_REFERRER_URL=http%3A%2F%2Fyoururl.com%2Fyourcallingpage.html%3Fs%3D458609942">
<input type="hidden" name="a" value="LOGIN">
<input type="hidden" name="x_popup" value="">
<input name="SUBMIT" type="submit" value="Login">
</p>
</form>
</td>
</tr>
</table>
<script type="text/javascript"><!-- //Logged in? Display name.
if(gs_cookie.parsed && document.getElementById('gs_login_text') && gs_cookie.u && gs_cookie.u!='' && gs_cookie.u!=null ){
showLoginMsg();
}
function showLoginMsg(){
var separator = "»";
var login_hello_msg = "Hello";
var logout_msg = "logout";
logout_msg = logout_msg.link("http://yoururl.com/6/ubb.x?a=lgt&s=XXXXXXXXX");
var msg = separator + ' ' + login_hello_msg + ' ' + gs_cookie.u.replace(/\+/g," ") + ' ' + '[' + logout_msg + ']';
document.getElementById('gs_login_text').innerHTML = msg;
}// end fn
--></script>
You need to change yoururl.com to your website, yourcallingpage.html to the page your locating this on, and XXXXXXXXX with the site id number you got for above.
You can see the resulting login box on the upper right side of this page:
http://www.shining-armor.com/kort_index.shtmlIf a member is logged in the login stuff is replaced with
>>Hello Username[logout]
Pete
"Dammit Jim I'm a COBOL Programmer not a Webmaster!"