vb.org Archive

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

hqlman 03-14-2009 07:39 PM

Forum Login BOX
 
Hi guys im not a pro with coding so pls be nice,

Ive made a html homepage for my site, and i have integrated a login box on this page for the forums, ive managed to code the box so that when the user enters their username and password they are logged in and redirected to the forum index, but if the user returns to the homepage, they still see the login box ,

I need help with the coding, such that if a user is logged in and they return to the homepage they see that they are logged in and unread messages etc exactly like we have on vbulletin forum, and maybe a log out button too,

Below is the code i have used, pls tell me what else i need to do,
Thanks in advance :)

Code:

<form action="forums/login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
                                                                                                                          <table cellpadding="0" cellspacing="3" border="0">
                <tr>
                        <td class="smallfont"><label for="navbar_username">User Name</label></td>
                        <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="17" accesskey="u" tabindex="101" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
                        <td class="smallfont" nowrap="nowrap">&nbsp;</td>
                </tr>
 
                <tr>
                        <td class="smallfont"><label for="navbar_password">Password</label></td>
                        <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="17" tabindex="102" /></td>
                        <td>&nbsp;</td>
                </tr>
                </table>
                <span class="smallfont">
                <input name="submit" type="submit" class="button" accesskey="s" tabindex="104" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." value="Log in" />
                <input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" /><label for="cb_cookieuser_navbar">Remember Me?</label></span>
                <!--<a href="forums/register.php" class="style2">REGISTER</a>-->
                  <input type="button" onClick="parent.location='forums/register.php'" value="Register" />
                 
                 
                    <input type="hidden" name="s" value="" />
                    <input type="hidden" name="do" value="login" />       
                    <input type="hidden" name="url" value="/forums/" />       
                    <input type="hidden" name="vb_login_md5password" />
                 
                    <input type="hidden" name="vb_login_md5password_utf" />
                  <tr><td>&nbsp;</td>
                </tr>
                                                                                                                </form>


Mr-Moo 03-15-2009 02:41 PM

There are already actually a couple things on the forum about this, try using some of the search in the future.

Here are two examples:
https://vborg.vbsupport.ru/showthrea...ighlight=login
https://vborg.vbsupport.ru/showthrea...t=login&page=2

By the way - Us coders are here to help, we are not always mean :)

Taragon 03-15-2009 02:45 PM

Also this http://www.vbulletin.com/forum/showp...7&postcount=17 definitely works.

Demo: http://die16-clan.com/forum/

hqlman 03-15-2009 06:49 PM

Thanks for the help guys, i did use the search bar and found the programs uve shown me, but only 1 works to my requirements which i couldnt get to work at first but now i have
https://vborg.vbsupport.ru/showthrea...ighlight=login

I still need a bit more help, after logging in the user sees

https://vborg.vbsupport.ru/external/2009/03/83.jpg


I would like to add some more details like we can see on a vbulletin:
https://vborg.vbsupport.ru/external/2009/03/84.jpg

I would like to have those notification in the empty space i have on my homepage as shown in the first picture, but i do not know the code required and where it should go,

thanks in advance

Mr-Moo 03-16-2009 04:52 AM

You have to copy the functions from the styles in your navbar to that location. For example, look at the navbar file and look for the private messages code and copy that over. Keep tinkering around with this until you have your desired results.

Hope that helps!

hqlman 03-16-2009 09:41 PM

Hi, Thanks for your reply, im not very good with this, so below is my code from the navbar and i cannot find anything to do with the PM system,

Could you please point it out for me, and tell me how i could use it,

Many thanks

Code:

<br />
<div class="breadcrumb">
 <div class="bcright">
  <div class="bcleft">
  <a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1">$vboptions[bbtitle]</a> $navbits[breadcrumb] <if condition="$navbits['lastelement']">&raquo; $navbits[lastelement]</if>
  </div>
 </div>
</div>

<br />

<div style="border-bottom: 3px solid #000000;">
</div>

<br />



<if condition="$show['member']">
<div style="width: 100%;">
<iframe src="shoutbox.php" width="100%" height="190" frameborder="no" scrolling="yes" style="overflow-x: hidden;"></iframe>
</div>
<br />

