Thread: VB Forum
View Single Post
  #10 (permalink)  
Old Aug 30th, 2007, 04:04
split-visionz split-visionz is offline
Junior Member
Join Date: Jun 2006
Location: Here
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

Well heres the code to the login form copied out of my template....

Code: Select all
<!-- login form -->
        <form action="FORUM_DIRECTORY/login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
        <script type="text/javascript" src="FORUM_DIRECTORY/clientscript/vbulletin_md5.js?v=365"></script>
        <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="10" accesskey="u" tabindex="101" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
            <td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />Remember Me?</label></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="10" tabindex="102" /></td>
            <td><input type="submit" class="button" value="Log in" 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." accesskey="s" /></td>
        </tr>
        </table>
        <input type="hidden" name="s" value="" />
        <input type="hidden" name="do" value="login" />        
        <input type="hidden" name="vb_login_md5password" />
        <input type="hidden" name="vb_login_md5password_utf" />
        </form>
        <!-- / login form -->
Change the 'FORUM_DIRECTORY/' to your forum directory.... and then within your pages just include the 'globals.php' from VB and you can check to see if the user id is set to make sure they are logged in....

Code: Select all
 <?php
//change to forum directory, include globals and then check to see if logged in
chdir("./FORUM_DIRECTORY');
require_once("./global.php");
chdir("../");

if (!$vbulletin->userinfo['userid']){
//user not logged in
}
else{
//user is logged in....
}

?>

Last edited by split-visionz; Aug 30th, 2007 at 04:06.
Reply With Quote