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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 29th, 2007, 00:23
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
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
Reply With Quote

  #2 (permalink)  
Old Aug 29th, 2007, 00:46
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 38
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
Reply With Quote
  #3 (permalink)  
Old Aug 29th, 2007, 03:56
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,793
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: VB Forum

the login script used is not overly complicated,
adding the VB script to it wouldn't be hard
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #4 (permalink)  
Old Aug 29th, 2007, 09:14
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 21
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)
Reply With Quote
  #5 (permalink)  
Old Aug 29th, 2007, 10:16
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

oh ok il give it a try i supose.
Reply With Quote
  #6 (permalink)  
Old Aug 29th, 2007, 17:19
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,793
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 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.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #7 (permalink)  
Old Aug 29th, 2007, 21:07
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
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
Reply With Quote
  #8 (permalink)  
Old Aug 29th, 2007, 21:35
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,793
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: VB Forum

i've never really looked at the vb log in script
send it to me on msn in a min
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #9 (permalink)  
Old Aug 29th, 2007, 21:48
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
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 >.<
Reply With Quote
  #10 (permalink)  
Old Aug 30th, 2007, 04: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 04:06.
Reply With Quote
  #11 (permalink)  
Old Aug 30th, 2007, 04:15
alexgeek's Avatar
Technical Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,793
Blog Entries: 9
Thanks: 0
Thanked 2 Times in 2 Posts
Re: VB Forum

quite easy then
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #12 (permalink)  
Old Aug 30th, 2007, 05: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 05:04.
Reply With Quote
  #13 (permalink)  
Old Aug 30th, 2007, 08:52
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 21
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)
Reply With Quote
  #14 (permalink)  
Old Aug 30th, 2007, 10:28
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
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
Reply With Quote
  #15 (permalink)  
Old Aug 30th, 2007, 12: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.
Reply With Quote
  #16 (permalink)  
Old Aug 30th, 2007, 13:05
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

^ completely confused now

do you have msn?
Reply With Quote
  #17 (permalink)  
Old Aug 30th, 2007, 13: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
Reply With Quote
  #18 (permalink)  
Old Aug 30th, 2007, 13:22
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

yea but i needed it to connect to my site
Reply With Quote
  #19 (permalink)  
Old Aug 30th, 2007, 13: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?
Reply With Quote
  #20 (permalink)  
Old Aug 30th, 2007, 14:07
Up'n'Coming Member
Join Date: Jul 2007
Location: England
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Re: VB Forum

well we are working from my database which has about 133 tables but it also uses a cms which is modified completely. i dont know much about mysql or sql is there any chance you could help me?
Reply With Quote
Reply

Tags
forum

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paid Forum Posting - Political Forum entropy Job Opportunities 0 Sep 22nd, 2007 03:13
Best forum -> news script/forum? limezor Scripts and Online Services 4 Aug 21st, 2007 15:45
Really like this forum grandadbob Introduce Yourself 8 Apr 16th, 2007 09:52
Hello Forum Gordon Introduce Yourself 15 Dec 23rd, 2006 09:00
HotSeoTalk.com - SEO Forum Search Engine Optimization Ranking Marketing forum hotseotalk Link Building and Link Sales 1 Aug 19th, 2006 09:43


All times are GMT. The time now is 23:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43