本文整理汇总了PHP中parse函数的典型用法代码示例。如果您正苦于以下问题:PHP parse函数的具体用法?PHP parse怎么用?PHP parse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render($region = "")
{
$out = "";
if ($region == "page") {
if ($this->all) {
ob_start();
include "inc/header.php";
$out .= ob_get_contents();
ob_end_clean();
}
if ($this->all) {
if (isset($this->parent->scripts)) {
foreach ($this->parent->scripts as $script) {
$out .= $script->render("body");
}
}
$out .= parse($this, "body");
}
if ($this->file != "" and file_exists($this->file)) {
ob_start();
include $this->file;
$out .= ob_get_contents();
ob_end_clean();
} else {
$out .= "File not found: " . $this->file;
}
if ($this->all) {
ob_start();
include "inc/footer.php";
$out .= ob_get_contents();
ob_end_clean();
}
}
return $out;
}
示例2: getSU_paquetesPendientes
public function getSU_paquetesPendientes($FUPE_NU_NRO_DOC, $FUPE_FE_ESTADO_DESDE, $FUPE_FE_ESTADO_HASTA, $FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO, $FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)
{
$query = "SELECT \"ID\", \"Fecha Carga\", \"Canal\", \"Nro. Documento\", \"Producto\", \"Sucursal\", \"Nro. Solicitud\", \"Fecha GD\",\n\t\t\"Estado Formulario\", \"Area Resolución\", \"Fecha Alta de Solicitud\", \"idSolicitante\", \"Modalidad de Venta\", \"Programa de Venta\",\n\t\t\"Fecha Ultimo Estado\", \"Ultimo Estado\", \"Fecha de Rechazo\", \"Tipo de Rechazo\", \"Motivos de Rechazo\" FROM (SELECT FUPE_NU_ID \"ID\",\n\t\tTO_CHAR (FUPE_FE_ESTADO_1, 'DD/MM/YYYY') \"Fecha Carga\", FUPE_CD_CANAL \"Canal\", FUPE_NU_NRO_DOC \"Nro. Documento\", FUPE_CD_PRODUCTO \"Producto\",\n\t\tFUPE_CD_COD_SUCURSAL \"Sucursal\", FUPE_NU_NRO_SOLICITUD \"Nro. Solicitud\", TO_CHAR (FUPE_FE_ESTADO_GD, 'DD/MM/YYYY') \"Fecha GD\",\n\t\tFUPE_CD_ESTADO_FORM \"Estado Formulario\", FUPE_CD_AREA_RESOL \"Area Resolución\", FUPE_FE_ALTA_SOL \"Fecha Alta de Solicitud\",\n\t\tFUPE_CD_IDSOL \"idSolicitante\", FUPE_CD_MOD_VENTA \"Modalidad de Venta\", FUPE_CD_PRG_VENTA \"Programa de Venta\", CASE\n\t\tWHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_SCORING IS NULL THEN TO_CHAR (FUPE_FE_ESTADO_1, 'DD/MM/YYYY') ELSE TO_CHAR (FUPE_FE_ESTADO_SCORING, 'DD/MM/YYYY') END ELSE\n\t\tTO_CHAR (FUPE_FE_ESTADO_RCH_SCORING, 'DD/MM/YYYY') END ELSE TO_CHAR (FUPE_FE_ESTADO_RNG_SCORING, 'DD/MM/YYYY') END ELSE TO_CHAR (FUPE_FE_ESTADO_13, 'DD/MM/YYYY')\n\t\tEND \"Fecha Ultimo Estado\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_SCORING IS NULL THEN FUPE_CD_ESTADO_1 ELSE FUPE_CD_ESTADO_SCORING END ELSE\n\t\t'RECHAZO DE VERIFICACION DE VEAL' END ELSE FUPE_CD_ESTADO_RNG_SCORING END ELSE FUPE_CD_ESTADO_13 END \"Ultimo Estado\", CASE\n\t\tWHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_SCORING IS NULL THEN NULL ELSE NULL END ELSE TO_CHAR (FUPE_FE_ESTADO_RCH_SCORING, 'DD/MM/YYYY') END ELSE NULL END ELSE NULL END\n\t\t\"Fecha de Rechazo\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL THEN CASE\n\t\tWHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_SCORING IS NULL THEN NULL ELSE NULL END ELSE FUPE_CD_MOTIVO_RCH_SCORING END ELSE\n\t\tNULL END ELSE NULL END \"Tipo de Rechazo\", CASE WHEN FUPE_CD_ESTADO_13 IS NULL THEN CASE WHEN FUPE_CD_ESTADO_RNG_SCORING IS NULL\n\t\tTHEN CASE WHEN FUPE_CD_ESTADO_RCH_SCORING IS NULL THEN CASE WHEN FUPE_CD_ESTADO_SCORING IS NULL THEN NULL ELSE NULL END ELSE\n\t\tFUPE_CD_ESTADO_RCH_SCORING END ELSE NULL END ELSE NULL END \"Motivos de Rechazo\" FROM CPI.SUCURSALES\n\t\tWHERE FUPE_CD_ESTADO_REPROCESO IS NULL AND FUPE_CD_ESTADO_13 IS NULL AND (FUPE_CD_ESTADO_FORM IS NULL OR FUPE_CD_ESTADO_FORM != 'Solicitud Declinada') ";
if (!empty($FUPE_NU_NRO_DOC)) {
$query .= " AND FUPE_NU_NRO_DOC = '{$FUPE_NU_NRO_DOC}' ";
}
if (!empty($FUPE_FE_ESTADO_DESDE) && !empty($FUPE_FE_ESTADO_HASTA)) {
$query .= " AND FUPE_FE_ESTADO_1 BETWEEN '{$FUPE_FE_ESTADO_DESDE}' AND '{$FUPE_FE_ESTADO_HASTA}'";
}
if (!empty($FUPE_FE_ESTADO_DESDE) && empty($FUPE_FE_ESTADO_HASTA)) {
$query .= " AND FUPE_FE_ESTADO_1 >= '{$FUPE_FE_ESTADO_DESDE}'";
}
if (empty($FUPE_FE_ESTADO_DESDE) && !empty($FUPE_FE_ESTADO_HASTA)) {
$query .= " AND FUPE_FE_ESTADO_1 <= '{$FUPE_FE_ESTADO_HASTA}'";
}
$query .= ") WHERE 1 = 1 ";
if (!empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && !empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
$query .= " AND \"Fecha Ultimo Estado\" BETWEEN TO_DATE('{$FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO}','DD/MM/YYYY') AND TO_DATE('{$FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO}','DD/MM/YYYY')";
}
if (!empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
$query .= " AND \"Fecha Ultimo Estado\" >= TO_DATE('{$FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO}','DD/MM/YYYY')";
}
if (empty($FUPE_FE_ESTADO_DESDE_ULTIMO_ESTADO) && !empty($FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO)) {
$query .= " AND \"Fecha Ultimo Estado\" <= TO_DATE('{$FUPE_FE_ESTADO_HASTA_ULTIMO_ESTADO}','DD/MM/YYYY')";
}
return json_encode($this->conection . parse($query));
}
示例3: func_cd
function func_cd($param, $fd)
{
static $prev;
$nextdir = parse($param);
if (isset($nextdir[1][1])) {
if ($nextdir[1][1][0] == "~") {
$nextdir[1][1] = preg_replace("/~/", my_getenv("HOME"), $nextdir[1][1]);
}
if ($nextdir[1][1] == "-") {
cdmoin($prev, $fd);
} else {
if (!file_exists($nextdir[1][1])) {
echo "cd: {$nextdir[1][1]} No such file or directory\n";
} else {
if (!is_readable($nextdir[1][1])) {
echo "cd: {$nextdirt[1][1]}: Permission denied\n";
} else {
$prev = my_getenv("PWD");
majenv("OLDPWD", my_getenv("PWD"));
chdir($nextdir[1][1]);
majenv("PWD", getcwd());
}
}
}
} else {
func_cd("cd ~", $fd);
}
}
示例4: generate_documentation
/**
* Generate the documentation. The "main loop", so to speak.
*
* @param string $file (the filename)
* @return void
*/
function generate_documentation($file)
{
$code = file_get_contents($file);
$sections = parse($file, $code);
$sections = highlight($file, $sections);
generate_html($file, $sections);
}
示例5: add_ban_ip
function add_ban_ip($ip, $id_modo, $duree, $motif, $motif_admin)
{
inc_lib('bbcode/parse');
$motif_admin = parse(insertBD(trim($motif_admin)));
$motif = insertBD(trim($motif_admin));
Nw::$DB->query("INSERT INTO " . Nw::$prefix_table . "ban_ip(ban_ip, ban_id_modo,\n ban_date, ban_date_end, ban_is_end, ban_motif, ban_motif_admin)\n VALUES(" . ip2long($ip) . ", " . intval($id_modo) . ", NOW(),\n NOW() + " . intval($duree) . " DAY, 0, '" . $motif . "', '" . $motif_admin . "'");
}
示例6: Parse
public function Parse($topic)
{
if ($_COOKIE['ostrich_mode'] == 1) {
foreach ($User->IgnoreList as $ignored_phrase) {
if (stripos($reply_body, $ignored_phrase) !== false) {
$this->Ignored = true;
$this->ParsedBody = '[This post has matched a phrase on your ignore list and is therefore hidden.]';
return;
}
}
}
$body = parse($this->Body);
// Linkify citations. (This might be updated to use preg_replace_callback in the future.)
preg_match_all('/^@([0-9,]+)/m', $body, $matches);
foreach ($matches[0] as $formatted_id) {
$name = '';
$pure_id = str_replace(array('@', ','), '', $formatted_id);
if (!array_key_exists($pure_id, $topic->Replies)) {
$body = str_replace($formatted_id, '<span class="unimportant">(Citing a deleted or non-existent reply.)</span>', $body);
} else {
if ($topic->Replies[$pure_id]->isHidden()) {
$body = str_replace($formatted_id, '<span class="unimportant help" title="' . snippet($topic->Replies[$pure_id]->Body) . '">@hidden</span>', $body);
} else {
if ($pure_id == $topic->PreviousReply->ID) {
$link_text = '@previous';
} else {
$link_text = $formatted_id;
}
$body = str_replace($formatted_id, '<a href="#reply_' . $pure_id . '" onclick="highlightReply(\'' . $pure_id . '\'); createSnapbackLink(\'' . $reply_id . '\')" class="unimportant help" title="' . snippet($topic->Replies[$pure_id]->Body) . '">' . $link_text . '</a> <span class="unimportant citation">(' . $topic->GetName($this, $pure_id) . ')</span>', $body);
}
}
}
$this->ParsedBody = preg_replace('/^@OP/', '<span class="unimportant">@OP</span>', $body);
}
示例7: getContent
public function getContent()
{
global $sql;
//Lang::load('blocks/shoutbox/lang.*.php');
$err = new Error();
$note = new Notifier('note-shoutbox');
$form['author'] = LOGGED ? User::$nickname : '';
$form['message'] = '';
if (isset($_POST['reply-shoutbox'])) {
$form['author'] = LOGGED ? User::$nickname : filter($_POST['author-shoutbox'], 100);
$form['message'] = filter($_POST['message-shoutbox'], Kio::getConfig('message_max', 'shoutbox'));
$err->setError('author_empty', t('Author field is required.'))->condition(!$form['author']);
$err->setError('author_exists', t('Entered nickname is registered.'))->condition(!LOGGED && is_registered($form['author']));
$err->setError('message_empty', t('Message field is required.'))->condition(!$form['message']);
// No errors
if ($err->noErrors()) {
$sql->exec('
INSERT INTO ' . DB_PREFIX . 'shoutbox (added, author, message, author_id, author_ip)
VALUES (
' . TIMESTAMP . ',
"' . $form['author'] . '",
"' . cut($form['message'], Kio::getConfig('message_max', 'shoutbox')) . '",
' . UID . ',
"' . IP . '")');
$sql->clearCache('shoutbox');
$note->success(t('Entry was added successfully.'));
redirect(HREF . PATH . '#shoutbox');
} else {
$note->error($err->toArray());
}
}
// If cache for shoutbox doesn't exists
if (!($entries = $sql->getCache('shoutbox'))) {
$query = $sql->query('
SELECT u.nickname, u.group_id, s.added, s.author, s.author_id, s.message
FROM ' . DB_PREFIX . 'shoutbox s
LEFT JOIN ' . DB_PREFIX . 'users u ON u.id = s.author_id
ORDER BY s.id DESC
LIMIT ' . Kio::getConfig('limit', 'shoutbox'));
while ($row = $query->fetch()) {
if ($row['author_id']) {
$row['author'] = User::format($row['author_id'], $row['nickname'], $row['group_id']);
$row['message'] = parse($row['message'], Kio::getConfig('parser', 'shoutbox'));
}
$entries[] = $row;
}
$sql->putCacheContent('shoutbox', $entries);
}
try {
$tpl = new PHPTAL('blocks/shoutbox/shoutbox.tpl.html');
$tpl->entries = $entries;
$tpl->err = $err->toArray();
$tpl->form = $form;
$tpl->note = $note;
return $tpl->execute();
} catch (Exception $e) {
return template_error($e->getMessage());
//echo Note::error($e->getMessage());
}
}
示例8: oui_if_dailymotion
function oui_if_dailymotion($atts, $thing)
{
global $thisarticle;
extract(lAtts(array('custom' => null, 'video' => null), $atts));
$result = $video ? _oui_dailymotion($video) : _oui_dailymotion($thisarticle[strtolower($custom)]);
return defined('PREF_PLUGIN') ? parse($thing, $result) : parse(EvalElse($thing, $result));
}
示例9: CheckHost
function CheckHost($host, $port, $texture)
{
$fp = fsockopen ($host, $port, $errno, $errstr, 10);
if(!$fp)
{
$DbLink = new DB;
$DbLink->query("UPDATE ".C_MAP_REGIONS_TBL." set failcounter = failcounter + 1 ".
"where serverIP = '" . mysql_escape_string($host) . "' AND ".
"serverPort = '" . mysql_escape_string($port) . "' AND ".
"regionMapTexture = '".mysql_escape_string($texture) ."'");
//Setting a "fake" update time so this host will have time
//to get back online
$next = time() + (30 * 60); // 30 mins, so we don't get stuck
$DbLink->query("UPDATE ".C_MAP_REGIONS_TBL." set lastcheck = $next " .
" where serverIP = '" . mysql_escape_string($host) . "' AND ".
"serverPort = '" . mysql_escape_string($port) . "' AND ".
"regionMapTexture = '".mysql_escape_string($texture) ."'");
}
else
{
$DbLink = new DB;
$DbLink->query("UPDATE ".C_MAP_REGIONS_TBL." set failcounter = 0 ".
" where serverIP = '" . mysql_escape_string($host) . "' AND ".
"serverPort = '" . mysql_escape_string($port) . "' AND ".
"regionMapTexture = '".mysql_escape_string($texture) ."'");
parse($host,$port, $texture);
}
}
示例10: up
public function up()
{
$table = Base::table('pages');
$table2 = Base::table('posts');
if ($this->has_table_column($table, 'content')) {
$sql = 'ALTER TABLE `' . $table . '` ';
$sql .= 'CHANGE `content` `markdown` TEXT';
DB::ask($sql);
}
if (!$this->has_table_column($table, 'html') && $this->has_table_column($table, 'markdown')) {
$sql = 'ALTER TABLE `' . $table . '` ';
$sql .= 'ADD `html` TEXT NOT NULL AFTER `markdown`';
DB::ask($sql);
$pages = Page::sort('menu_order', 'desc')->get();
foreach ($pages as $page) {
Page::update($page->id, array('html' => parse($page->markdown)));
}
}
if (!$this->has_table_column($table2, 'markdown') && $this->has_table_column($table2, 'html')) {
$sql = 'ALTER TABLE `' . $table2 . '` ';
$sql .= 'ADD `markdown` TEXT NOT NULL AFTER `description`';
DB::ask($sql);
$migrate_data_sql = 'update `' . $table2 . '` set `markdown` = `html`, `html` = "";';
DB::ask($migrate_data_sql);
$posts = Post::sort('created', 'desc')->get();
foreach ($posts as $post) {
Post::update($post->id, array('html' => parse($post->markdown)));
}
}
}
示例11: main
function main()
{
download();
parse();
sanitize();
final_html_generation();
}
示例12: process
function process()
{
global $error;
if (isset($_FILES['file'])) {
$file_name = $_FILES['file']['name'];
$file_size = $_FILES['file']['size'];
$file_tmp = $_FILES['file']['tmp_name'];
$file_type = $_FILES['file']['type'];
$file_ext = strtolower(end(explode('.', $_FILES['file']['name'])));
$file_error = $_FILES['file']['error'];
$expensions = array("xlsx");
if ($file_error == 4) {
$error = "Please upload file";
} else {
if ($file_size > 2097152) {
$error = 'File size must be excately 2 MB';
} else {
if (in_array($file_ext, $expensions) === false) {
$error = "extension not allowed, please choose xlsx file.";
} else {
move_uploaded_file($file_tmp, "files/" . $file_name);
parse("files/" . $file_name);
echo 'Success!!!';
return;
}
}
}
}
include 'index.php';
}
示例13: renderIfYield
/**
* Conditional for yield.
*
* @param array $atts
* @param string $thing
* @return string
*/
public static function renderIfYield($atts, $thing)
{
global $yield;
extract(lAtts(array('value' => null), $atts));
$inner = end($yield);
return parse(EvalElse($thing, $inner !== null && ($value === null || (string) $inner === (string) $value)));
}
示例14: func_cp
function func_cp($argv, $fd)
{
$argv = parse($argv);
if (!file_exists($argv[1][1])) {
echo "cp: {$argv[1][1]} No such file or directory\n";
} else {
if (is_dir($argv[1][1])) {
echo "cp: {$argv[1][1]}: Is a directory\n";
} else {
if (!is_readable($argv[1][1])) {
echo "cp: {$argv[1][1]}: Permission denied\n";
} else {
if (($file = fopen($argv[1][1], "r")) === FALSE) {
echo "cp: {$argv[1][1]}: Cannot open file\n";
} else {
if (!file_exists($argv[1][2])) {
echo "cp: {$argv[1][2]} No such file or directory\n";
} else {
if (!is_dir($argv[1][2]) && file_exists($argv[2])) {
echo "cp: {$argv[1][2]}: Not a directory\n";
} else {
if (!opendir($argv[1][2])) {
echo "cp: {$argv[1][2]}: Permission denied\n";
} else {
mycp($file, $argv);
}
}
}
}
}
}
}
}
示例15: ckr_if_image_count
function ckr_if_image_count($atts, $thing)
{
// Extract attributes from tag
extract(lAtts(array('category' => false, 'min' => false, 'max' => false, 'equal' => false, 'not' => false), $atts));
// Count the images in specified category if given or globally
$count = $category ? intval(ckr_image_count(array('category' => $category))) : intval(ckr_image_count());
// Instead of almost unreadable if-else syntax, we use this clever switch-true/case-if counstruct
switch (true) {
case $min && !$max && !$equal && !$not:
// Is greater than min value
return parse(EvalElse($thing, $count >= intval($min) ? true : false));
break;
case $max && !$min && !$equal && !$not:
// Is lesser than max value
return parse(EvalElse($thing, $count <= intval($max) ? true : false));
break;
case $equal && !$min && !$max && !$not:
// Is equal
return parse(EvalElse($thing, $count == intval($equal) ? true : false));
break;
case $not && !$min && !$max && !$equal:
// Is not equal
return parse(EvalElse($thing, $count != intval($not) ? true : false));
break;
case $min && $max && !$equal && !$not:
// Between min and max
return parse(EvalElse($thing, $count >= intval($min) && $count <= intval($max) ? true : false));
break;
default:
// Anything else will output an error message
return '<!-- ckr_if_image_count: Wrong attribute count or combination. -->';
}
}