My version is 1.3.
I have added a button "Invite" in the GUI of the chat, which is supposed to open a pop up with the list of all connected nicknames, in order to allow the user to invite one of them on his current channel.
But if a user logs in the chat after the private channel was created, his nickname does not appear in the list.
Here is the code of my method supposed to return the list of all connected users :
- Code: Select all
function getNicknames($nickId)
{
$cg =& pfcGlobalConfig::Instance();
$serverid = isset($GLOBALS['serverid']) ? $GLOBALS['serverid'] : 0;
require_once "pfcinfo.class.php";
$info = new pfcInfo( md5($serverid) );
$listOnline = $info->getOnlineNick(NULL);
$listNicks = Array();
for ($i=0; $i<sizeof($listOnline); $i++) {
if ($listOnline['nickid'][$i] != $nickId) {
if ($listOnline['nick'][$i] != "")
$listNicks[] = $listOnline['nick'][$i];
}
}
return $listNicks;
}
Do you see any error in it ? Do you have a more correct way to achieve this ?
Thank you for your help !
Edgar