Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2009, 01:03 AM
mk craig 42 mk craig 42 is offline
 
Join Date: Feb 2009
Location: Bedford
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Login form problems

Hey, I've recently added my own sidebar, adding a user information section aswell, that shows PM's and avatar once logged in, but thats all working perfectly..

I've been trying for countless amount of hours trying to get the login form for guests to show correctly, but it just isn't working for me..
Here is a screenie to help you understand more



As you can see the whole form is messed up.
here is my code for the login form.

Code:
<!-- login form -->
        <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])">
        <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script>
        
        <input type="image" src="images/styles/bgear/style/button_go.gif" value="" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" />
        <input type="password" class="bginput" name="vb_login_password" id="navbar_password" size="10" tabindex="102" />
        <input type="text" class="bginput" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" />
        <span>Log In:</span>
        
        <input type="hidden" name="s" value="$session[sessionhash]" />
        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
        <input type="hidden" name="do" value="login" />
        <input type="hidden" name="cookieuser" value="1" />
        <input type="hidden" name="vb_login_md5password" />
        <input type="hidden" name="vb_login_md5password_utf" />
        </form>
        <!-- / login form -->
Im wanting it somewhere along the lines of:

Log In: [Username]
..........[Password] GO

If thats understandable.
Many thanks in advanced, and i bow down to you if you can do this for me, as i've tried for many hours and failed.
Reply With Quote
  #2  
Old 03-18-2009, 03:09 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You don't have them in the correct order in your form. These are in the correct order, but I'm not sure how it will look without using a table or some sort of css.
HTML Code:
        <span>Log In:</span>
        <input type="text" class="bginput" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" />
        <input type="password" class="bginput" name="vb_login_password" id="navbar_password" size="10" tabindex="102" />
        <input type="image" src="images/styles/bgear/style/button_go.gif" value="" tabindex="104" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" />
Reply With Quote
  #3  
Old 03-18-2009, 11:49 AM
mk craig 42 mk craig 42 is offline
 
Join Date: Feb 2009
Location: Bedford
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, thats why i don't understand why its not working, i tried them all the right way around, but it didnt seem to show like that, so i tried mixing them up a little and got more progress that i did before, so i continued to fiddle around with the code arrangements.

I tried your code it didn't work, thanks anyway, I think i shall just install a vb 3.8 login and have a link to login & register for guests that link to the external login page.
Reply With Quote
  #4  
Old 03-18-2009, 03:07 PM
hqlman's Avatar
hqlman hqlman is offline
 
Join Date: Aug 2008
Posts: 96
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, sorry to go off topic here, but i got a login box working for my site, but i still dont know how to get the avatar and PM to show in the area once a user has logged in,

I have posted here: https://vborg.vbsupport.ru/showthread.php?t=208336

If you could help me out, that would be gr8

thanks
Reply With Quote
  #5  
Old 03-18-2009, 05:52 PM
mk craig 42 mk craig 42 is offline
 
Join Date: Feb 2009
Location: Bedford
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey man, i managed to get it working by adding codes from other templates lol.
I seem to be good at that :P

Here is my code for what you are looking for.

Code:
<if condition="$show['guest']">
        <div class="smallfont">
<img src="URL FOR GUEST IMAGE HERE">
<strong>Welcome,</strong> Guest
<p>
Already Member? <a href="http://or-gaming.com/forum/usercp.php?langid=1">Login</a><br>
Or <a href="http://or-gaming.com/forum/register.php">Register</a> an account
</div>
</if>
<a href="http://www.YOURSITE.com/forum/profile.php?$session[sessionurl]do=editavatar"><img src="http://www.YOURSITE.com/forum/image.php?u=$bbuserinfo[userid]" alt="Your Avatar" border="0" /></a>
This code is the one you are wanting i think.
This shows the users avatar when logged in.. also has a log out {username} at the bottom, with PM's aswell.

It also has alternative text for guests with links to the Register page and Login page, with an image just above.

Code:
<if condition="$show['member']">
	<div class="smallfont">
<div ALIGN="center"> 
<a href="http://www.YOURSITE.com/forum/profile.php?$session[sessionurl]do=editavatar"><img src="http://www.YOURSITE.com/forum/image.php?u=$bbuserinfo[userid]" alt="Your Avatar" border="0" /></a>
</div>
<br>
		<strong><phrase 1="$bbuserinfo[username]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />
		<phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
		<if condition="$show['notifications']">
			<div><span id="notifications"><a href="usercp.php$session[sessionurl_q]">$vbphrase[your_notifications]:</a> <strong>$notifications_total</strong></span></div>
			<if condition="$show['popups']">
				<script type="text/javascript"> vBmenu.register("notifications"); </script>
			<else />
				<script type="text/javascript" src="clientscript/vbulletin_notifications_nopopups.js?v=$vboptions[simpleversion]"></script>
				<script type="text/javascript"> vBulletin.register_control("vB_Notifications_NoPopups", "notifications");  </script>
			</if>
		<else /><if condition="$show['pmstats']">
			<div><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></div>
		</if></if>

		<if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
	</div>
<br>
<div ALIGN="center"> 
<if condition="$show['member']"><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')"><img src="$stylevar/logout.gif"
border="0" width="110" height="26" alt="<phrase 1="$bbuserinfo[username]">$vbphrase[log_out_x]</phrase>"></a></if>
</div>
<else />
</if>
</div>
</td>
</tr>
Obviously edit things in red to suit your forums needs
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:53 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06386 seconds
  • Memory Usage 2,214KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete