View Single Post
  #2368  
Old 08-05-2005, 12:04 PM
Telkman Telkman is offline
 
Join Date: Jul 2003
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can pretty much copy the login code from the navbar, with a couple of changes - it's a while since I did it, so I'll just paste what I use. I have it change to a welcome panel when the user is logged in.

The html will be slightly different, and it's lacking any indentation, but you can get the idea... screenshot(s) below.


HTML Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" width="100%"><thead><tr><td class="tcat" style="text-align: center"><strong><if condition="$showmemberwelcome">Welcome, $bbuserinfo[musername]<else />Log In</if></strong></td></tr></thead>
<tbody><tr><td class="alt1">
<div class="smallfont">

<if condition="$showmemberwelcome">
<script type="text/javascript">
<!--
function log_out()
{
	ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('$vbphrase[sure_you_want_to_log_out]'))
	{
		return true;
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}
//-->
</script>
Last Visit: $pmbox[lastvisitdate] at <span class="time">$pmbox[lastvisittime]</span>
<br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase>
<a href="/forum/search.php?$session[sessionurl]do=getnew">New Posts</a>: $home[newposts] Posts in $home[newthreads] Threads.
<br /><a href="/forum/login.php?$session[sessionurl]do=logout&amp;u=$bbuserinfo[userid]" onclick="return log_out()" title="Log Out">Log Out</a>
</div></td></tr>

<else />

<div align="center">
<form action="/forum/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
<script type="text/javascript" src="/forum/clientscript/vbulletin_md5.js"></script>
<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">

<tr>
<td align="right" class="smallfont"><strong>$vbphrase[username]:&nbsp;&nbsp;</strong></td>
<td align="left"><input type="text" class="button" name="vb_login_username" id="navbar_username" size="12" accesskey="u" tabindex="1" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td></tr>

<tr><td align="right" class="smallfont"><strong>$vbphrase[password]:&nbsp;&nbsp;</strong></td><td align="left"><input type="password" class="button" name="vb_login_password" size="12" accesskey="p" tabindex="2" /></td></tr>

<tr><td align="center" colspan="2">
<table><tr><td>
<input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" /></td><td class="smallfont"><label for="cb_cookieuser_navbar">$vbphrase[remember_me]</label></td></tr></table>
<input type="submit" class="button" value="$vbphrase[log_in]" tabindex="4" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></td></tr></table>

<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="forceredirect" value="1" />			
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form></div></div></td></tr><tr><td class="alt2" style="text-align:center; padding: 10px 0 10px 0;"><a href="/forum/register.php?$session[sessionurl]"><strong>Register</strong></a></td></tr>

</if>

</tbody></table><br />
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02205 seconds
  • Memory Usage 1,804KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete