1
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("
");
if($row[uid])
{
include XOOPS_ROOT_PATH.'modules/profile/userinfo.php?uid='.$row['uid'];
print("$row[uid] |
");
}
print("
");
}
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