diff --git a/chat.php b/chat.php index d568457..d966572 100644 --- a/chat.php +++ b/chat.php @@ -1363,7 +1363,7 @@ function send_frameset(){ } function send_messages(){ - global $H, $I, $U, $db, $language; + global $I, $U, $language; if($U['nocache']){ $nocache='&nc='.substr(time(), -6); }else{ @@ -1383,53 +1383,16 @@ function send_messages(){ echo get_setting('topic'); echo ''; print_chatters(); - echo '
<$H[form]>$H[commonform]".hidden('action', 'inbox'); - echo submit(sprintf($I['inboxmsgs'], $tmp[0])).'
'; - } - } - if($U['status']>=5 && get_setting('guestaccess')==3){ - $result=$db->query('SELECT COUNT(*) FROM ' . PREFIX . 'sessions WHERE entry=0 AND status=1;'); - $temp=$result->fetch(PDO::FETCH_NUM); - if($temp[0]>0){ - echo ''; - frmadm('approve'); - echo submit(sprintf($I['approveguests'], $temp[0])).'
'; - } - } + print_notifications(); print_messages(); }else{ - echo '<$H[form]>$H[commonform]".hidden('action', 'inbox'); - echo submit(sprintf($I['inboxmsgs'], $tmp[0])).'
'; - } - } - if($U['status']>=5 && get_setting('guestaccess')==3){ - $result=$db->query('SELECT COUNT(*) FROM ' . PREFIX . 'sessions WHERE entry=0 AND status=1;'); - $temp=$result->fetch(PDO::FETCH_NUM); - if($temp[0]>0){ - echo ''; - frmadm('approve'); - echo submit(sprintf($I['approveguests'], $temp[0])).'
'; - } - } - echo '<$H[form]>$H[commonform]".hidden('action', 'inbox'); + echo submit(sprintf($I['inboxmsgs'], $tmp[0])).'
'; + } + } + if($U['status']>=5 && get_setting('guestaccess')==3){ + $result=$db->query('SELECT COUNT(*) FROM ' . PREFIX . 'sessions WHERE entry=0 AND status=1;'); + $temp=$result->fetch(PDO::FETCH_NUM); + if($temp[0]>0){ + echo ''; + frmadm('approve'); + echo submit(sprintf($I['approveguests'], $temp[0])).'
'; + } + } + echo ''; +} function print_chatters(){ global $I, $U, $db; if(!$U['hidechatters']){ @@ -3148,6 +3134,7 @@ function print_messages($delstatus=0){ $time=time(); $stmt=$db->prepare('DELETE FROM ' . PREFIX . 'messages WHERE id IN (SELECT * FROM (SELECT id FROM ' . PREFIX . 'messages WHERE postdate<(?-60*(SELECT value FROM ' . PREFIX . "settings WHERE setting='messageexpire'))) AS t);"); $stmt->execute([$time]); + echo '