<div style="border-bottom: 3px solid #000000;">
</div>
</if>

<br />

<!-- donationbar -->
$cybpaypal_donbar
<!-- / donationbar -->



<if condition="$show['notices']">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
                <td class="thead">$vbphrase[notices]</td>
        </tr>
        <tr>
                <td class="alt1">$notices</td>
        </tr>
        </table>
        <br />
</if>

<if condition="$show['forumdesc']">
        <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
        <tr>
                <td class="alt1" width="100%"><strong>$foruminfo[title]</strong> <span class="smallfont">$foruminfo[description]</span></td>

        </tr>
        </table>
        <br />
</if>

<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->

        <if condition="$show['searchbuttons']">
        <!-- header quick search form -->
        <div class="vbmenu_popup" id="navbar_search_menu" style="display:none" align="$stylevar[left]">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr>
                        <td class="thead">$vbphrase[search_forums]</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                                <form action="search.php?do=process" method="post">

                                        <input type="hidden" name="do" value="process" />
                                        <input type="hidden" name="quicksearch" value="1" />
                                        <input type="hidden" name="childforums" value="1" />
                                        <input type="hidden" name="exactname" value="1" />
                                        <input type="hidden" name="s" value="$session[sessionhash]" />
                                        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                                        <div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" /></div>
                                        <div style="margin-top:$stylevar[cellpadding]px">
                                                <label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />$vbphrase[show_threads]</label>
                                                &nbsp;
                                                <label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />$vbphrase[show_posts]</label>
                                        </div>
                                </form>
                        </td>
                </tr>
                <if condition="$vboptions[threadtagging]">
                <tr>
                        <td class="vbmenu_option"><a href="tags.php$session[sessionurl_q]" rel="nofollow">$vbphrase[tag_search]</a></td>
                </tr>
                </if>
                <tr>
                        <td class="vbmenu_option"><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[advanced_search]</a></td>
                </tr>
                $template_hook[navbar_search_menu]
                </table>
        </div>
        <!-- / header quick search form -->
        </if>

        <if condition="$show['member']">
        <!-- user cp tools menu -->
        <div class="vbmenu_popup" id="usercptools_menu" style="display:none" align="$stylevar[left]">
                <table cellpadding="4" cellspacing="1" border="0">

                <tr><td class="thead">$vbphrase[quick_links]</td></tr>
                <if condition="$vboptions['enablesearches']"><tr><td class="vbmenu_option"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td></tr></if>
                <tr><td class="vbmenu_option"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td></tr>
                <tr><td class="vbmenu_option"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&amp;focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_contacts]</a></td></tr>
                $template_hook[navbar_quick_links_menu_pos1]

                <tr><td class="thead">$vbphrase[networking]</td></tr>
                <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=buddylist"><if condition="$show['friends_and_contacts']">$vbphrase[contacts_and_friends]<else />$vbphrase[contacts]</if></a></td></tr>
                <if condition="$show['quick_links_groups']">
                        <tr><td class="vbmenu_option"><a href="group.php$session[sessionurl_q]">$vbphrase[social_groups]</a></td></tr>
                </if>
                <if condition="$show['quick_links_albums']">
                        <tr><td class="vbmenu_option"><a href="album.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[pictures_and_albums]</a></td></tr>
                </if>
                $template_hook[navbar_quick_links_menu_pos2]

                <tr><td class="thead"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_control_panel]</a></td></tr>
                <if condition="$show['siglink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editsignature">$vbphrase[edit_signature]</a></td></tr></if>
                <!--<if condition="$show['avatarlink']"><tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editavatar">$vbphrase[edit_avatar]</a></td></tr></if>-->
                <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editprofile">$vbphrase[edit_your_details]</a></td></tr>
                <tr><td class="vbmenu_option"><a href="profile.php?$session[sessionurl]do=editoptions">$vbphrase[edit_options]</a></td></tr>
                $template_hook[navbar_quick_links_menu_pos3]

                <tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
                <if condition="$show['pmmainlink']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]" rel="nofollow">$vbphrase[private_messages]</a></td></tr></if>
                <tr><td class="vbmenu_option"><a href="subscription.php$session[sessionurl_q]" rel="nofollow">$vbphrase[subscribed_threads]</a></td></tr>
                <tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[your_profile]</a></td></tr>
                <if condition="$show['wollink']"><tr><td class="vbmenu_option"><a href="online.php$session[sessionurl_q]">$vbphrase[whos_online]</a></td></tr></if>
                $template_hook[navbar_quick_links_menu_pos4]

                </table>
        </div>
        <!-- / user cp tools menu -->

        <if condition="$notifications_total">
        <!-- notifications menu -->
        <div class="vbmenu_popup" id="notifications_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr><td class="thead" colspan="2">$vbphrase[your_notifications]</td></tr>
                $notifications_menubits
                </table>
        </div>
        <!-- / notifications menu -->
        </if>

        </if>
