Current location: Hot Scripts Forums » Programming Languages » PHP » phpBB login integration


phpBB login integration

Reply
  #1 (permalink)  
Old 06-17-06, 06:19 AM
Supremacy Supremacy is offline
New Member
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
phpBB login integration

Hi, I have a website and phpBB forums, what I want to do is have a small block on my website that has the login section (username & pass) and then when they login in, I dont want to redirect to the forums, I want it to refresh the page an show where the login box was, show how many PMs they have waiting on the forums, how do I do this?
Reply With Quote
  #2 (permalink)  
Old 06-17-06, 02:03 PM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
this is quit a lot of work. i had to make such thing once for a friend of me. he wanted a script that could create new topics in a phpbb forum, and a phpbb login. i managed to get the posting to work, but i couldn't fix the login.

for the login, you might wonna check out these topics:
http://www.programmingtalk.com/showt...ht=phpbb+login
http://www.phpbbhacks.com/searchresu...&search_type=1

check the phpbb forum as well:
http://www.phpbb.com/phpBB/

to get the pm's to work, i recommend you to have a look at the phpbb code, and a database backup of your forum. it should be rather easy to list all, not read, pm's (a sort by date and userid, and there should be a field called read or something, with binary values 0 or 1, however i'm not sure)

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #3 (permalink)  
Old 06-17-06, 02:53 PM
Supremacy Supremacy is offline
New Member
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for those links, I tried everything really, we got the login part to work, but it redirects us to portal, instead once weve logged in, I want to just to show how many unread PM are qaitng for them where the login box was.
Reply With Quote
  #4 (permalink)  
Old 06-19-06, 02:49 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
the reason for redirecting is the number you have to send with the login-function. it says to wich page to redirect. you might have to change that.

to get the pm's, i think it should be something like this:
PHP Code:

$query "SELECT privmsgs_id FROM phpbb_privmsgs WHERE privmsgs_to_userid='".$current_user_id."'";

$res mysql_query($query) or die(mysql_error());
$number_of_pms mysql_num_rows($res); 
this will select all pm's from a specified user. to restrict to only the not read messages, i have no idea. i looked in a db backup of a phpbb forum, but i couldn't find anything about the status of a pm (read / not read).
[EDIT]: i think i just found it . they work with a system of last-login. and they see if there's a message posted after the last time you have logged in. it should look like this:
PHP Code:

$res mysql_query("SELECT user_lastvisit FROM phpbb_users WHERE user_id='".$current_user_id."'");

$lastlogin mysql_fetch_row($res);

//and now the pm's:
$query "SELECT privmsgs_id FROM phpbb_privmsgs WHERE privmsgs_to_userid='".$current_user_id."' AND date>'".$lastlogin."'";
$res mysql_query($query) or die(mysql_error());
$number_of_pms mysql_num_rows($res);
if(
$number_of_pms 0){
  echo 
$_number_of_pms." to be read";
}else{
  echo 
"No new pms";

you might want to take a look on the phpbb forum.

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks


Last edited by UnrealEd; 06-19-06 at 02:54 AM.
Reply With Quote
  #5 (permalink)  
Old 06-19-06, 09:49 AM
Supremacy Supremacy is offline
New Member
 
Join Date: Jun 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
ok, but now dont I have to include certain files in the website file?
Reply With Quote
  #6 (permalink)  
Old 06-20-06, 02:06 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
no, you only have to copy the login for your database (you can find it in the config file).
then use this code at the beginning of your mysql queries:
PHP Code:

$con mysql_connect('host''username''password') or die("No Connection could be made");

mysql_select_db('db_name'$con); 
then this should work, you don't have to include anything

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
phpbb login integration SR_Ben PHP 4 08-10-06 05:04 AM
phpbb login ckeck customised UnrealEd PHP 6 06-01-05 02:45 PM
Free phpBB Forum Hosting - Jconserv's FFH Network Psan General Advertisements 0 05-13-05 05:30 PM
login and password - PHPbb shaza7 PHP 2 04-18-05 07:59 AM
phpbb integration mod&123flashchat commecial chat V22 PHP 6 09-06-04 09:21 AM


All times are GMT -5. The time now is 07:17 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.