Make nicknames in the chatters list clickable to send PMs more easily

This commit is contained in:
Daniel Winzen
2016-09-05 19:05:10 +02:00
parent c9f622265f
commit d0163957f6
2 changed files with 6 additions and 3 deletions

View File

@ -2072,16 +2072,18 @@ function print_notifications(){
echo '</span>';
}
function print_chatters(){
global $I, $U, $db;
global $I, $U, $db, $language;
if(!$U['hidechatters']){
echo '<div id="chatters"><table style="border-spacing:0px;"><tr>';
$stmt=$db->prepare('SELECT nickname, style, status FROM ' . PREFIX . 'sessions WHERE entry!=0 AND status>0 AND incognito=0 AND nickname NOT IN (SELECT ign FROM '. PREFIX . 'ignored WHERE ignby=?) AND nickname NOT IN (SELECT ignby FROM '. PREFIX . 'ignored WHERE ign=?) ORDER BY status DESC, lastpost DESC;');
$stmt->execute([$U['nickname'], $U['nickname']]);
$nc=substr(time(), -6);
while($user=$stmt->fetch(PDO::FETCH_NUM)){
$link="<a href=\"$_SERVER[SCRIPT_NAME]?action=post&amp;session=$U[session]&amp;lang=$language&amp;nc=$nc&amp;sendto=".htmlspecialchars($user[0]).'" target="post">'.style_this(htmlspecialchars($user[0]), $user[1]).'</a>';
if($user[2]<=2){
$G[]=style_this(htmlspecialchars($user[0]), $user[1]);
$G[]=$link;
}else{
$M[]=style_this(htmlspecialchars($user[0]), $user[1]);
$M[]=$link;
}
}
if(!empty($M)){