assign('pageMetas', $pmetas); $path = $TLN->getPath($mail_info)[0]; if (!file_exists($path)) { die('File not found'); } $email = $TLN->readFile($path); $TLN->displayimages = $TLN->prefs['display_images']; $TLN->sanitize = ($TLN->config['sanitize_html'] || !$TLN->config['allow_scripts']); $email = $TLN->parseBody($email); $body = $email['body']; //cleanning bad tags to show if (preg_match('|<[ ]*body.*background[ ]*=[ ]*["\']?([A-Za-z0-9._&?=:/{}%+-]+)["\']?.*>|i', $body, $regs)) { $backimg = " background=\"".$regs[1]."\""; } $smarty->assign('smBackImg', $backimg); if (preg_match('|<[ ]*body[A-Z0-9._&?=:/"\' -]*bgcolor=["\']?([A-Z0-9#]+)["\']?[A-Z0-9._&?=:/"\' -]*>|i', $body, $regs)) { $backcolor = " bgcolor=\"".$regs[1]."\""; } $smarty->assign('smBackColor', $backcolor); $body = preg_replace('|uniqID(), $body); $body = preg_replace('|(body)[ ]?\\{|i', '.'.$TLN->uniqID(), $body); $smarty->assign('smMessageBody', $body); $ARFrom = $email['from']; $useremail = $auth['email']; // from $name = $ARFrom[0]['name']; $thismail = $ARFrom[0]['mail']; $ARFrom[0]['link'] = 'newmsg.php?nameto='.urlencode($name)."&mailto=$thismail"; $ARRom[0]['title'] = "$name <$thismail>"; $smarty->assign('smFromList', $ARFrom); // To $ARTo = $email['to']; for ($i = 0;$iassign('smTOList', $ARTo); } // CC $ARCC = $email['cc']; if (count($ARCC) > 0) { $smarty->assign('smHaveCC', 1); for ($i = 0;$iassign('smCCList', $ARCC); } $smarty->assign('smCCList', $email['subject']); $smarty->assign('smSubject', $email['subject']); $smarty->assign('smDate', $email['date']); $anexos = $email['attachments']; $haveattachs = (count($anexos) > 0) ? 1 : 0; $smarty->assign('smHaveAttachments', $haveattachs); if (count($anexos) > 0) { for ($i = 0;$iassign('smAttachList', $anexos); } unset($TLN); $smarty->display("$themez/print-message.tpl");