- Code: Select all
function namelink($id)
{
global $url,$installiemap;
$sql="select gebruikersnaam from bert_leden where lidid=$id";
$res=mysql_query($sql);
$row=mysql_fetch_row($res);
$link=$url.'/'.$installiemap.'/leden/'.$row[0];
$tot="<a href="$link">$row[0]</a>";
return $tot;
}
// funcs to see who is in chat
function getdir($pad)
{
$res=array();
$handle=opendir($pad);
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$res[]=$file;
}
}
closedir($handle);
return $res;
}
function whochat($base)
{
$nicks=array();
$rooms=getdir($base);
foreach ($rooms as $room)
{
$roompad=$base.$room.'/nicknames';
$nicks_room=getdir($roompad);
if(count($nicks_room)>1)
{
foreach($nicks_room as $n) $nicks[]=$n;
}
}
for($i=0;$i<count($nicks);$i++)
$nicks[$i]=urldecode(base64_decode($nicks[$i]));
return $nicks;
}
To see who is in the chat call whochat with the path to the chat as parameter.
example (from chatroot)
$base='newchat/data/private/chat/';
$nicks=whochat($base);
the result? an array[..n] of the nicknames.
who makes something like this of the most recent messages?