![]() |
Getting information out of my forums, to show it on an other page
Howdy!
I have a question :bunny:. I run a 3.5.4 board and that's running fine. In co?peration with some people we are planning to set up a site. On that site we want to have some integration with the forums. What do we want:
On the website we want to show some profile information of the users. We're thing about things like:
And at the website show some common foruminformation like:
Maybe you think 'just use vBindex'. But that's not an option because the site is fully handwritten (PHP) and has to be editted to our wishes. What codes do I need to use, are there default scripts, etc. etc..? Thankyou in advance!! |
Hi!
I'm doing exactly this right now, I haven't finished but I managed to get the basics working. Here's a little background info to explain what MY requirements were: 1) Created a site in 2003, became popular so I built my own integrated forum 2) Switched to phpBB2 in 2004/5, but created custom registration and login pages, as well as change profile etc (all running from one user table). 3) Recently purchased vbulletin (hooked on it! :D), in the process of rebuilding my main site and the integrated forum. What I need is: -Users will register through my own custom page -Users shouldn't have to create separate accounts for main site and forum -Users shouldn't have to login twice, changing between main site and forum should be smooth -Other functions on main site will feed off user table, including downloads (login to download), comments linked to user profiles I'm guessing this is similar to what you're wanting to do. The first thing you should try is creating your own login form. I found some code here for doing that. Every page on the site should include this code, we'll save it in a file called 'authentication.inc.php': PHP Code:
On any page that has a login form, you have to include this javascript in your head: HTML Code:
<script type="text/javascript" src="/forum/clientscript/vbulletin_md5.js"> PHP Code:
Basically when you submit the form, the javascript file we included above takes the value in the vb_login_password field and encrypts it to md5 It then sets vb_login_password to '', so in your login script you are only interested in the md5password value. The login.php file is something like this: PHP Code:
The logout.php file should be something like this: PHP Code:
I think this covers everything for logging in and out. It should be enough for anyone with a decent understanding of PHP. I recommend creating some custom functions to speed up the process too, such as: PHP Code:
So you can change this: PHP Code:
PHP Code:
Any total numbers of members should be easy to get using basic SQL: "SELECT COUNT(userid) FROM vb_users" As far as the registration pages go, they should be fairly simple, hopefully just fields that you validate and insert into the database. I haven't done it yet so I can't say. I hope this helped you, having examples to work from certainly helped me get mine working :) And one other thing, once you've logged in successfully, load a page with this code: PHP Code:
(BEWARE: This array is HUGE! You will probably have to run a search to find what you're looking for) Here is a useful array you might want to var_dump: $vbulletin->userinfo; You will use this constantly :) |
bbcentral,
I havn't read your post yet but It looks great! Thanky ou VERY VERY much in advance and I'll look at it! And thanks for your time! |
Hi again, I just got sent an email notification that you'd replied to this topic. I see you've deleted the post though, so I was wondering, should I still answer it?
It was about displaying "users with most posts" and "last 10 posts at forum". I can help you if you let me know. There already is a mod that can do a lot of these things, but it's up to you if you want to use that method. Personally I prefer doing it like this because I can integrate it easily into my own functions and talk to the database directly. The mod uses the in-built vbulletin methods, eg template parsing, which makes it faster to add to your code. A good example is VBexternal: https://vborg.vbsupport.ru/showthread.php?t=83005 I found it wasn't flexible enough for me, but you may find it's exactly what you need :) |
Wow, that vB external (I downloaded a .zip file and read a .txt in it) looks great!
I'm still talking with the other guy. I don't know excactly what the wishes are at this time. I'll let you know. And thank you thank you again for your help! |
That has been very usefull and we're making progress, thank you again!
But; a little question.. When vB displays a date on the forum, it's something we can read. But in the table dates are saved such a strange way? I mean: Lastpost: 1120519615, joindate: 1120518311 ???? How can we 'translate' this? EDIT: Hold on a sec... I've found this topic: https://vborg.vbsupport.ru/showthrea...ate+conversion |
Ok.. Problem..
I want to make a login form. So when you log in, the cookie is nicely placed and you are logged in on the forums. I changed the template but not I doesn't work anymore :(. |
I'm lost.
Do you mean a login form on your main website? If so, why did you have to change the template? I don't use that VBExternal thing, I used it to learn the basics but I wrote the majority of it myself. I have my own forms and my own login files. If you want to see the one I'm temporarily using, go to: http://www.bluesbrotherscentral.com/ In the top corner you'll see a login box, with username password etc. The code is: HTML Code:
<form name="loginform" action="/forum/login.php" onSubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)" method="POST"> The most important things are the FORM and INPUT tags, including the 5 hidden fields at the bottom. The hidden 'url' field (in the example it's set to value="/"), is simply the page to redirect to after you've logged in. Just change it to the current page, ie: HTML Code:
<input type="hidden" name="url" value="<?=$_SERVER['REQUEST_URI']?>" /> HTML Code:
<input type="image" name="submitlogin" src="images/login_red.gif" style="border-style:none; width:38px; height:14px;" alt="Login" /> HTML Code:
<input type="submit" name="submitlogin" value="Login!" /> |
HI!
It seems to be working now :). http://www.soccerquest.nl/forum/login_sol.php?styleid=4 Code:
$stylevar[htmldoctype] |
Yes, the javascript encrypts the password value and saves it in:
<input type="hidden" name="vb_login_md5password" /> |
All times are GMT. The time now is 01:22 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|