Mysql Java chat / and phpbb

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
lcmp
Forum Newbie
Posts: 4
Joined: Thu Jun 10, 2004 11:03 pm

Mysql Java chat / and phpbb

Post by lcmp »

Hi,
First of all i´m a total newbie. I´m actually a graphic designer and i was entrusted to install a phpbb forum just like this.
OK no problem done.
Then we searched the web for a chat program which could be modified to do what we we´re asking it to do. So we found a programmer. He said instalation of this chat ( which was made in Java and uses mysql for user password data ) was very simple and we had nothing to do.
So he installed this chat thing without the modifications we asked ( cause we haven´t payed him yet) he said the java chat applet would use the user database from the phpbb forum so that whenever a user is added or taken off the forum this would be reflected in the java chat applet accsess. So then he sends me 2 links to a php page which activates the applet but actually nothing works it just shows me 1 user in one page and another user in another page but no messages were sent.
So I mail the guy and he tells me that now i must:

you should 1) get the current user session 2) somehow populate the login and password from phpbb_users 3) assign the login and password to the username and password variables.

all what you need to do - populate the login and password from current logged user to phpbb into im1.php

WHAT??? so now from this thing almost installs it self we go to you must hire a php developer!!


I don´t know if anybody can help me or has the time to help but well.

Here´s the forum address:

http://precisefutures.com/forum/index.php

right beside the logo there´s a button which says:

open instant messenger window

A pop up comes out and that page has this address:

http://precisefutures.com/sim/im1.php


he refers to this page as:

¨all what you need to do - populate the login and password from current logged user to phpbb into im1.php¨

this is the code from this page:

Code: Select all

<?php
	$user='christian';
	$password='6ebe76c9fb411be97b3b0d48b791a7c9';
?>
<html><style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<body>

<applet width="240" height="325" id="client" name="client" align="top" vspace="0" hspace="0" codebase="." code="com.jdevelop.sim.gui.AWT.UserList.class" archive="client.jar,skin.jar">
<param name="CODE" value="com.jdevelop.sim.gui.AWT.UserList.class">
<param name="CODEBASE" value=".">
<param name="ARCHIVE" value="client.jar,skin.jar">
		<param name="login" value="<?php echo $user ?>">
		<param name="password" value="<?php echo $password ?>">
		<param name="port" value="8090">
		<param name="prefix" value="/sim/wrapper.php">
</applet>
</body>
</html>

I don´t know what else to say. Any help in this will be deeply appreciated.
thanx
Last edited by lcmp on Sat Jul 03, 2004 4:43 pm, edited 3 times in total.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

I'm not an expert on phpBB but try this at the top of im1.php (instead of the php code you currently have).

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../forum/';
include_once( $phpbb_root_path . 'extension.inc' );
include_once( $phpbb_root_path . 'common.' . $phpEx );
$userdata = session_pagestart( $user_ip, PAGE_INDEX );
if($userdata['session_logged_in'] != 1){
    echo 'You must be logged in to access this page';
    exit;
}
$user=$userdata['username'];
$password=$userdata['user_password'];
?>
lcmp
Forum Newbie
Posts: 4
Joined: Thu Jun 10, 2004 11:03 pm

Post by lcmp »

THANX MAN!!!!!

Your code works...

The only funny thing is that on the pop up window it now displays the active user name and the encrypted mysql password from phpbb before the applet...

so i removed the final:

echo $user.' '.$password;

I now works to perfection!!!

Thanx Again
Last edited by lcmp on Fri Jun 11, 2004 12:00 am, edited 1 time in total.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Ekk, i'm suprised it worked .. glad it did.
The displaying of the username and password will be coming from an echo $user .' '.$password type line somewhere, just remove it.
lcmp
Forum Newbie
Posts: 4
Joined: Thu Jun 10, 2004 11:03 pm

Post by lcmp »

I just did that before reading your post----jajajaja
yep that was it!!

I understand a little PHP now...

But Surprised or not, You did it Man :lol:

Chat thing is now working
I can tell this xxxxx.com guy and his ¨simple to install if you´re a php master¨ chat applet to finish his work and implement the custom skins and get that road to love tittle of there jajajaja

THANX AGAIN!!!
and
Saludos!!
from Guatemala

markl999 wrote:Ekk, i'm suprised it worked .. glad it did.
The displaying of the username and password will be coming from an echo $user .' '.$password type line somewhere, just remove it.
Post Reply