From b2de7a0dc999c6f3cac7ef3e890acc5e7969a196 Mon Sep 17 00:00:00 2001 From: Daniel Winzen Date: Tue, 20 Sep 2016 14:47:08 +0200 Subject: [PATCH] Bugfix for prefix-routed chats + make rearranging frames change message sorting direction --- chat.php | 20 ++++++++++++++++++-- lang_de.php | 4 ++-- lang_en.php | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/chat.php b/chat.php index f41b822..ed89c2e 100644 --- a/chat.php +++ b/chat.php @@ -1329,11 +1329,25 @@ function send_linkfilter($arg=''){ } function send_frameset(){ - global $H, $I, $U, $language; + global $H, $I, $U, $db, $language; echo "$H[meta_html]"; echo ''.get_setting('chatname').''; print_stylesheet(); echo ''; + if(isset($_REQUEST['sort'])){ + if($_REQUEST['sort']==1){ + $U['sortupdown']=1; + $U['nocache']=1; + }else{ + $U['sortupdown']=0; + } + $stmt=$db->prepare('UPDATE ' . PREFIX . 'sessions SET sortupdown=?, nocache=? WHERE nickname=?;'); + $stmt->execute([$U['sortupdown'], $U['nocache'], $U['nickname']]); + if($U['status']>1){ + $stmt=$db->prepare('UPDATE ' . PREFIX . 'members SET sortupdown=?, nocache=? WHERE nickname=?;'); + $stmt->execute([$U['sortupdown'], $U['nocache'], $U['nickname']]); + } + } if($U['sortupdown']){ $bottom='#bottom'; }else{ @@ -1793,7 +1807,7 @@ function send_profile($arg=''){ } echo "
$I[ignore]"; echo "