<!-- / NAVBAR POPUP MENUS -->

<!-- PAGENAV POPUP -->
        <div class="vbmenu_popup" id="pagenav_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr>
                        <td class="thead" nowrap="nowrap">$vbphrase[go_to_page]</td>
                </tr>
                <tr>
                        <td class="vbmenu_option" title="nohilite">
                        <form action="$vboptions[forumhome].php" method="get" onsubmit="return this.gotopage()" id="pagenav_form">
                                <input type="text" class="bginput" id="pagenav_itxt" style="font-size:11px" size="4" />
                                <input type="button" class="button" id="pagenav_ibtn" value="$vbphrase[go]" />
                        </form>
                        </td>
                </tr>
                </table>
        </div>
<!-- / PAGENAV POPUP -->
</if>

$ad_location[ad_navbar_below]


Mr-Moo 03-18-2009 03:47 AM

Out of the code you provided, this was displayed
PHP Code:

<if condition="$show['pmmainlink']"><tr><td class="vbmenu_option"><a href="private.php$session[sessionurl_q]rel="nofollow">$vbphrase[private_messages]</a></td></tr></if> 

That is the code you should be placing into your HTML page, however you will run into some issues since that is not HTML, but PHP mix.

For your reference, here is my PM information from my style:
PHP Code:

<!-- breadcrumbloginpm info -->
<
table class="thead" style="height: 30px; width: 988px; margin-bottom: 4px;">
<
tr width="988px">
<!-- <
div style="width: 988px;"> -->
    <
td class="alt1" style="background: #e70015 url(http://exomagic.com/forum/images/exomagic/misc/main_bg.png) repeat-x top left; padding: 2px; width: 988px;">
        <if 
condition="is_array($navbits)">
            <
table cellpadding="0" cellspacing="0" border="0" width="100%">
            <
tr width="100%">
                <
td><a href="#" onclick="history.back(1); return false;"></a></td>
                <
td>&nbsp;</td>
                <
td width="100%"><span class="navbar"><a href="$vboptions[forumhome].php$session[sessionurl_q]accesskey="1">$vboptions[bbtitle]</a></span$navbits[breadcrumb]</td>
            </
tr>
            <
tr>
            <
td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><if condition="$_SERVER['REQUEST_METHOD'] == 'POST'">&raquo;<else />&raquo;</if> <strong>$navbits[lastelement]</strong></td>
            </
tr>
            </
table>            
        <else />
            <
div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]accesskey="1"></a> <strong>$vboptions[bbtitle]</strong></div>
        </if>
    </
td>    
    
</
tr>
</
table>
<!-- / 
breadcrumbloginpm info --> 


hqlman 03-18-2009 07:44 AM

thanks for the reply, your code seems to be a lot more complexed than mine,

I had changed th homepage to php so I could use the php script from the add on, have u had a look at the add on script? I am not 100% sure exactly where I'll have to put the code you located in the given filed of the ad on:

This for ure help

Mr-Moo 03-18-2009 04:35 PM

If you insure the globals.php and functions files are included it should display properly.

You also need to display the template :p

Not sure which script you are using, can you post the link?

hqlman 03-18-2009 05:13 PM

This is the script im using, the author describes that you can add things to your login box, but there;s no support, im glad there's still people like you around :)


All times are GMT. The time now is 09:01 PM.

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.01229 seconds
  • Memory Usage 1,839KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete