public function send_email() { // Load form validation class $this->load->library('form_validation'); $this->form_validation->set_rules('subject', lang("Theme", 'mailer'), 'required|trim'); $this->form_validation->set_rules('name', lang("Your name", 'mailer'), 'required|trim'); $this->form_validation->set_rules('email', lang("Your e-mail", 'mailer'), 'required|trim|valid_email'); $this->form_validation->set_rules('message', lang("Message", 'mailer'), 'required|trim'); if ($this->form_validation->run($this) == FALSE) { showMessage(validation_errors(), false, 'r'); } else { $this->load->helper('typography'); $this->load->library('email'); // Init email config $config['wordwrap'] = TRUE; $config['charset'] = 'UTF-8'; $config['mailtype'] = $_POST['mailtype']; $this->email->initialize($config); // Get users array $users = $this->db->get('mail'); if ($users->num_rows() > 0) { $message = $_POST['message']; if ($_POST['mailtype'] == 'html') { $message = "<html><body>" . nl2br_except_pre($message) . "</body></html>"; } $counter = array('true' => 0, 'all' => 0); foreach ($users->result_array() as $user) { // Replace {username} $tmp_msg = str_replace('%username%', $user['username'], $message); $this->email->from($_POST['email'], $_POST['name']); $this->email->to($user['email']); $this->email->reply_to($_POST['email'], $_POST['name']); $this->email->subject($_POST['subject']); $this->email->message($tmp_msg); $counter['all']++; if ($this->email->send()) { $counter['true']++; } } $this->load->library('lib_admin'); $this->lib_admin->log(lang("Send", 'mailer') . '(' . $counter['true'] . '/' . $counter['all'] . ')' . lang("users e-mail with a subject", 'mailer') . ')' . $_POST['subject']); $class = ''; if ($counter['true'] == $counter['all']) { $class = ''; } else { if ($counter['true'] == 0) { $class = 'r'; } } if ($class !== 'r') { showMessage(lang("message has been sent", 'mailer') . ': ' . $counter['true'] . lang("Number of e-mails sent", 'mailer') . $counter['all'] . lang('pcs.', 'mailer') . $class); } else { showMessage(lang("none of the messages", 'mailer') . $counter['all'] . lang("Number not", 'mailer'), $class); } } } }
function format_content($text) { //if(preg_match($img_url, $text)){ // $text = preg_replace($img_url, '<img src="\1" alt="" />', $text); // } //preg_match_all($img_url, $text,$arr); //$text= $arr[0][0]; // 视频地址识别。 // youku if (strpos($text, 'player.youku.com')) { $text = preg_replace('/http:\\/\\/player.youku.com\\/player.php\\/sid\\/([a-zA-Z0-9\\=]+)\\/v.swf/', '<div class="embed-responsive embed-responsive-16by9"><embed src="http://player.youku.com/player.php/sid/\\1/v.swf" quality="high" width="100%" height="auto" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></div>', $text); } if (strpos($text, 'v.youku.com')) { $text = preg_replace('/http:\\/\\/v.youku.com\\/v_show\\/id_([a-zA-Z0-9\\=]+)(\\/|.html?)?/', '<div class="embed-responsive embed-responsive-16by9"><embed src="http://player.youku.com/player.php/sid/\\1/v.swf" quality="high" width="100%" height="auto" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></div>', $text); } // tudou if (strpos($text, 'www.tudou.com')) { if (strpos($text, 'programs/view')) { $text = preg_replace('/http:\\/\\/www.tudou.com\\/(programs\\/view|listplay)\\/([a-zA-Z0-9\\=\\_\\-]+)(\\/|.html?)?/', '<div class="embed-responsive embed-responsive-16by9"><embed src="http://www.tudou.com/v/\\2/" quality="high" width="100%" height="auto" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></div>', $text); } elseif (strpos($text, 'albumplay')) { $text = preg_replace('/http:\\/\\/www.tudou.com\\/(albumplay)\\/([a-zA-Z0-9\\=\\_\\-]+)\\/([a-zA-Z0-9\\=\\_\\-]+)(\\/|.html?)?/', '<embed src="http://www.tudou.com/a/\\2/" quality="high" width="100%" height="auto" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>', $text); } else { $text = preg_replace('/http:\\/\\/www.tudou.com\\/(programs\\/view|listplay)\\/([a-zA-Z0-9\\=\\_\\-]+)(\\/|.html?)?/', '<div class="embed-responsive embed-responsive-16by9"><embed src="http://www.tudou.com/l/\\2/" quality="high" width="100%" height="auto" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed></div>', $text); } } $CI =& get_instance(); $CI->load->helper('typography'); $text = auto_link_pic($text, 'url', TRUE); //$text = auto_link($text, 'url', TRUE); //url /*if(strpos(' '.$text, 'http')){ $text = ' '.$text; $text = preg_replace( '`([^"=\'>])((http|https|ftp)://[^\s<]+[^\s<\.)])`i', '$1<a href="$2" target="_blank" rel="nofollow">$2</a>', $text ); $text = substr($text, 1); } */ $text = str_replace('<pre>', '<pre>', $text); $text = str_replace('</pre>', '</pre>', $text); $text = nl2br_except_pre($text); return $text; }
public function arquivo($nome) { if (!file_exists(APPPATH . '/logs/' . $nome)) { show_404(); } $this->load->helper('typography'); $data['title'] = 'Arquivo de Log'; // Capitalize the first letter $data['page'] = 'arquivo'; if (!isset($data['logged'])) { $data['logged'] = $this->_logged(); } if (!isset($data['urls_restritas'])) { $data['urls_restritas'] = $this->usuario_model->get_urls_restritas($this->session->idnivel); } $str_file = nl2br_except_pre($this->load->file(APPPATH . '/logs/' . $nome, TRUE)); $this->load->view('templates/header', $data); $this->load->view('templates/top_bar_menu', $data); echo '<div class="row">' . $str_file . '</div>'; $this->load->view('templates/scripts', $data); }
<?php if ($entry['status'] == 'new'): ?> <div class="body mid entry action new"> <div class="action_rt"><?=date_user(strtotime($entry['timestamp']))?></div> New ticket opened by <?=profile_link($entry['status_pid'])?>. </div> <?php endif; ?> <div class="body mid entry"> <div class="tik_lt"> <?php if (empty($entry['subject']) !== true) : ?> <h4><?=$entry['subject']?></h4> <?php elseif ($entry['type'] === 'phone'): ?> <h4>Phone Call From <?=tel_format($entry['source'])?></h4> <?php endif; ?> <?php if (empty($entry['body_text']) !== true) : ?> <p> <?=nl2br_except_pre(auto_link($entry['body_text']))?> </p> <?php endif; ?> <?php if ( is_array($entry['attachments']) AND count($entry['attachments']) > 0 AND isset($entry['attachments']['recording.mp3']) !== true ): ?> <h5>Attachments (<?=count($entry['attachments'])?>)</h5> <p> <ul> <?php foreach ($entry['attachments'] as $file) : ?> <li> <a href="<?=site_url('communication/attachment/'.$entry['fingerprint'].'/'.basename($file['name']))?>">
?> " /> </div> <div class="thecomment"> <div class="author"><?php echo $row->comment_author; ?> </div> <div class="time"><?php echo date($this->config->item('comment_date_format'), $row->comment_date); ?> </div> <div class="clear"></div> <div class="text"> <p><?php echo nl2br_except_pre(parse_smileys($row->comment_content, $this->config->item('base_url') . "/images/")); ?> </p> </div> </div> </div> <?php } ?> <?php } else { ?> <p><?php echo lang('kb_no_comments'); ?> </p>
</table> </div> <div class="widget-empty"> <p>There is no call activity for this respondent.</p> </div> --> </section> </div> <div class="columns small-6"> <section class="contained" id="survey-introduction"> <h1 class="hd-s">Survey introduction</h1> <?php if ($survey->introduction) { ?> <p><?php echo nl2br_except_pre($survey->introduction); ?> </p> <?php } else { ?> <p>There's no introduction text.</p> <?php } ?> </section> </div> </div> <!-- END metadata --> <?php