VB Forum

This is a discussion on "VB Forum" within the Databases section. This forum, and the thread "VB Forum are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Databases

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 29th, 2007, 01:23
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
VB Forum

Hello,


I have a quick question:

I have a website where people must register to get more features/ options. Also i use vbulletin as forum. But i dislike the fact that registered users of my website must register twice (once for my website and the second time for vbulletin) when they want to use the forum. The question is:

How can i use the data that i store in the mysql database of registered users for auto registration for vbulletin. And of course auto login
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 29th, 2007, 01:46
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

I have never done this the way you are talking about but I think it will work, the same.

What I would do is have the login script on your site, really login and register on the forum.

To do this you would need to change the variables on the sites login page to the forums login page. (or an easier way use a iframe)

After you have the login / register mysql info and variables ready, all you need to do now is change the variables on the hiddent content pages, and possibly config.php.

I hope I explained this well.

(It would have been easier if you described it better and gave a link)

Cheers

I hope
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 29th, 2007, 04:56
alexgeek's Avatar
Moderator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,814
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Re: VB Forum

the login script used is not overly complicated,
adding the VB script to it wouldn't be hard
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Aug 29th, 2007, 10:14
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 22
Posts: 2,051
Blog Entries: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

This is a database question:

Moved to MySQL Forum
Last Blog Entry: Assassin's Creed (Nov 22nd, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Aug 29th, 2007, 11:16
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

oh ok il give it a try i supose.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Aug 29th, 2007, 18:19
alexgeek's Avatar
Moderator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,814
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Re: VB Forum

Quote:
Originally Posted by DanDoughty View Post
This is a database question:

Moved to MySQL Forum
Isn't more of a php one? This is combining two php scripts so they use the same session.
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Aug 29th, 2007, 22:07
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

Quote:
Originally Posted by alexgeek View Post
Isn't more of a php one? This is combining two php scripts so they use the same session.
OWNED!

lol alex do you know how this can be done? like of by hand? im having trouble
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Aug 29th, 2007, 22:35
alexgeek's Avatar
Moderator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,814
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Re: VB Forum

i've never really looked at the vb log in script
send it to me on msn in a min
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Aug 29th, 2007, 22:48
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

ok give me a min also im creating the training page lol for my game. and i have to re-download it >.<
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Aug 30th, 2007, 05:04
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 05:06.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Aug 30th, 2007, 05:15
alexgeek's Avatar
Moderator
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,814
Blog Entries: 9
Thanks: 2
Thanked 3 Times in 3 Posts
Re: VB Forum

quite easy then
__________________
Web Design and Development Blog

Alex Perry
Technical Administrator.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Aug 30th, 2007, 06:02
Junior Member
Join Date: Jun 2006
Location: Here
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

You can easily get access to the users name, user groups and things like that with a call to get the info out of the user table as well...

Code: Select all
    
$id=$vbulletin->userinfo['userid'];
$user = $vbulletin->db->query_first("SELECT * FROM user WHERE userid='$id'");

//now $user holds all data about the user.. everything from their profiles to usergroups and so on
//ex..the users name....
echo $user['username'];

Last edited by split-visionz; Aug 30th, 2007 at 06:04.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Aug 30th, 2007, 09:52
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 22
Posts: 2,051
Blog Entries: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

Quote:
How can i use the data that i store in the mysql database of registered users for auto registration for vbulletin. And of course auto login
So no alex - it is a SQL question - don't challenge a moderator - we know what we're doing... usually
Last Blog Entry: Assassin's Creed (Nov 22nd, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Aug 30th, 2007, 11:28
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

lol thanks il give it another go then. il wait for you on msn alex some time roday but il give it a go and il write here if i get stuck again
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Aug 30th, 2007, 13:42
Junior Member
Join Date: Jun 2006
Location: Here
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

If I were you, I would use vb's database as the main database for the site and put all of your tables in there. It would be alot easier then inserting and converting the opposite.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Aug 30th, 2007, 14:05
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

^ completely confused now

do you have msn?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Aug 30th, 2007, 14:21
Junior Member
Join Date: Jun 2006
Location: Here
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

nope..lol. I only use AIM.. But Im about to take off anyways lol.

What I said was in response to what Dan quoted from your first post...

It would be easier to do the opposite of what your saying and just use the VB database and login system on the main site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Aug 30th, 2007, 14:22
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

yea but i needed it to connect to my site
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Aug 30th, 2007, 14:35
Junior Member
Join Date: Jun 2006
Location: Here
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

How much info is in your database yet when your sites not live? Just create a script that inserts the same tables you have in your sites DB into the VB database.
Then in all your pages just include "globals.php" that I talked about before. If you include that then your already connected to the VB database so all mysql calls will be on that database. Or you can use $vbulletin->db->query(""); to make your SQL calls.

Or are you using a sepereate full blown CMS on the main site?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #20  
Old Aug 30th, 2007, 15:07
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts