1
-FireHorse-
Profile from uname instead of uid

I have made a chat module and are trying to get view profiles working from within the chat.

In the XOOPS main dir I have a userprofile.php that I want to call userinfo.php from, the chat server passes $user so I think all I have to do is fetch the UID from $user and append it to the userinfo.php. Sorry I am very new to php so this is probably much simpler than it looks

I have this code but its not working

<?
include(
"mainfile.php");
include (
$xoopsConfig['root_path']."header.php");
if(
$xoopsuser)
{
$sql mysql_query("SELECT uid FROM 1****y_users WHERE uname = '$user'");
$row mysql_fetch_array($sql);
$num mysql_num_rows($sql);
$uid intval($_GET['uid']);
if(
$uid <= 0)
{
print(
"Cant find a profile for $user");
include_once(
XOOPS_ROOT_PATH.'/footer.php');
exit;
}

print(
"
<table width=500>"
);

if(
$row[uid])
{
include 
XOOPS_ROOT_PATH.'modules/profile/userinfo.php?uid='.$row['uid'];
print(
"<tr><td colspan=10 class='content'>$row[uid]</td></tr>");
}
print(
"</table>");
}
else
{
print(
"No username selected! ");
}
include_once(
XOOPS_ROOT_PATH.'/footer.php');
?>


EDIT: An easier way might be to modify the userinfo.php in XOOPS dir to resolve profile from uname rather than uid, anyone know an easy way to do this?

cheers
FireHorse

2
-FireHorse-
Re: Profile from uname instead of uid

can anyone tell me why this wont work?

$uid mysql_query("SELECT uid FROM ******_users WHERE uname = '$uname'");
include 
XOOPS_ROOT_PATH.'userinfo.php?uid='.$uid;


I am supplying $uname as it prints ok

help?

Login

Who's Online

62 user(s) are online (34 user(s) are browsing Support Forums)


Members: 0


Guests: 62


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