Esempio n. 1
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&amp;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');
                }
            }
        } else {
            if (strpos($row['user'], ':') > 0) {
                $receiverName .= '; ' . $modulemessages->msgGroupNameSplit($row['user']);
            } else {
                $user = new User($gDb, $gProfileFields, $row['user']);
                $receiverName .= '; ' . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
            }
        }
        $receiverName = substr($receiverName, 2);
        $message = new TableMessage($gDb, $row['msg_id']);
Esempio n. 2
0
 $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 {
             $user = new User($gDb, $gProfileFields, $receivers);
             $ReceiverName .= "; " . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
         }
     }
     $ReceiverName = '<div class="panel-footer">' . $gL10n->get('MSG_OPPOSITE') . ': ' . substr($ReceiverName, 2) . '</div>';
 }
 // 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 {
         $user = new User($gDb, $gProfileFields, $ReceiverString);
         $receiverName .= '; ' . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
     }
 }
 $receiverName = substr($receiverName, 2);
 $emailTemplate = str_replace('#receiver#', $receiverName, $emailTemplate);
Esempio n. 4
0
 $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 {
             $user = new User($gDb, $gProfileFields, $receivers);
             $receiverName .= '; ' . $user->getValue('FIRST_NAME') . ' ' . $user->getValue('LAST_NAME');
         }
     }
     $receiverName = '<div class="panel-footer">' . $gL10n->get('MSG_OPPOSITE') . ': ' . substr($receiverName, 2) . '</div>';
 }