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 11-05-2009, 04:14 PM
ctlatino ctlatino is offline
 
Join Date: Aug 2007
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Vbulletin login

Hey guys i have a vbulletin board and i wanted to use the member systeme for my website. So fare it's not looking to good. I have been cheking the web for solutions but nothing ...

I tryed 2 things so fare ...

1. Include the global.php file and added a form to login to the board from my homepage. When i log i get the welcome message then i am redirected back to the home page but i am not logged in. I made a print_r($vbulletin) and the userid stays to 0 so the login did not save. If i take out the global.php file and try to log in i get the same message but when i go back on the board i am logged in. kind of weird ...

2. I tryed to tweek the login.php file and insert sessions. I added the session_start to the global.php file and in my homepage then added $_SESSION['username'] = $vbulletin->GPC['vb_login_username']; after the log in but for some reason the session is not created ...

--------------- Added [DATE]1257448824[/DATE] at [TIME]1257448824[/TIME] ---------------

Ok i finaly got this to work ... It's not hars ... it's just porly explained

PHP Code:
<?php

chdir
("board/"); 
require(
'./global.php');   
chdir("../"); 

    
$vboptions['homeurl'] = $vbulletin->options['homeurl'];
    
$vboptions['bburl'] = $vbulletin->options['bburl'];
    
$vboptions['bbtitle'] = $vbulletin->options['bbtitle'];
    
$vboptions['forumhome'] = $vbulletin->options['forumhome'];
    
$vboptions['contactuslink'] = $vbulletin->options['contactuslink'];
    
$bbuserinfo['userid'] = $vbulletin->userinfo['userid'];
    
$bbuserinfo['usergroupid'] = $vbulletin->userinfo['usergroupid'];
    
$bbuserinfo['username'] = $vbulletin->userinfo['username'];
    
$bbuserinfo['email'] = $vbulletin->userinfo['email'];
    
$session['sessionurl'] = $vbulletin->session->vars['sessionurl'];
    
$session['sessionhash'] = $vbulletin->session->vars['sessionhash']; 
?>
              <table border="0" cellspacing="5" cellpadding="0" align="center"> 
                <tr> 
                  <form action='/board/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'> 
                  <SCRIPT type=text/javascript src="http://dramis.info/board/clientscript/vbulletin_md5.js?v=384"></SCRIPT>  <td> 
                    
<?php
if ($bbuserinfo['userid']!=0){
    echo 
"<center>Welcome back ".$bbuserinfo['username']."!<br><a href='index.php?log=fermer'>Logout</a><center>";
}else{
    print (
'<table border="0" cellSpacing="3" cellPadding="0">
                        <tr>
                            <td colSpan="2">
                            <input accessKey="u" onblur="clickrecall(this,\'Username\')" id="navbar_username" class="search" onfocus="if (this.value == \'User Name\') this.value = \'\';" tabIndex="101" onclick="clickclear(this, \'Username\')" value="Username" size="19" name="vb_login_username"></td>
                            <td class="smallfont" noWrap>
                            <label for="cb_cookieuser_navbar">
                            <input accessKey="c" id="cb_cookieuser_navbar" tabIndex="103" value="1" type="checkbox" name="cookieuser"></label></td>
                        </tr>
                        <tr>
                            <td colSpan="2">
                            <input id="navbar_password" class="search" tabIndex="102" size="19" type="password" name="vb_login_password"></td>
                            <td>
                            <input accessKey="s" class="search" title="Enter your username and password in the boxes provided to login, or click the \'register\' button to create a profile for yourself." tabIndex="104" value="Log in" src="http://dramis.info/images/ok.jpg" type="image" name="I1"></td>
                        </tr>
                    </table>
                    <input type="hidden" name="s">
                    <input value="guest" type="hidden" name="securitytoken">
                    <input value="login" type="hidden" name="do">
                    <input type="hidden" name="vb_login_md5password">
                    <input type="hidden" name="vb_login_md5password_utf">'
);
}
?>         
                      
                    </td> 
                    </form> 
                  </tr> 
              </table>
Works like a charme
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 05:30 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.03392 seconds
  • Memory Usage 2,190KB
  • 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
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)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
  • (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_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