51
SLEO577
Re: Using PHP to find User...
  • 2005/9/15 5:35

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Mith,

Just an update.....it is connecting if I run the script you mention as a html instead of a PHP Script. If I run the script you mentioned as a PHP Script in a custom block I get the following error:
Parse errorparse errorunexpected in /vpn/flstate/VSAS/class/xoopsblock.php(146) : eval()'d code on line 17
It connects and opens up both the chatroom and IM programs, but it still cannot determine who the user is. It shows the user once it connects to the chatroom or IM as just: ?>

I will be working on this more tomorrow and will let you know if I make any head way. It may be the portion of the script:
$GLOBALS['xoopsConfig']['anonymous'];?>

that is creating the problem. I have not allowed any portion of the website to be used by "Guest". It is strictly a Registered Members only website.



52
SLEO577
Re: Using PHP to find User...
  • 2005/9/14 20:32

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Okay Mith,

My plan is to get the buddylist working so I know the exact syntax for the buddylist param and work on just getting the XOOPS users able to auto login into the Chatroom and IM by pulling the username from the XOOPS database and I should be set.



53
SLEO577
Re: Using PHP to find User...
  • 2005/9/14 19:57

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Actually Mith, I'm putting the direct path to the URL for the userinfo.php and I think I may have it. If I can get this to work, I will PM you the info to get into the VPN we have to see. I think this would be a great module for XOOPS.



54
SLEO577
Re: Using PHP to find User...
  • 2005/9/14 19:47

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


No Mith, for some reason I am still having a problem with it finding the $user in the XOOPS database. I some how have the path to the user or users id wrong.



55
SLEO577
Re: Using PHP to find User...
  • 2005/9/14 19:14

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


No Mithrandir, I did not include the mainfile.php. But I put the applet file (myApplet.js) into a "Custom Block" that calls to the chatroom and IM program. The two php files above call to the XOOPS user database to locate the username and input it into the applet (username) field.

Kind of like AOL's Chatroom/Instant Messenager that works once you are logged into AOL with your screen name it displayes it for you and bypasses the user from inputting it into a field and hitting a submit button.



56
SLEO577
Using PHP to find User...
  • 2005/9/14 18:40

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


I am installing a Chatroom and Instant Messenager program and I am trying to use XOOPS membership's database so that the chatroom and IM can put there user name automatically in the (NickName) field, rather than have the members type it in and hit the submit button.

I am using a php file:
<?php
//BUDDYLIST.PHP//

$DB_USR "myDataUser";
$DB_PWD "******";
$DB_NAME "myDataName";
$DB_HOST "localhost";

$db mysql_connect($DB_HOST$DB_USR$DB_PWD)
or die (
"Could not connect to database");
mysql_select_db($DB_NAME$db);
if (
$request=="add"){
$query2 "INSERT INTO `buddylist`(`user`,`buddy`) VALUES('$user','$buddy')";
$result mysql_query($query2);
if (!
$result) {
die(
'Invalid query: ' mysql_error());
}

}
if (
$request=="remove"){
$query2 "DELETE FROM `buddylist` WHERE user='$user' and buddy='$buddy'";
$result mysql_query($query2);
if (!
$result) {
die(
'Invalid query: ' mysql_error());
}
}

[
color=CC0000]$query3 "SELECT `buddy` FROM `buddylist` WHERE user='$user_username'";[/color]
$result3 mysql_query($query3);
$numofrows=mysql_num_rows($result3);
for(
$ii=0;$ii<$numofrows;$ii++)
{
 
mysql_fetch_row($result3);
 if(
$ii==$numofrows-1)
 {
  
$budy.=mysql_result($result3,$ii,"buddy");
 }
 else
 {
 
$budy.=mysql_result($result3,$ii,"buddy").",";
 }
 
}

echo(
"$buddy");

?>


And to find the username and their ID the following file:
<?
    include(
"connect.php");

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="xoops.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="578" border="0" cellspacing="0" cellpadding="0" align="center" height="100%">
<tr> 
<td class="head_txt" valign="top" height="20">welcome</td>
</tr>
<tr> 
<DIV align=center>
<br />
<!--<applet NAME="MyChat Module" CODEBASE="http://www.MyWebPage/Classes/" 
CODE="com.net.chat.client.ChatApplet" WIDTH="200" HEIGHT="100" ALIGN="middle" 
ARCHIVE="Client_9_0_1_0.jar MAYSCRIPT">
<param name="siteID" value="577">
<param name="cabbase" value="Client_9_0_1_0.cab">
<param name="textcolor" value="000000">
<param name="browserClose" value="false">
<param name="WindowHeight" value="500">
<param name="WindowWidth" value="500">
<param name="background" value="FFFFFF">
<param NAME="BuddiesTab" value="true">
<param name="openProfileURL" value="true">
[color=CC0000]<param name="nickname" value=<? echo ("$user_username"); echo(">");
echo(
"<PARAM NAME=buddyList VALUE="); include("buddylist.php"); echo(">"); ?>
<param name="url" value="http://www.MyWebPage/userinfo.php?viewuser=<? echo $user_userid?>">[/color]
This site requires a Java compatible web browser to run. 
If you can see this message you need to download Java free from 
<a href="http://www.java.com/en/download/windows_automatic.jsp" target="_blank"> this website</a>.
</applet>-->
</DIV></td></tr></table></td></tr></table></td></tr>
<map name="Map">
<area shape="rect" coords="38,2,114,16" href="contact.htm">
<area shape="rect" coords="169,3,203,16" href="help.htm">
<area shape="rect" coords="267,2,325,17" href="logout.htm">
</map>
</body>
</html>

but I am not sure if the (WHERE user='$xoops_username'") is the right snippet to use to find the XOOPS username. Should it be just (WHERE user='$user'")? The items in RED are is script I was concern about.



57
SLEO577
Re: adding a new field to registration form
  • 2005/9/12 3:55

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Don't feel alone Rewrites, I have been trying to get someone interested in doing that for me for months now. Even willing to pay someone (SEE POSTING) to write it for me. You may want to give m0nty a shout. He tried to help me early on, but email was a problem.

Wish you luck on getting your's done.



58
SLEO577
Re: User Registration v2.0.13.1 (Website) Help
  • 2005/9/6 4:21

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Anyone interested in this project?



59
SLEO577
Re: User Registration v2.0.13.1 (Website) Help
  • 2005/9/3 4:23

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


If anyone is interested in tackling this project, I would be willing to pay you for your time and assistance. I can send payment via Paypal.

As I mentioned in the above post. I need the (Website) entry removed from the (User Registration) form and in it's place a (Agency) entry added with a (Selection Option) of approximately 22 options for members to select from.

NOTE: I am running the (Real Name) hack in case this may conflict with what needs to be done. This is the only hack on the core, everything else (modules) is hackfree.

Please PM to make other arrangements if needed.



60
SLEO577
Re: Real Name in Xoops 2.0.13.1
  • 2005/9/2 22:48

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Thank you mOnty, that did the trick! You're a life saver!




TopTop
« 1 ... 3 4 5 (6) 7 8 9 ... 11 »



Login

Who's Online

251 user(s) are online (180 user(s) are browsing Support Forums)


Members: 0


Guests: 251


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits