From 9c1a3f40684d12b536d7368d1d364dabce5fa77d Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 15 May 2020 18:44:48 +0200 Subject: [PATCH] include: notifs: Ritorna un array di notifiche. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * web/mustard/include/notifs.php (notifs): Rinomina a notif_divs, (notifs): Ora รจ un array di notifiche. --- web/mustard/include/notifs.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/web/mustard/include/notifs.php b/web/mustard/include/notifs.php index 9f0229e..198bb7d 100644 --- a/web/mustard/include/notifs.php +++ b/web/mustard/include/notifs.php @@ -2,12 +2,14 @@ function notifs(&$link) { $chunksize=20; // questo deve essere settato paro-paro in notifsh.php $i=0; - $notifs='
'.N; - $notifs.='
'.N; + $notifs = array(); + $notif_divs='
'.N; + $notif_divs.='
'.N; $unreadnotifs=false; $res=mysqli_query($link,'SELECT * FROM Notifications ORDER BY Microtime DESC') or muoribene(mysqli_error($link),true); while ($row=mysqli_fetch_assoc($res)) { + array_push($notifs, $row); if ($row['Seen']==0) { $unreadnotifs=true; $notifclass='notifunseen'; @@ -17,12 +19,12 @@ function notifs(&$link) { $i++; if ($i<=$chunksize) { if ($i==1) $lastmicrotime=$row['Microtime']; - $notifs.='
'.strftime('%d/%m/%y %T',$row['Microtime']).': '.$row['Notification'].'
'.N; + $notif_divs.='
'.strftime('%d/%m/%y %T',$row['Microtime']).': '.$row['Notification'].'
'.N; } } - $notifs.='
'.N; - $notifs.=''.N; - $notifs.='
'.N; + $notif_divs.='
'.N; + $notif_divs.=''.N; + $notif_divs.='
'.N; if ($unreadnotifs) { $imgoff='imgs/bell_act_off.svg'; $imgon='imgs/bell_act_on.svg'; @@ -31,7 +33,8 @@ function notifs(&$link) { $imgon='imgs/bell_on.svg'; } return(array( - 'div'=>$notifs, + 'notifs'=>$notifs, + 'div'=>$notif_divs, 'imgoff'=>$imgoff, 'imgon'=>$imgon, 'lastmicrotime'=>$lastmicrotime,