@ -1,4 +1,5 @@
<?php
function messages_title() {
return _("Messages");
}
@ -30,6 +31,18 @@ function user_messages() {
$to_select = html_select_key('to', 'to', $to_select_data, '');
$messages = sql_select("SELECT * FROM `Messages` WHERE `SUID`='" . sql_escape($user['UID']) . "' OR `RUID`='" . sql_escape($user['UID']) . "' ORDER BY `isRead`,`Datum` DESC");
$messages_table = [
[
'news' => '',
'timestamp' => date("Y-m-d H:i"),
'from' => User_Nick_render($user),
'to' => $to_select,
'text' => form_textarea('text', '', ''),
'actions' => form_submit('submit', _("Save"))
]
];
foreach ($messages as $message) {
$sender_user_source = User($message['SUID']);
if ($sender_user_source === false)
@ -53,14 +66,6 @@ function user_messages() {
$messages_table_entry['actions'] = button(page_link_to("user_messages") . '& action=delete& id=' . $message['id'], _("delete message"), 'btn-xs');
$messages_table[] = $messages_table_entry;
}
$messages_table[] = array(
'news' => '',
'timestamp' => date("Y-m-d H:i"),
'from' => User_Nick_render($user),
'to' => $to_select,
'text' => form_textarea('text', '', ''),
'actions' => form_submit('submit', _("Save"))
);
return page_with_title(messages_title(), array(
msg(),