Need help with vbulletin database integration with external php file

Status
Not open for further replies.

ClaW

Active Member
193
2011
45
20
Hello guys,
Can anybody help me out with the vbulletin,
Actually I want to integrate the database of vbulletin with the external PHP file.

For example fetching the username and other user info from the vbulletin database and
display on this external PHP .
Is there any way out to do this ?

Thank you :).
 
1 comment
PHP:
<?php
$curdir = getcwd();
#Add your root dir below where it says "ADD ROOT" Example: /home/server/public_html/mainsite/forums
#Do not end with a "/" leave it open like above example.
chdir('/home/public_html/forums');
require_once('/home/public_html/forum/global.php');
chdir($curdir);
if ($vbulletin->userinfo['userid'] == 0) {
#Form Display Code, You can edit the way the Form is layed out here.
  echo "<form id=\"login\" action=\"http://forum.senmanga.com/login.php?do=login\" method=\"post\" onsubmit=\"md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)\">
<script type=\"text/javascript\" src=\"http://forum.senmanga.com/clientscript/vbulletin_md5.js?v=364\"></script>
<label for=\"navbar_username\">Username</label>
<input type=\"text\" class=\"bginput\" style=\"font-size: 11px\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"101\" onfocus=\"if (this.value == 'User Name') this.value = '';\" />
<label for=\"navbar_password\">Password</label>
<input type=\"password\" class=\"bginput\" style=\"font-size: 11px\" name=\"vb_login_password\" id=\"navbar_password\" size=\"10\" tabindex=\"102\" />
<label for=\"cb_cookieuser_navbar\"><input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"103\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" />Remember Me?</label>
<input type=\"submit\" class=\"button\" value=\"Login\" 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\" />
<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>";
#End Form Display Code
} else {
#Display after login completed
  echo "Welcome Back, <b>".$vbulletin->userinfo['username']."</b>";
  if ($vbulletin->userinfo['usergroupid'] == '6' ) {
  echo "&nbsp;|&nbsp;<a href=\"/forums/member.php?1-".$vbulletin->userinfo['username']."\">My Profile</a>";
  echo "&nbsp;|&nbsp;<a href=\"/forums/egncadmincp/index.php\">AdminCP</a>";
  echo "&nbsp;|&nbsp;<a href=\"/forums/egncmodcp/index.php\">ModCP</a>";
  }
}
?>
 
Status
Not open for further replies.
Back
Top