UBB.Dev
Posted By: MattUK Passing user information to 3rd party apps. - 03/13/2003 10:27 PM
Hi..

I am not very good at programming.. and wanted to ask someone how I might go about doing something.

We use a Java chat program, called realchat, which is basically kicked off from a simple Java Applet. The program can be set to take information from a current login session, like username etc.. the only information I want to use, is the users login name, or forum display name.. but I have no idea how to get that information to the applett..

Ideally, id love to add a CHAT button to the top, that loads up the applett, and pipes the display name straight into it, and logs that user into chat.

Can anyone give me any help? If its not a huge job id be happy to pay a bit to have it done?

I am using 6.2.3

-applet
codebase = "."
archive = "RealChat.jar"
code = "rcs.client.RealChatClient.class"
name = "ChatClient"
width = "300"
height = "100"
MAYSCRIPT>

<param name="nick" value="BadJohn">

<param name="pValue1" value="John Doe">
<param name="pValue2" value="35">

<param name="pLabel3" value="Favorite drink:">
<param name="pValue3" value="beer">

<param name="canChangeProfile" value="no">


The "Nick" field would need to be the display name.. the others are not required.

Posted By: JoshPet Re: Passing user information to 3rd party apps. - 03/13/2003 10:43 PM
There is a mod in this forum that allows you to put your chat inside a generic threads page.

it has the authenticate() function at the top, and defines the Username as $Username.

Then you simply put $Username where you want the name to go in your chat stuff.

I use it at measurection.com so when they enter chat, their username is already defined.
Posted By: JoshPet Re: Passing user information to 3rd party apps. - 03/13/2003 11:03 PM
Like try this one

But replace the jpilot applet code with the code needed for your chat software, and put $Username where you want the name filled in.
Cool just found I can pass this info with my raidersoft applet too. What is the passed on name for password?
Posted By: MattUK Re: Passing user information to 3rd party apps. - 03/13/2003 11:11 PM
Thanks Josh..

However I do not understand where I have to paste the code into online.php?
Posted By: JoshPet Re: Passing user information to 3rd party apps. - 03/13/2003 11:19 PM
That entry in the online.php language file would go just above this:

?>
Posted By: JoshPet Re: Passing user information to 3rd party apps. - 03/13/2003 11:24 PM
Password is not as easy (or possible) as the threads password is done with a one-way MD5 encryption. Which can't be reversed. So if you pulled the password from the DB, it wouldn't match the chat password.

What I do is simply require that they are logged in (which chat does) then their chat name is the same as the username. Passwords aren't needed. I use JPilot, so I don't know how raiderchat does it.

You could create another field in the DB to store the chat password.
Posted By: MattUK Re: Passing user information to 3rd party apps. - 03/13/2003 11:24 PM
Thanks.

If your on MSN josh any chance I can ask a few things, as I have no idea what im doing <blush> [][email protected][/]
Thanks Josh I was just realizing that for the login and made it auto login so it passes their user name right in. Only the admins get stopped at login and asked for a password... which is perfect

Posted By: JoshPet Re: Passing user information to 3rd party apps. - 03/14/2003 12:26 AM
I don't really have any chat things installed. Sort of by design. Impossible to get work done with the instant messenger things.
Posted By: MattUK Re: Passing user information to 3rd party apps. - 03/14/2003 12:40 AM
Its working!

What a superb addon.. full marks!

Is there a list of items that we can pass across anywhere, you know, items from the profile etc?
Posted By: MattUK Re: Passing user information to 3rd party apps. - 03/14/2003 12:42 AM
I notice when people are in chat, that they "whos online" status is shown as "Private". Is there any way to change this to something like "In chat" ?
Posted By: JoshPet Re: Passing user information to 3rd party apps. - 03/14/2003 12:45 AM
Sure.... you need to add an entry to the online.php language file.

See this.
Aha that would explain the earlier one.. I was putting it in the wrong file..

Is there a way of pulling other info across from the user profile?
yes,

Basically depending on what it is.... you need to add the field names into the authenticate function at the top.

Something like this:

$user = $userob -> authenticate("U_Title,U_Groups,U_Number");
$Username = $user['U_Username'];
$Password = $user['U_Password'];
$Usernumber = $user['U_Number'];
$Groups = $user['U_Groups'];
$Profile = $user['U_Title'];

Then use those variables as needed.
Posted By: bjsjr Re: Passing user information to 3rd party apps. - 03/14/2003 4:18 AM
If it helps, here's my RealChat applet file:
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN"><br /><?<br /><br />// Require the library<br />   require ("C:/inetpub/wwwroot/ubbthreads/main.inc.php");<br />   $userob = new user;<br />   $user = $userob -> authenticate("U_Username,U_Name,U_Location,U_Homepage,U_Fakeemail,U_Title,U_Hobbies");<br />   $Username = $user['U_Username'];<br />   $Email = $user['U_Fakeemail'];<br />   $RealName = $user['U_Name'];<br />   $Location = $user['U_Location'];<br />   $Homepage = $user['U_Homepage'];<br />   $Title = $user['U_Title'];<br />   $Hobbies = $user['U_Hobbies'];<br /><br /><br /><br />if ($user['U_Username'] == "") {<br />// $Username = guest;<br />	exit("There has been a login error. Please close this window and login to the forums before retrying.");<br />}<br />?><br /><html><br /><head><br /><title>applet frame</title><br /></head><br /><br /><body topmargin=0 leftmargin=0><br /><br /><!-- Begin: RealChat Client code --><br /><applet<br />  archive = "RealChat.jar"<br />  codebase = "../"<br />  code     = "rcs.client.RealChatClient.class"<br />  name     = "ChatClient"<br />  width    = "100%"<br />  height   = "100%"<br />  align    = "top"<br />  MAYSCRIPT><br /><br /><param name="embedded" value="yes"><br /><br /><param name="logoImage" value="IHIQSlogo.jpg"><br /><param name="hasLogoImage" value="yes"><br /><param name="logoImageAlignment" value="left"<br /><br /><param name="onCloseURL" value="IHIQS/exit.html"><br /><param name="onCloseURLTarget" value="_top"><br /><br /><param name="nick" value='<? print $Username ?>'><br /><br /><param name="canChangeProfile" value="yes"><br /><br /><param name="pValue1" value='<? print $RealName ?>'><br /><param name="pValue2" value=""><br /><param name="pValue3" value=""><br /><param name="pValue4" value='<? print $Location ?>'><br /><param name="pValue5" value='<? print $Homepage ?>'><br /><param name="pValue6" value='<? print $Email ?>'><br /><br /><param name="pLabel7" value="Forum Title:"><br /><param name="pValue7" value='<? print $Title ?>'><br /><param name="pLabel8" value="Hobbies:"><br /><param name="pValue8" value='<? print $Hobbies ?>'><br /><br /><br /><param name="mainPanelColors" value="FFFFFF,0A1849"><br /><param name="loginPanelColors" value="FFFFFF,BE262C"><br /><param name="tabPanelColors" value="FFFFFF,336699"><br /><param name="listColors" value="FFFFFF,CCCCCC"><br /><param name="userPanelColors" value="FFFFFF,336699"><br /><param name="myChatPanelColors" value="FFFFFF,336699"><br /><param name="dialogColors" value="FFFFFF,336699"><br /><br /><br />RealChat Client requires a Java Compatible web browser to run. Please visit our <a target="_blank" href="http://www.rcsoft.net/">Java support page</a> for details.<br /><br /></applet><br /><br /><br /><!-- End: RealChat Client code --><br /></body><br /></html>  


Bill
© UBB.Developers