public function sendPredefined($email, $email_id, $search = array(), $replace = array()) { global $config, $conn; if (!class_exists('VFile')) { require $config['BASE_DIR'] . '/classes/file.class.php'; } $sql = "SELECT email_subject, email_path FROM emailinfo WHERE email_id = '" . $email_id . "' LIMIT 1"; $rs = $conn->execute($sql); $email_subject = str_replace($search, $replace, $rs->fields['email_subject']); $email_path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path']; $body = VFile::read($email_path); $body = str_replace($search, $replace, $body); $this->setNoReply(); $this->Subject = $email_subject; $this->AltBody = $body; $this->Body = nl2br($body); if (is_array($email)) { foreach ($email as $email_address) { $this->AddAddress($email_address); $this->Send(); $this->ClearAddresses(); } } else { $this->AddAddress($email); $this->Send(); } }
$message = htmlspecialchars(trim($_POST['message']), ENT_QUOTES, 'UTF-8'); if (valid_email($from) && valid_email($to)) { if ($video_id) { $sql = "SELECT VID, title FROM video WHERE VID = " . $video_id . " LIMIT 1"; $rs = $conn->execute($sql); if ($conn->Affected_Rows() === 1) { $title = prepare_string($rs->fields['title']); $video_url = $config['BASE_URL'] . '/video/' . $video_id . '/' . $title; $sql = "SELECT * FROM emailinfo WHERE email_id='player_email' LIMIT 1"; $rs = $conn->execute($sql); if ($conn->Affected_Rows() === 1) { require $config['BASE_DIR'] . '/classes/email.class.php'; require $config['BASE_DIR'] . '/classes/file.class.php'; $subject = $rs->fields['email_subject']; $path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path']; $body = VFile::read($path); $search = array('{$site_name}', '{$video_url}', '{$message}'); $replace = array($config['site_name'], $video_url, $message); $body = str_replace($search, $replace, $body); $mail = new VMail(); $mail->From = $from; $mail->FromName = $from; $mail->Sender = $from; $mail->AddReplyTo($from); $mail->Subject = $subject; $mail->AltBody = $body; $mail->Body = nl2br($body); $mail->AddAddress($to); $mail->Send(); } }
$emails[] = $user['email']; } } if (!$emails) { $data['msg'] = $lang['ajax.share_recipient_valid']; } else { $sql = "SELECT title FROM video WHERE VID = " . $video_id . " LIMIT 1"; $rs = $conn->execute($sql); if ($conn->Affected_Rows() == 1) { $title = $rs->fields['title']; $url = $config['BASE_URL'] . '/video/' . $video_id . '/' . clean($title); $sql = "SELECT email_subject, email_path FROM emailinfo\n WHERE email_id = 'share_video' LIMIT 1"; $rs = $conn->execute($sql); $email_subject = str_replace('{$sender_name}', $from, $rs->fields['email_subject']); $email_path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path']; $body = VFile::read($email_path); $body = str_replace('{$site_name}', $config['site_name'], $body); $body = str_replace('{$video_link}', $url, $body); $body = str_replace('{$sender_name}', $from, $body); $body = str_replace('{$message}', $message, $body); $mail = new VMail(); $mail->setNoReply(); $mail->Subject = $email_subject; $mail->AltBody = $body; $mail->Body = nl2br($body); foreach ($emails as $email) { $mail->AddAddress($email); $mail->Send(); $mail->ClearAddresses(); } $data['status'] = 1;
<?php defined('_VALID') or die('Restricted Access!'); require $config['BASE_DIR'] . '/classes/filter.class.php'; require $config['BASE_DIR'] . '/classes/file.class.php'; require $config['BASE_DIR'] . '/classes/auth.class.php'; Auth::checkAdmin(); $html = NULL; if (isset($_POST['page'])) { $filter = new VFilter(); $page = $filter->get('page'); $pages_allowed = array('terms', 'privacy', 'dmca', '2257', 'advertise', 'faq', 'webmasters', 'whatis'); if (in_array($page, $pages_allowed)) { $static_path = $config['BASE_DIR'] . '/templates/frontend/' . $config['template'] . '/static/' . $page . '.tpl'; if (file_exists($static_path) && is_file($static_path)) { $html = VFile::read($static_path); } } } echo $html; die;