vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Login form problems (https://vborg.vbsupport.ru/showthread.php?t=208661)

mk craig 42 03-18-2009 01:03 AM

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

http://img10.imageshack.us/img10/7084/lolmpd.png

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.

Lynne 03-18-2009 03:09 AM

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" />


mk craig 42 03-18-2009 11:49 AM

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.

hqlman 03-18-2009 03:07 PM

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

mk craig 42 03-18-2009 05:52 PM

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


All times are GMT. The time now is 01:37 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.01804 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete