本文整理汇总了PHP中get_include_contents函数的典型用法代码示例。如果您正苦于以下问题:PHP get_include_contents函数的具体用法?PHP get_include_contents怎么用?PHP get_include_contents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_include_contents函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateData
function validateData($Data)
{
if (!isset($Data['name']) || !isset($Data['phone']) || !isset($Data['email']) || !isset($Data['num_people']) || !isset($Data['notes_requests'])) {
return false;
}
return true;
}
require_once 'lib/class.phpmailer.php';
include "lib/class.smtp.php";
// optional, gets called from within class.phpmailer.php if not already loaded
if (!validateData($_POST)) {
echo json_encode($_POST);
exit;
}
$Data = $_POST;
$body = get_include_contents('mail_template.php', $Data);
$mail = new PHPMailer();
$mail->IsSMTP();
// telling the class to use SMTP
$mail->SMTPDebug = 2;
// enables SMTP debug information (for testing)
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->SMTPSecure = "tls";
// sets the prefix to the servier
$mail->Host = "smtp.gmail.com";
// sets GMAIL as the SMTP server
$mail->Port = 587;
// set the SMTP port for the GMAIL server
$mail->Username = "brunoaugusto.web@gmail.com";
// GMAIL username
示例2: layout_json
function layout_json($filename, $arr = null)
{
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, max-age=0, must-revalidate");
#header('Content-Type: text/x-json; charset=utf-8');
#header('Content-Type: text/x-json');
#header('Content-Type: text/html; charset=iso-8859-1');
return get_include_contents('tpl/json/' . $filename . '.php', $arr);
}
示例3: recache_slider
function recache_slider($lang)
{
global $sitepress;
global $wpdb;
$oldLang = ICL_LANGUAGE_CODE;
$sitepress->switch_lang($lang);
$string = get_include_contents("../wp-content/themes/futurestep/home-jobsslider.php");
$query = sprintf("UPDATE `feedstore` SET `time`=CURRENT_TIMESTAMP, `output`='%s' WHERE language='" . $lang['language_code'] . "'", mysql_real_escape_string($string));
$wpdb->query($query);
$wpdb->print_error();
$sitepress->switch_lang($oldlang);
}
示例4: flagShowSkin_banner_widget_default
function flagShowSkin_banner_widget_default($args)
{
extract($args);
$flag_options = get_option('flag_options');
$skinID = 'id_' . mt_rand();
// look up for the path
$skinpath = trailingslashit($flag_options['skinsDirABS']) . $skin;
$playlistpath = $flag_options['galleryPath'] . 'playlists/banner/' . $xml . '.xml';
$js = $flag_options['skinsDirURL'] . $skin . "/jquery.cycle.lite.js";
$data = file_get_contents($skinpath . '/settings/settings.xml');
$flashBackcolor = flagGetBetween($data, '<property1>0x', '</property1>');
if (empty($width)) {
$width = flagGetBetween($data, '<width><![CDATA[', ']]></width>');
}
if (empty($height)) {
$height = flagGetBetween($data, '<height><![CDATA[', ']]></height>');
}
$wmode = flagGetBetween($data, '<property0><![CDATA[', ']]></property0>');
if (empty($flashBackcolor)) {
$flashBackcolor = $flag_options['flashBackcolor'];
}
$params['autoPlay'] = flagGetBetween($data, '<autoPlay>', '</autoPlay>');
$params['slideshowDelay'] = flagGetBetween($data, '<slideshowDelay>', '</slideshowDelay>');
$alternate = get_include_contents($skinpath . "/jgallery.php", $playlistpath, $skin, $skinID, $width, $height, $params);
// init the flash output
$swfobject = new flag_swfobject($flag_options['skinsDirURL'] . $skin . '/gallery.swf', $skinID, $width, $height, '10.1.52', plugins_url('/' . FLAGFOLDER . '/') . 'skins/expressInstall.swf');
global $swfCounter;
$swfobject->add_params('wmode', $wmode);
$swfobject->add_params('allowfullscreen', 'true');
$swfobject->add_params('allowScriptAccess', 'always');
$swfobject->add_params('saling', 'lt');
$swfobject->add_params('scale', 'noScale');
$swfobject->add_params('menu', 'false');
$swfobject->add_params('bgcolor', '#' . $flashBackcolor);
$swfobject->add_attributes('id', $skinID);
$swfobject->add_attributes('name', $skinID);
// adding the flash parameter
$swfobject->add_flashvars('path', $flag_options['skinsDirURL'] . $skin . '/');
$swfobject->add_flashvars('skinID', $skinID);
$swfobject->add_flashvars('playlist', $xml);
// create the output
$out = '<div class="grandbanner ' . $wmode . '">' . $swfobject->output($alternate) . '</div>';
// add now the script code
$out .= "\n" . '<script type="text/javascript" src="' . $js . '"></script>';
$out .= "\n" . '<script type="text/javascript" defer="defer">';
$out .= $swfobject->javascript();
$out .= "\n" . '</script>';
$out = apply_filters('flag_show_flash_w_content', $out);
return $out;
}
示例5: a895_incparse
function a895_incparse($root, $source, $parsemode, $return = false)
{
switch ($parsemode) {
case 'textile':
$source = $root . $source;
$content = file_get_contents($source);
$html = a895_textileparser($content, true);
break;
case 'txt':
$source = $root . $source;
$content = file_get_contents($source);
// links erzeugen
//$content = ereg_replace('http://www.', 'www.', $content);
$content = preg_replace('/www\\./', 'http://www.', $content);
$content = preg_replace("#(^|[^\"=]{1})(http://|ftp://|mailto:|https://)([^\\s<>]+)([\\s\n<>]|\$)#sm", "\\1<a class=\"jsopenwin\" href=\"\\2\\3\">\\3</a>\\4", $content);
$html = '<pre class="plain">' . $content . '</pre>';
break;
case 'raw':
$source = $root . $source;
$content = file_get_contents($source);
$html = $content;
break;
case 'php':
$source = $root . $source;
$html = get_include_contents($source);
break;
case 'iframe':
$html = '<iframe src="' . $source . '" width="99%" height="600px"></iframe>';
break;
case 'jsopenwin':
$html = 'Externer link: <a href="' . $source . '">' . $source . '</a>
<script language="JavaScript">
<!--
window.open(\'' . $source . '\',\'' . $source . '\');
//-->
</script>';
break;
case 'extlink':
$html = 'Externer link: <a href="' . $source . '">' . $source . '</a>';
break;
}
if ($return) {
return $html;
} else {
echo $html;
}
}
示例6: __toString
public function __toString()
{
$classes = $this->classes;
$classes[] = $this->slug;
$result = '<section class="';
$result .= implode(' ', $classes);
$result .= '"';
foreach ($this->contexts as $slug => $url) {
$result .= ' data-url-' . $slug . '="' . $url . '"';
}
$result .= ' data-channel-name="' . $this->slug . '"';
if (count($this->styles) > 0) {
$result .= ' style="';
foreach ($this->styles as $key => $value) {
$result .= $key . ': ' . $value . ';';
}
$result .= '"';
}
$result .= '>';
$result .= '<h1 class="channelname" onclick="toggleChannel($(this).closest(\'section\'));">' . $this->heading . '</h1>';
if ($this->isHidden) {
$result .= '<div class="content hiddenChannel">';
} else {
$result .= '<div class="content">';
}
if ($this->contentHTML != '') {
$result .= $this->contentHTML;
} else {
if ($this->context != '' && isset($this->contexts[$this->context])) {
$result .= get_include_contents($this->contexts[$this->context]);
} elseif (isset($this->contexts['default'])) {
$result .= get_include_contents($this->contexts['default']);
} elseif (count($this->contexts) > 0) {
$context_keys = array_keys($this->contexts);
$result .= get_include_contents($this->contexts[$context_keys[0]]);
}
}
$result .= '</div>';
$result .= '</section>';
return $result;
}
示例7: dirname
" enctype="multipart/form-data">
<?php
if (empty($_POST['edit_template']) or get_var('edit_template') == "css") {
if (empty($_POST['edit_theme'])) {
$themefile = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . AC_FOLDER_THEMES . DIRECTORY_SEPARATOR . $theme . "/css/style.css";
} else {
$themefile = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . AC_FOLDER_THEMES . DIRECTORY_SEPARATOR . get_var('edit_theme') . "/css/style.css";
}
} else {
if (empty($_POST['edit_theme'])) {
$themefile = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . AC_FOLDER_THEMES . DIRECTORY_SEPARATOR . $theme . "/template/" . get_var('edit_template') . ".php";
} else {
$themefile = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . AC_FOLDER_THEMES . DIRECTORY_SEPARATOR . get_var('edit_theme') . "/template/" . $_POST['edit_template'] . ".php";
}
}
$textarea = get_include_contents($themefile);
$textarea = stripslashes($textarea);
$textarea = htmlspecialchars($textarea);
?>
<textarea id="template_data" name="template_data"><?php
echo $textarea;
?>
</textarea>
<?php
if (is_writable($themefile)) {
?>
<dl class="selectionBox submitBox">
<dt></dt>
<dd>
<div class="floatr" style="float:right;">
<a class="fwdbutton" onclick="document.forms['template-data'].submit(); return false">
示例8: get_include_contents
}
// works
if ((include 'vars.php') == 'OK') {
echo 'OK';
}
echo "<hr>";
$foo = (include 'include/return.php');
echo $foo;
// prints 'PHP'
//because the include was successful. Notice the difference between the above examples. The first uses return within
//the included file while the other does not. If the file can't be included, FALSE is returned and E_WARNING is issued.
$bar = (include 'include/noreturn.php');
echo $bar;
// prints 1
echo "<hr>";
$string = get_include_contents('include/return.php');
echo $var;
//PHP
echo $string;
//nothing (note)
function get_include_contents($filename)
{
if (is_file($filename)) {
ob_start();
include $filename;
return ob_get_clean();
}
return false;
}
?>
示例9: bd_set_form_ml
function bd_set_form_ml($data)
{
global $config, $wpdb;
$update_form_ml = $data['form_ml'];
$form_ml_mail = get_option('form_ml_mail', 'error');
$bank_hour = $data['bank_hour'];
$bank_date = $data['bank_date'];
$data['bank_hour'] = str_replace('.', '', $data['bank_hour']);
$data['bank_date'] = str_replace('/', '-', $data['bank_date']);
$data['bank_date'] .= ' ' . $data['bank_hour'];
$data['bank_date'] = date("Y-m-d H:i:s", strtotime($data['bank_date']));
unset($data['bank_hour']);
unset($data['submit']);
unset($data['form_ml']);
if ($update_form_ml > 0) {
$update_form_ml = $wpdb->update($config['tables']['forms'], $data, array('id_form_ml' => $update_form_ml));
} else {
$data['ship_status_now'] = $config['STATUS']['POR_VERIFICAR']['id'];
$wpdb->insert($config['tables']['forms'], $data);
}
/*echo $wpdb->last_query;
echo '\nValor Form ML 222: ', $update_form_ml;
echo $wpdb->print_error();
echo $wpdb->show_errors();*/
//exit( var_dump( $wpdb->last_query ) );
//$msj = get_include_contents('/template/mail/client_register.html.php');
//var_dump($msj);
$data['bank_hour'] = $bank_hour;
$data['bank_date'] = $bank_date;
$data['ship_state'] = $config['STATES'][$data['ship_state']];
if ($wpdb->insert_id) {
$dataHistories['id_form_ml'] = $wpdb->insert_id;
$dataHistories['ship_status'] = $data['ship_status_now'];
$dataHistories['comments'] = $data['ship_comments'];
$dataHistories['time_modified'] = current_time('mysql');
$dataHistories['id_user_modifier'] = get_current_user_id();
$wpdb->insert($config['tables']['forms_histories'], $dataHistories);
//echo $wpdb->last_query;
$data['id_form_ml'] = $wpdb->insert_id;
$data['ship_status_now'] = $config['STATUS'][$data['ship_status_now']]['name'];
//Client
$data['subject'] = $config['EMAIL']['new']['client']['subject'];
$msj = get_include_contents('/template/mail/client_register.html.php', $data);
//var_dump($msj);
_send_mail($data['user_email'], $data['subject'], $msj);
//Admin
$to_admin = $config['EMAIL']['reply']['from'];
$data['subject'] = sprintf($config['EMAIL']['new']['reply']['subject'], $data['bank_name'], $data['user_names']);
$msj = get_include_contents('/template/mail/admin_register.html.php', $data);
_send_mail($to_admin, $data['subject'], $msj);
return '<p>Formulario Insertado con ÉXITO</p>';
} else {
if ($update_form_ml === false || $update_form_ml == 0) {
return '<p>Error al insertar el Formulario.</p>';
} else {
return '<p>Formulario actualizado con ÉXITO</p>';
}
}
}
示例10: get_include_contents
<?php
function get_include_contents($filename)
{
if (is_file($filename)) {
ob_start();
include $filename;
return ob_get_clean();
}
return false;
}
file_put_contents("cached_file.php", get_include_contents("template.php"));
示例11:
$adminPanel.="<div style='display:inline'> :: <a href='javascript:toggleVisibility(\"adminPanel\")';>Admin options</a></div>";
if ($CONF_show_DBG_XML) {
$adminPanel.="<div id=xmlOutput style='display:none; text-align:left;'><hr>";
$adminPanel.="XML from paraglidingEarth.com<br>";
$adminPanel.="<pre>$xmlSites1</pre><hr>XML from paragliding365.com<br><pre>$xmlSites2</pre></div>";
}
$adminPanel.="<div id='adminPanel' style='display:none; text-align:center;'><hr>";
$adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateData'=>'1'))."'>"._UPDATE_DATA."</a> | ";
$adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateMap'=>'1'))."'>"._UPDATE_MAP."</a> | ";
$adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateCharts'=>'1'))."'>"._UPDATE_GRAPHS."</a> | ";
$adminPanel.="<a href='".getLeonardoLink(array('op'=>'show_flight','flightID'=>$flightID,'updateScore'=>'1'))."'>"._UPDATE_SCORE."</a> ";
$adminPanel.=get_include_contents(dirname(__FILE__)."/site/admin_takeoff_info.php");
}
$images="";
for ( $photoNum=1;$photoNum<=$CONF_photosPerFlight;$photoNum++){
$photoFilename="photo".$photoNum."Filename";
if ($flight->$photoFilename) {
$images.="<a class='shadowBox imgBox' href='".$flight->getPhotoRelPath($photoNum).
"' target=_blank><img src='".$flight->getPhotoRelPath($photoNum).".icon.jpg' border=0></a>";
}
}
// add support for google maps
// see the config options
$localMap="";
$googleMap="";
示例12: get_include_contents
$mail->Password = 'austin67';
// SMTP password
$mail->SMTPSecure = 'tls';
// Enable encryption, 'ssl' also accepted
$mail->Port = 587;
//Set the SMTP port number - 587 for authenticated TLS
$mail->setFrom('kaylene@kaylene.life', 'Kaylene');
//Set who the message is to be sent from
//$mail->addReplyTo('labnol@gmail.com', 'First Last'); //Set an alternative reply-to address
$mail->addAddress($email, $name);
// Add a recipient
//$mail->addAddress('ellen@example.com'); // Name is optional
//$mail->addCC('cc@example.com');
//$mail->addBCC('bcc@example.com');
$mail->WordWrap = 50;
// Set word wrap to 50 characters
//$mail->addAttachment('/usr/labnol/file.doc'); // Add attachments
//$mail->addAttachment('/images/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true);
// Set email format to HTML
// $mail->SMTPDebug = 2;
$mail->Subject = $subject_line;
$variable['message'] = $message;
$mail->Body = get_include_contents('mail/confirmation.php', $variable);
$mail->Send();
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
示例13: importStylesheet
public function importStylesheet($filename)
{
$this->addStyle(get_include_contents($filename));
}
示例14: enviaEmail
function enviaEmail($tipoEmail, $nomePessoa, $emailPessoa, $novaSenha = null, $idPedido = null, $despacho = null, $cupomDesconto = null)
{
if ($tipoEmail == 'novaSenha') {
$mensagem = $_SERVER['DOCUMENT_ROOT'] . '/emails/nova-senha.php';
$assunto = utf8_decode('Solicitação de nova senha');
$_POST['nomePessoa'] = $nomePessoa;
$_POST['novaSenha'] = $novaSenha;
} else {
if ($tipoEmail == 'situacaoPedido') {
$mensagem = $_SERVER['DOCUMENT_ROOT'] . '/emails/pedido-realizado.php';
$assunto = utf8_decode('Acompanhamento de Pedido');
$_POST['idPedido'] = $idPedido;
$_POST['despacho'] = $despacho;
} else {
if ($tipoEmail == 'cupomDesconto') {
$mensagem = $_SERVER['DOCUMENT_ROOT'] . '/emails/cupom-desconto.php';
$assunto = utf8_decode('Cupom Desconto');
$_POST['cupomDesconto'] = $cupomDesconto;
} else {
if ($tipoEmail == 'divulgaListaCasamento') {
$query = "SELECT \r\n\t\t\t\t\t\tLICA.CONJUGE1+' & '+LICA.CONJUGE2 NOIVOS,\r\n\t\t\t\t\t\tLICA.URL,\r\n\t\t\t\t\t\tLICA.FOTO_CAPA\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\te_LISTA_CASAMENTO LICA\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tLICA.ID_LISTA_CASAMENTO = " . $nomePessoa . "";
$valueQuery = $mysqli->ConsultarSQL($query);
$mensagem = $_SERVER['DOCUMENT_ROOT'] . '/emails/lista-casamento-email-divulgar.php';
$assunto = utf8_decode('Lista de Casamento de ' . $valueQuery[0]['NOIVOS']);
$_POST['nomeNoivos'] = $valueQuery[0]['NOIVOS'];
$_POST['urlListaCasamento'] = $valueQuery[0]['URL'];
$_POST['fotoCapa'] = $valueQuery[0]['FOTO_CAPA'];
}
}
}
}
$html = get_include_contents($mensagem, $_POST);
//printr($html);
//Create a new PHPMailer instance
$mail = new PHPMailer();
//Tell PHPMailer to use SMTP
$mail->IsSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "comunicacao@comlines.com.br";
//Password to use for SMTP authentication
$mail->Password = "sprcomlines";
//Set who the message is to be sent from
$mail->SetFrom('atendimento@comlines.com.br', 'Atendimento Comlines');
//Set an alternative reply-to address
$mail->AddReplyTo('atendimento@comlines.com.br', 'Atendimento Comlines');
//Set the subject line
$mail->Subject = 'Atendimento Comlines - ' . $assunto;
//Read an HTML message body from an external file, convert referenced images to embedded, convert HTML into a basic plain-text alternative body
$mail->MsgHTML($html, dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->AltBody = $assunto;
//Attach an image file
//$mail->AddAttachment('images/phpmailer_mini.gif');
//Set who the message is to be sent to
if ($tipoEmail != 'divulgaListaCasamento') {
$mail->AddAddress($emailPessoa, $nomePessoa);
} else {
$emailPessoa = explode(',', $emailPessoa);
foreach ($emailPessoa as $value) {
$mail->AddAddress($value, '');
}
}
if ($mail->Send()) {
return true;
} else {
return false;
}
$mail->ClearAddresses();
}
示例15: send_confirmation
function send_confirmation()
{
global $link, $groupx_ClassTable;
function get_include_contents($filename, $variablesToMakeLocal)
{
extract($variablesToMakeLocal);
if (is_file($filename)) {
ob_start();
include $filename;
return ob_get_clean();
}
return false;
}
$emailData = $_POST['emailData'];
foreach ($emailData as $key) {
$email = json_decode($key);
}
$user_email = $email->user_email;
$eventID = $email->class_id;
echo $user_email;
$str_query = 'SELECT equipment FROM `trilakes_groupx_classes` WHERE `event_id` = ' . $eventID;
$obj_result = mysqli_query($link, $str_query);
while ($arr_line = mysqli_fetch_array($obj_result, MYSQLI_ASSOC)) {
$arr_content = $arr_line;
}
$equipt = $arr_content['equipment'];
$mail = new PHPMailer();
$mail->isSMTP();
// Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com';
// Specify main and backup server
$mail->SMTPAuth = true;
// Enable SMTP authentication
$mail->Username = 'groupx67@gmail.com';
// SMTP username
$mail->Password = 'austin67';
// SMTP password
$mail->SMTPSecure = 'tls';
// Enable encryption, 'ssl' also accepted
$mail->Port = 587;
//Set the SMTP port number - 587 for authenticated TLS
$mail->setFrom('PPYMCA@groupondemand.com', 'PPYMCA');
//Set who the message is to be sent from
//$mail->addReplyTo('labnol@gmail.com', 'First Last'); //Set an alternative reply-to address
$mail->addAddress($email->user_email, $_SESSION['user_name']);
// Add a recipient
//$mail->addAddress('ellen@example.com'); // Name is optional
//$mail->addCC('cc@example.com');
//$mail->addBCC('bcc@example.com');
$mail->WordWrap = 50;
// Set word wrap to 50 characters
//$mail->addAttachment('/usr/labnol/file.doc'); // Add attachments
//$mail->addAttachment('/images/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true);
// Set email format to HTML
// $mail->SMTPDebug = 2;
$mail->Subject = 'GroupX Workout Confirmation';
$variable['equipment'] = $equipt;
$variable['instructor'] = $email->instructor;
$variable['startTime'] = $email->startTime;
$variable['className'] = $email->className;
$variable['user_name'] = $_SESSION['user_name'];
$mail->Body = get_include_contents('confirmation.php', $variable);
$mail->Send();
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
}