本文整理汇总了PHP中parse_template函数的典型用法代码示例。如果您正苦于以下问题:PHP parse_template函数的具体用法?PHP parse_template怎么用?PHP parse_template使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_template函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: email_quote
function email_quote($quote_id, $quote_template, $from, $to, $subject, $body, $cc = NULL, $bcc = NULL)
{
$CI =& get_instance();
$CI->load->helper('mailer/phpmailer');
$CI->load->helper('template');
$CI->load->helper('pdf');
$quote = generate_quote_pdf($quote_id, FALSE, $quote_template);
$db_quote = $CI->mdl_quotes->where('ip_quotes.quote_id', $quote_id)->get()->row();
$message = nl2br(parse_template($db_quote, $body));
return phpmail_send($from, $to, $subject, $message, $quote, $cc, $bcc);
}
示例2: cache_templates
function cache_templates($templatetitles)
{
global $con;
foreach ($templatetitles as $templatetitle) {
if (!parsed_is_current($templatetitle)) {
parse_template($templatetitle);
}
if (file_exists(parsedtemplatepath($templatetitle))) {
$con->templatecache[$templatetitle] = file_get_contents(parsedtemplatepath($templatetitle));
}
}
}
示例3: index
function index()
{
$data = array();
$data['page'] = 'about';
if ($this->sg_auth->is_logged_in()) {
$data['logged_in'] = true;
$uuid = $this->sg_auth->get_uuid();
$data['user_data'] = $this->simiangrid->get_user($uuid);
} else {
$data['logged_in'] = false;
}
parse_template('about', $data);
}
示例4: subtplcheck
/**
* JETLEE
* 与模板处理相关的辅助类
*
*
*/
function subtplcheck($subfiles, $mktime, $tpl, $tplrefresh = 0)
{
if ($tplrefresh && ($tplrefresh == 1 || mt_rand(1, $tplrefresh) == 1)) {
$subfiles = explode('|', $subfiles);
foreach ($subfiles as $subfile) {
$tplfile = $subfile . '.htm';
@($submktime = filemtime($tplfile));
if ($submktime > $mktime) {
include_once APPPATH . 'libraries/Template.php';
parse_template($tpl);
break;
}
}
}
}
示例5: email_quote
function email_quote($quote_id, $quote_template, $from, $to, $subject, $body, $cc = null, $bcc = null, $attachments = null)
{
$CI =& get_instance();
$CI->load->helper('mailer/phpmailer');
$CI->load->helper('template');
$CI->load->helper('pdf');
$quote = generate_quote_pdf($quote_id, false, $quote_template);
$db_quote = $CI->mdl_quotes->where('ip_quotes.quote_id', $quote_id)->get()->row();
$message = parse_template($db_quote, $body);
$subject = parse_template($db_quote, $subject);
$cc = parse_template($db_quote, $cc);
$bcc = parse_template($db_quote, $bcc);
$from = array(parse_template($db_quote, $from[0]), parse_template($db_quote, $from[1]));
return phpmail_send($from, $to, $subject, $message, $quote, $cc, $bcc, $attachments);
}
示例6: select_html
public static function select_html($selected = 0, $name = "userrole_id", $class = "select", $template = '%name%')
{
$roles = new UserRole();
$roles->get_iterated();
echo "<select name='{$name}' class='{$class}'>";
foreach ($roles as $role) {
if ($selected == $role->id) {
$selstr = " selected='selected'";
} else {
$selstr = "";
}
$format = parse_template($template, $role->stored);
echo "<option value='{$role->id}' class='user_select'{$selstr}>" . $format . "</option>\n";
}
echo "</select>";
}
示例7: pastebin
$textwithlinks .= "</tr>\n";
}
$textwithlinks .= "</table>\n";
}
if ($cleantext != "" && isset($_REQUEST['pastebin'])) {
$url = pastebin($cleantext, $name);
$pastebin = "Pastebin url: <a href=\"{$url}\" target=\"_blank\">{$url}</a>";
}
$cleantext = "<h1>translated for copy and paste</h1>\n<pre>{$cleantext}</pre>";
return array('PASTEBIN' => $pastebin, 'RESULTCLEAN' => $cleantext, 'RESULTHTML' => $textwithlinks);
}
$res['PASTEBIN'] = "";
/*initianlize vars for template*/
$res['RESULTHTML'] = "";
$res['RESULTCLEAN'] = "";
$res['TEXTAREA'] = getinfolog();
$res['TRANSLATOR'] = "http://springrts.com:8000";
$res['INFO'] = "";
if ($res['TEXTAREA'] != "") {
limit();
$tmp = xmlrpcrequest($res['TRANSLATOR'], $res['TEXTAREA']);
/* if (array_key_exists('faultString',$tmp)){
$res['INFO']="<h1>Warning: using local translator, as remote can't translate</h1>";
$res['TRANSLATOR']="http://abma.de:8000";
$tmp=xmlrpcrequest($res['TRANSLATOR'],$res['TEXTAREA']);
}*/
$res = array_merge($res, parse_result($tmp, getVersion($res['TEXTAREA'])));
}
$res['ACTION'] = $_SERVER['SCRIPT_NAME'];
echo parse_template("index.tpl", $res);
示例8: foreach
}
}
// Display most popular comments
if (!empty($top_likes)) {
echo "\t" . '<br><b class="cmtfont">' . $text['popular_cmts'] . ' Comment' . (count($top_likes) != '1' ? 's' : '') . ':</b>' . PHP_EOL;
$variable = '';
foreach ($top_likes as $file) {
$likes_array = parse_comments($file, array(), 'no');
}
parse_template(array_values($likes_array), $top_cmts);
}
// Display comment count
echo "\t" . '<br><b class="cmtfont">' . $text['showing_cmts'] . ' ' . ($script = $cmt_count == "1" ? '0 Comments:</b>' . PHP_EOL : display_count() . ':</b>' . PHP_EOL);
// Display comments, if there are no comments display a note
if (!empty($show_cmt)) {
parse_template($show_cmt, $total_count);
} else {
echo "\t" . '<div style="margin: 16px 0px 12px 0px;" class="cmtdiv">' . PHP_EOL;
echo "\t\t" . '<span class="cmtnumber"><img width="' . $icon_size . '" height="' . $icon_size . '" src="/img/first-comment.png"></span>' . PHP_EOL;
echo "\t\t" . '<div style="height: ' . $icon_size . 'px;" class="cmtbubble">' . PHP_EOL;
echo "\t\t\t" . '<b class="cmtnote cmtfont" style="color: #000000;">Be the first to comment!</b>' . PHP_EOL;
echo "\t\t" . '</div>' . PHP_EOL;
echo "\t" . '</div>' . PHP_EOL;
}
?>
<br><center>
HashOver Comments ·
<?php
if (!empty($show_cmt)) {
echo "\t\t" . '<a href="http://' . $domain . '/hashover.php?rss=' . $page_url . '" target="_blank">RSS Feed</a> ·' . PHP_EOL;
示例9: ajax_send_email
function ajax_send_email()
{
$this->form_validation->set_rules('client_name', 'client name', 'trim|required|xss_clean');
$this->form_validation->set_rules('email_subject', 'email subject', 'trim|required|xss_clean');
$this->form_validation->set_rules('email_template', 'email template', 'trim|required|xss_clean');
$this->form_validation->set_rules('email_body', 'email body', 'trim|required|xss_clean');
$this->form_validation->set_error_delimiters('<p class="has-error"><label class="control-label">', '</label></p>');
if ($this->form_validation->run()) {
$this->load->helper('template');
$quote_id = $this->input->post('quote_id');
$email_subject = $this->input->post('email_subject');
$email_body = $this->input->post('email_body');
$quote_data = $this->quotes_model->get_quote_details($quote_id);
$message_body = parse_template($quote_data, $email_body);
$quote_details = $this->quotes_model->previewquote($quote_id);
$this->load->helper('pdf');
$pdf_quote = generate_pdf_quote($quote_details, false, NULL);
$to = $quote_data->client_email;
if (send_email($email_subject, $to, $message_body, $pdf_quote)) {
$this->session->set_flashdata('success', 'The quote has been emailed successfully !!');
$response = array('success' => 1);
} else {
$response = array('success' => 0, 'errormsg' => 'Please set the company name and the company email in system settings first !!');
}
} else {
$this->load->helper('json_error');
$response = array('success' => 0, 'validation_errors' => json_errors());
}
echo json_encode($response);
}
示例10: normale
/**********************/
/***********************/
/* PAGE CREATION */
/***********************/
/*
choix du template principal :
page normale (par defaut), pop-up ou page pour impression
*/
if (eregi("fen_pop", $_SERVER['QUERY_STRING'])) {
$page['fen'] = "pop";
}
if (eregi("fen_impression", $_SERVER['QUERY_STRING'])) {
$page['fen'] = "impression";
}
if (isset($page['fen']) and $page['fen'] == "pop") {
$template = $tpl['general']['pop'];
$html_code = parse_template(TPL_URL . $template, $index);
} elseif (isset($_GET['fen']) and $_GET['fen'] == "pop") {
$template = $tpl['general']['pop'];
$html_code = parse_template(TPL_URL . $template, $index);
} elseif (isset($page['fen']) and $page['fen'] == "ajax") {
$html_code = $index['contenu'];
} elseif (isset($page['fen']) and $page['fen'] == "impression") {
$template = $tpl['general']['imprime'];
$html_code = parse_template(TPL_URL . $template, $index);
} else {
$template = $tpl['general']['index'];
$html_code = parse_template(TPL_URL . $template, $index);
}
echo $html_code;
/***********************/
示例11: elseif
$parse_main['{width_preview_elements}'] = '';
$parse_main['{height_preview_elements}'] = '';
if (isset($config['width_preview_elements']) and $config['width_preview_elements'] != '') {
$parse_main['{width_preview_elements}'] = 'value="' . $config['width_preview_elements'] . '" ';
} elseif (isset($config['height_preview_elements']) and $config['height_preview_elements'] != '') {
$parse_main['{height_preview_elements}'] = 'value="' . $config['height_preview_elements'] . '" ';
}
if (isset($error) and is_array($error)) {
$parse_main['{error}'] = parse_template(get_template('info'), array("{type}" => 'error', "{title}" => "Ошибка!", "{text}" => implode("<br />", $error)));
} else {
$parse_main['{error}'] = '';
}
$cachefile = $config['cachefile'];
if (!file_exists($cachefile) or time() - @filemtime($cachefile) > $config['cache_time']) {
touch($cachefile);
//чтобы только один пользователь запускал подсчет
list($size, $images_total, $images_h24) = get_dir_size($config['uploaddir']);
$size = formatfilesize($size);
file_put_contents($cachefile, "{$images_total}|{$size}|{$images_h24}");
} elseif (file_exists($cachefile)) {
list($images_total, $size, $images_h24) = explode("|", file_get_contents($cachefile));
}
$parse_main['{size}'] = $size;
$parse_main['{images}'] = $images_total;
$parse_main['{images24}'] = $images_h24;
$parse_main['{site_http_path}'] = $config['site_url'];
if (!$parse_main['{content}']) {
$parse_main['{content}'] = '';
}
echo parse_template(get_template('index'), $parse_main);
示例12: template
function template($file, $language = 'templates')
{
global $tplrefresh, $tpldir, $styleid, $timestamp;
$tpldir = $tpldir ? $tpldir : 'templates/default';
$templateid = $styleid ? $styleid : 1;
$tplfile = CYASK_ROOT . './' . $tpldir . '/' . $file . '.html';
$objfile = CYASK_ROOT . './askdata/templates/' . $templateid . '_' . $file . '.tpl.php';
if ($tplrefresh == 1 || $tplrefresh > 1 && substr($timestamp, -1) > $tplrefresh) {
if (@filemtime($tplfile) > @filemtime($objfile)) {
require_once CYASK_ROOT . './include/template.func.php';
parse_template($file, $language, $tpldir, $templateid);
}
}
return $objfile;
}
示例13: index
function index()
{
$data = array();
$data['page'] = 'about';
parse_template('about', $data);
}
示例14: template
function template($tplfile, $fullpath = 0)
{
global $_SCONFIG;
if (empty($fullpath)) {
$filename = 'templates/' . $_SCONFIG['template'] . '/' . $tplfile . '.html.php';
$objfile = S_ROOT . './cache/tpl/tpl_' . $_SCONFIG['template'] . '_' . $tplfile . '.php';
$tplfile = S_ROOT . './' . $filename;
} else {
$filename = $tplfile;
$objfile = str_replace('/', '_', $filename);
$objfile = S_ROOT . './cache/tpl/tpl_' . $objfile . '.php';
$tplfile = S_ROOT . './' . $filename;
}
$tplrefresh = 1;
if (file_exists($objfile)) {
if (empty($_SCONFIG['tplrefresh'])) {
$tplrefresh = 0;
} else {
if (@filemtime($tplfile) <= @filemtime($objfile)) {
$tplrefresh = 0;
}
}
}
if ($tplrefresh) {
include_once S_ROOT . './function/template.func.php';
parse_template($tplfile, $objfile);
}
return $objfile;
}
示例15: template
function template($file, $tpldir = '')
{
global $setting;
$tpldir = '' == $tpldir ? $setting['tpl_dir'] : $tpldir;
$tplfile = TIPASK_ROOT . '/view/' . $tpldir . '/' . $file . '.html';
$objfile = TIPASK_ROOT . '/data/view/' . $tpldir . '_' . $file . '.tpl.php';
if ('default' != $tpldir && !is_file($tplfile)) {
$tplfile = TIPASK_ROOT . '/view/default/' . $file . '.html';
$objfile = TIPASK_ROOT . '/data/view/default_' . $file . '.tpl.php';
}
if (!file_exists($objfile) || @filemtime($tplfile) > @filemtime($objfile)) {
require_once TIPASK_ROOT . '/lib/template.func.php';
parse_template($tplfile, $objfile);
}
return $objfile;
}