$EmailMenu->addItem('admMenuItemPreferences', $g_root_path . '/adm_program/modules/preferences/preferences.php?show_option=messages', '<i class="fa fa-cog" alt="' . $gL10n->get('SYS_MODULE_PREFERENCES') . '" title="' . $gL10n->get('SYS_MODULE_PREFERENCES') . '"></i><div class="iconDescription">' . $gL10n->get('SYS_MODULE_PREFERENCES') . '</div>', '', 'right'); } $table = new HtmlTable('adm_lists_table', $page, true, true); // @ptabaden deleted two cols #possibleError delete one left more? $table->setColumnAlignByArray(array('left', 'left', 'right')); // @ptabaden: deleted category row and changed order // @ptabaden: deleted two cols $table->addRowHeadingByArray(array($gL10n->get('MSG_OPPOSITE'), $gL10n->get('MAI_SUBJECT'), '')); $table->disableDatatablesColumnsSort(5); $key = 0; $part1 = '<a class="admidio-icon-link" data-toggle="modal" data-target="#admidio_modal" href="' . $g_root_path . '/adm_program/system/popup_message.php?type=msg&element_id=row_message_'; // @ptabaden: Changed Icon $part2 = '"><i class="fa fa-times" alt="' . $gL10n->get('MSG_REMOVE') . '" title="' . $gL10n->get('MSG_REMOVE') . '" /></a>'; $href = 'href="' . $g_root_path . '/adm_program/modules/messages/messages_write.php?msg_id='; // open some additonal functions for messages $modulemessages = new ModuleMessages(); // find all own Email messages $statement = $modulemessages->msgGetUserEmails($gCurrentUser->getValue('usr_id')); if (isset($statement)) { while ($row = $statement->fetch()) { $receiverName = ''; if (strpos($row['user'], '|') > 0) { $reciversplit = explode('|', $row['user']); foreach ($reciversplit as $value) { if (strpos($value, ':') > 0) { $receiverName .= '; ' . $modulemessages->msgGroupNameSplit($value); } else { $user = new User($gDb, $gProfileFields, $value); $receiverName .= '; ' . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'); } }
if ($gPreferences['mail_into_to'] == 1 || $receivers === 1) { $email->addRecipient($address[0], $address[1]); } else { $email->addBlindCopy($address[0], $address[1]); } } // add confirmation mail to the sender if ($postDeliveryConfirmation == 1) { $email->ConfirmReadingTo = $gCurrentUser->getValue('EMAIL'); } // load the template and set the new email body with template $emailTemplate = admReadTemplateFile('template.html'); $emailTemplate = str_replace('#message#', $postBody, $emailTemplate); // add sender and receiver to email if template include the variables $emailTemplate = str_replace('#sender#', $postName, $emailTemplate); $modulemessages = new ModuleMessages(); $receiverName = ''; if (strpos($ReceiverString, '|') > 0) { $reciversplit = explode('|', $ReceiverString); foreach ($reciversplit as $value) { if (strpos($value, ':') > 0) { $receiverName .= '; ' . $modulemessages->msgGroupNameSplit($value); } else { $user = new User($gDb, $gProfileFields, $value); $receiverName .= '; ' . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'); } } } else { if (strpos($ReceiverString, ':') > 0) { $receiverName .= '; ' . $modulemessages->msgGroupNameSplit($ReceiverString); } else {
while ($row = $gDb->fetch_array($message_result)) { if ($row['msc_usr_id'] == $gCurrentUser->getValue('usr_id')) { $sentUser = $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME'); } else { $sentUser = $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'); } $ReceiverName = ''; $message_text = htmlspecialchars_decode($row['msc_message']); if ($getMsgType == 'PM') { // list history of this PM $message_text = nl2br($row['msc_message']); } else { $message = new TableMessage($gDb, $getMsgId); $receivers = $message->getValue('msg_usr_id_receiver'); // open some additonal functions for messages $modulemessages = new ModuleMessages(); $ReceiverName = ""; if (strpos($receivers, '|') == true) { $reciversplit = explode('|', $receivers); foreach ($reciversplit as $value) { if (strpos($value, ':') == true) { $ReceiverName .= "; " . $modulemessages->msgGroupNameSplit($value); } else { $user = new User($gDb, $gProfileFields, $value); $ReceiverName .= "; " . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'); } } } else { if (strpos($receivers, ':') == true) { $ReceiverName .= "; " . $modulemessages->msgGroupNameSplit($receivers); } else {
require_once '../../system/common.php'; // check for valid login if (!$gValidLogin) { $gMessage->show($gL10n->get('SYS_INVALID_PAGE_VIEW')); } // check if the call of the page was allowed by settings if ($gPreferences['enable_chat_module'] != 1) { // message if the Chat is not allowed $gMessage->show($gL10n->get('SYS_MODULE_DISABLED')); } $postFunction = admFuncVariableIsValid($_POST, 'function', 'string'); $postMessage = admFuncVariableIsValid($_POST, 'message', 'string'); $postLines = admFuncVariableIsValid($_POST, 'state', 'number'); $log = array(); // open some additonal functions for messages $modulemessages = new ModuleMessages(); // find ID of the admidio Chat $msg_id = $modulemessages->msgGetChatId(); $sql = "SELECT MAX(msc_part_id) as max_id\n FROM " . TBL_MESSAGES_CONTENT . "\n where msc_msg_id = '" . $msg_id . "'"; $statement = $gDb->query($sql); $row = $statement->fetch(); $MsgId = $row['max_id']; if (!$MsgId) { $MsgId = 0; } switch ($postFunction) { case 'update': if ($MsgId + 25 < $postLines) { $postLines = $postLines - 50; } if ($postLines >= 100) {
while ($row = $messageStatement->fetch()) { if ($row['msc_usr_id'] == $gCurrentUser->getValue('usr_id')) { $sentUser = $gCurrentUser->getValue('FIRST_NAME') . ' ' . $gCurrentUser->getValue('LAST_NAME'); } else { $sentUser = $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'); } $receiverName = ''; $messageText = htmlspecialchars_decode($row['msc_message']); if ($getMsgType === 'PM') { // list history of this PM $messageText = nl2br($row['msc_message']); } else { $message = new TableMessage($gDb, $getMsgId); $receivers = $message->getValue('msg_usr_id_receiver'); // open some additonal functions for messages $moduleMessages = new ModuleMessages(); $receiverName = ''; if (strpos($receivers, '|') > 0) { $receiverSplit = explode('|', $receivers); foreach ($receiverSplit as $value) { if (strpos($value, ':') > 0) { $receiverName .= '; ' . $moduleMessages->msgGroupNameSplit($value); } else { $user = new User($gDb, $gProfileFields, $value); $receiverName .= '; ' . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME'); } } } else { if (strpos($receivers, ':') > 0) { $receiverName .= '; ' . $moduleMessages->msgGroupNameSplit($receivers); } else {