function do_display() { global $OUT; $CI =& get_instance(); $output = $CI->output->get_output(); $tokens = array(); $CI->load->model('model_app'); $meta_info = $CI->model_app->get_page_meta_values(); $tokens['page_title'] = $meta_info['meta_title']; $tokens['page_description'] = $meta_info['meta_description']; $tokens['page_keywords'] = $meta_info['meta_keywords']; $tokens['page_h1_tag'] = $meta_info['h1_tag']; $output = replace_tokens($output, $tokens); $OUT->_display($output); }
function email_send($from, $to, $subject, $content, $wrapper = false) { $result = 0; if (is_live()) { $recipients = array($to); } else { $recipients = explode(',', get_app_var('TEST_RECIPIENTS')); } if ($wrapper) { $full_content = get_app_var('EMAIL_WRAPPER'); $tokens = array('content' => $content, 'default_charset' => get_app_var('DEFAULT_CHARSET')); $content = replace_tokens($full_content, $tokens); } $CI =& get_instance(); $CI->load->library('email'); $config = array(); $config['charset'] = get_app_var('DEFAULT_CHARSET'); $config['mailtype'] = 'html'; $CI->email->initialize($config); $CI->email->from($from, get_app_var('SITE_NAME')); $CI->email->to($recipients); $CI->email->subject($subject); $CI->email->message($content); $CI->email->send(); return $result; }
function print_blocks($zone) { $text = ""; global $con; $result = mysqli_query($con, "SELECT display_title, title, machine_title, body FROM profile_blocks WHERE pid = " . $this->id . " AND zone LIKE '" . $zone . "' ORDER BY weight"); while ($row = mysqli_fetch_array($result)) { $text .= "<section id='" . $row['machine_title'] . "-section'>"; if ($row['display_title']) { $text .= "<h2 id='" . $row['machine_title'] . "'>" . $row['title'] . "</h2>"; } $text .= replace_tokens($row['body']); $text .= "</section>"; } return $text; }
function report_site() { $this->_secure(5); $result = ''; $user = $this->session->all_userdata(); $post_data = $_POST; if (!empty($post_data) && isset($post_data['site_id']) && isset($post_data['client_id']) && isset($post_data['report_reason'])) { $this->load->model('model_users'); $this->load->model('model_sites'); $site_id = $post_data['site_id']; $client_id = $post_data['client_id']; $report_reason = $post_data['report_reason']; $user_id = $user['user_id']; $site = $this->model_sites->get_records(array('client_id' => $client_id, 'site_id' => $site_id)); $site_admins = $this->model_users->get_records(array('client_id' => $client_id, 'security_level_alias' => array('ADM', 'SUP'))); if (!empty($site_admins)) { $email_from = empty($user['user_email']) ? get_app_var('FROM_EMAIL') : $user['user_email']; $email_subject = get_app_var('REPORT_ISSUE_SUBJECT') . ' ' . $site[0]['site_title']; $email_content_raw = get_app_var('REPORT_ISSUE'); $email_content = replace_tokens($email_content_raw, array('site_name' => get_app_var('SITE_NAME'), 'login_page' => 'http://' . $_SERVER['SERVER_NAME'] . '/', 'site_title' => $site[0]['site_title'], 'report_user' => trim($user['user_first_name'] . ' ' . $user['user_last_name']), 'report_reason' => $report_reason)); foreach ($site_admins as $site_admin) { $email_to = $site_admin['user_email']; email_send($email_from, $email_to, $email_subject, $email_content, true); } } $result = 'Thank you for reporting this issue. Your information has been sent to the dashboard administrator' . (sizeof($site_admins) > 1 ? 's' : '') . '.'; } $data = array(); $data['any'] = $result; $data['action_view'] = 'misc/any'; $this->load->view('layouts/blank', $data); }
function render_mail($template, $params) { $template->html = replace_tokens($template->html, $params); $template->plaintext = replace_tokens($template->plaintext, $params); $template->subject = replace_tokens($template->subject, $params); return $template; }
$result = mysqli_query($con, "SELECT uri, alt, main_photo FROM profile_photos WHERE pid = " . $my_profile->id); if ($result) { $first = true; while ($row = mysqli_fetch_array($result)) { $attributes = ""; $classes = ""; if ($first) { $classes .= "active "; } if ($row['main_photo']) { $classes .= "photo "; $attributes = " itemprop='photo'"; } $attributes .= " class='" . $classes . "'"; echo '<img src="' . $row['uri'] . '" alt="' . replace_tokens($row['alt']) . '" ' . $attributes . '/>'; echo replace_tokens($row['body']); } } ?> </div> <p class="fn" <?php if ($reviewable) { echo 'itemprop="itemreviewed"'; } ?> ><?php echo $my_profile->get_name(); ?> <?php if ($my_profile->job_title) { ?>
function reset_password($user_email = '') { $result = false; if (!empty($user_email)) { $user = $this->get_records(array('user_email' => $user_email)); if (!empty($user)) { $user_password = $this->_generate_random_password(); $this->save(array('user_id' => $user[0]['user_id'], 'user_password' => $user_password)); $email_to = $user_email; $email_from = get_app_var('FROM_EMAIL'); $email_subject = get_app_var('PASSWORD_RESET_SUBJECT'); $email_content_raw = get_app_var('PASSWORD_RESET_CONTENT'); $email_content = replace_tokens($email_content_raw, array('login_page' => 'http://' . $_SERVER['SERVER_NAME'] . '/', 'site_name' => get_app_var('SITE_NAME'), 'user_email' => $email_to, 'user_password' => $user_password)); email_send($email_from, $email_to, $email_subject, $email_content, true); } } return $result; }