本文整理汇总了PHP中parse_form函数的典型用法代码示例。如果您正苦于以下问题:PHP parse_form函数的具体用法?PHP parse_form怎么用?PHP parse_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: discuss
function discuss($id)
{
$rs = safe_row('*, unix_timestamp(Posted) as uPosted, unix_timestamp(LastMod) as uLastMod, unix_timestamp(Expires) as uExpires', 'textpattern', 'ID=' . intval($id) . ' and Status >= 4');
if ($rs) {
populateArticleData($rs);
$result = parse_form('comments_display');
return $result;
}
return '';
}
示例2: file_download
function file_download($atts)
{
global $thisfile;
extract(lAtts(array('filename' => '', 'form' => 'files', 'id' => ''), $atts));
$from_form = false;
if ($id) {
$thisfile = fileDownloadFetchInfo('id = ' . intval($id));
} elseif ($filename) {
$thisfile = fileDownloadFetchInfo("filename = '" . doSlash($filename) . "'");
} else {
assert_file();
$from_form = true;
}
if ($thisfile) {
$out = parse_form($form);
// cleanup: this wasn't called from a form,
// so we don't want this value remaining
if (!$from_form) {
$thisfile = '';
}
return $out;
}
}
示例3: parse_pagination
<?php
parse_pagination(array('parent_class' => 'pagination pagination-lg', 'parent' => 'ul', 'li_active_class' => 'active', 'wrapper' => 'div', 'wrapper_class' => 'col-lg-12'));
?>
<?php
}
?>
</div>
<!--/#comments-list-->
<?php
parse_notices($array);
?>
<div id="comment-form">
<h3>Laisser un commentaire</h3>
<form class="form-horizontal" role="form" method="post">
<?php
parse_form('blog_single_reply_form');
?>
</form>
</div>
<!--/#comment-form-->
</div>
<!--/#comments-->
</div>
</div>
<?php
} else {
?>
<p>Article introuvable ou indisponible.</p><?php
}
?>
</div>
示例4: doArticle
function doArticle($atts, $thing = null)
{
global $pretext, $prefs, $thisarticle;
extract($prefs);
extract($pretext);
extract(gpsa(array('parentid', 'preview')));
$theAtts = lAtts(array('allowoverride' => '1', 'form' => 'default', 'status' => STATUS_LIVE, 'pgonly' => 0), $atts, 0);
extract($theAtts);
// Save *all* atts to get hold of the current article filter criteria.
filterAtts($atts);
// No output required.
if ($pgonly) {
return '';
}
// If a form is specified, $thing is for doArticles() - hence ignore
// $thing here.
if (!empty($atts['form'])) {
$thing = '';
}
if ($status) {
$status = in_array(strtolower($status), array('sticky', STATUS_STICKY)) ? STATUS_STICKY : STATUS_LIVE;
}
if (empty($thisarticle) or $thisarticle['thisid'] != $id) {
$id = assert_int($id);
$thisarticle = null;
$q_status = $status ? "AND Status = " . intval($status) : "AND Status IN (" . STATUS_LIVE . "," . STATUS_STICKY . ")";
$rs = safe_row("*, UNIX_TIMESTAMP(Posted) AS uPosted, UNIX_TIMESTAMP(Expires) AS uExpires, UNIX_TIMESTAMP(LastMod) AS uLastMod", 'textpattern', "ID = {$id} {$q_status} LIMIT 1");
if ($rs) {
extract($rs);
populateArticleData($rs);
}
}
if (!empty($thisarticle) and ($thisarticle['status'] == $status or gps('txpreview'))) {
extract($thisarticle);
$thisarticle['is_first'] = 1;
$thisarticle['is_last'] = 1;
if ($allowoverride and $override_form) {
$article = parse_form($override_form);
} else {
$article = $thing ? parse($thing) : parse_form($form);
}
if ($use_comments and $comments_auto_append) {
$article .= parse_form('comments_display');
}
unset($GLOBALS['thisarticle']);
return $article;
}
}
示例5: doArticle
function doArticle($atts, $thing = NULL)
{
global $pretext, $prefs, $thisarticle;
extract($prefs);
extract($pretext);
extract(gpsa(array('parentid', 'preview')));
extract(lAtts(array('allowoverride' => '1', 'form' => 'default', 'status' => '4'), $atts, 0));
// if a form is specified, $thing is for doArticles() - hence ignore $thing here.
if (!empty($atts['form'])) {
$thing = '';
}
if ($status) {
$status = in_array(strtolower($status), array('sticky', '5')) ? 5 : 4;
}
if (empty($thisarticle) or $thisarticle['thisid'] != $id) {
$thisarticle = NULL;
$q_status = $status ? 'and Status = ' . intval($status) : 'and Status in (4,5)';
$rs = safe_row("*, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod", "textpattern", 'ID = ' . intval($id) . " {$q_status} limit 1");
if ($rs) {
extract($rs);
populateArticleData($rs);
}
}
if (!empty($thisarticle) and ($thisarticle['status'] == $status or gps('txpreview'))) {
extract($thisarticle);
$thisarticle['is_first'] = 1;
$thisarticle['is_last'] = 1;
if ($allowoverride and $override_form) {
$article = parse_form($override_form);
} else {
$article = $thing ? parse($thing) : parse_form($form);
}
if ($use_comments and $comments_auto_append) {
$article .= parse_form('comments_display');
}
unset($GLOBALS['thisarticle']);
return $article;
}
}
示例6: chunk_split
$local_chunk = chunk_split($local_chunk);
$local_local = true;
fclose($fp);
}
/**
* Prepare (parse) content
*/
$contentArray = array();
if ($supressIP === true) {
unset($_POST['IP']);
unset($_POST['HOST']);
}
if (isset($sort)) {
$contentArray = parse_form($_POST, $sort);
} else {
$contentArray = parse_form($_POST, '');
}
/**
* If the "env_report" option is true, get environment variables
*/
$content['env'] = '';
if (isset($env_report) && $useEnvRpt) {
$content['env'] = "\n------ environmental variables ------\n";
$proxy = "";
$envIP = "";
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$envIP = $_SERVER["HTTP_X_FORWARDED_FOR"];
$proxy = $_SERVER["REMOTE_ADDR"];
} elseif (isset($_SERVER["HTTP_CLIENT_IP"])) {
$envIP = $_SERVER["HTTP_CLIENT_IP"];
} else {
示例7: doArticle
function doArticle($atts)
{
global $pretext, $prefs, $thisarticle;
extract($prefs);
extract($pretext);
extract(gpsa(array('parentid', 'preview')));
extract(lAtts(array('allowoverride' => '1', 'form' => 'default', 'status' => '4'), $atts, 0));
if ($status and !is_numeric($status)) {
$status = getStatusNum($status);
}
if (empty($thisarticle) or $thisarticle['thisid'] != $id) {
$thisarticle = NULL;
$q_status = $status ? 'and Status = ' . intval($status) : 'and Status in (4,5)';
$rs = safe_row("*, unix_timestamp(Posted) as uPosted", "textpattern", 'ID = ' . intval($id) . " {$q_status} limit 1");
if ($rs) {
extract($rs);
populateArticleData($rs);
}
}
if (!empty($thisarticle) and $thisarticle['status'] == $status) {
extract($thisarticle);
$thisarticle['is_first'] = 1;
$thisarticle['is_last'] = 1;
$form = ($allowoverride and $override_form) ? $override_form : $form;
$article = parse_form($form);
if ($use_comments and $comments_auto_append) {
$article .= parse_form('comments_display');
}
unset($GLOBALS['thisarticle']);
return $article;
}
}
示例8: doHomeArticles
function doHomeArticles($atts, $thing = NULL)
{
global $pretext, $prefs;
extract($pretext);
extract($prefs);
$customFields = getCustomFields();
$customlAtts = array_null(array_flip($customFields));
//getting attributes
$theAtts = lAtts(array('form' => 'default', 'listform' => '', 'searchform' => '', 'limit' => 10, 'category' => '', 'section' => '', 'excerpted' => '', 'author' => '', 'sort' => '', 'month' => '', 'keywords' => '', 'frontpage' => '', 'time' => 'past', 'pgonly' => 0, 'searchall' => 1, 'allowoverride' => true, 'offset' => 0, 'wraptag' => '', 'break' => '', 'label' => '', 'labeltag' => '', 'class' => '') + $customlAtts, $atts);
$theAtts['category'] = $c ? $c : '';
$theAtts['section'] = $s && $s != 'default' && $s != 'home' ? $s : '';
$theAtts['author'] = !empty($author) ? $author : '';
$theAtts['month'] = !empty($month) ? $month : '';
$theAtts['frontpage'] = $s && $s == 'home' ? true : false;
$theAtts['excerpted'] = '';
extract($theAtts);
// if a listform is specified, $thing is for doArticle() - hence ignore here.
if (!empty($listform)) {
$thing = '';
}
$pageby = empty($pageby) ? $limit : $pageby;
$match = $search = '';
if (!$sort) {
$sort = 'Posted desc';
}
//Building query parts
$frontpage = filterFrontPage();
$category = join("','", doSlash(do_list($category)));
$category = !$category ? '' : " and (Category1 IN ('" . $category . "') or Category2 IN ('" . $category . "'))";
$section = !$section ? '' : " and Section IN ('" . join("','", doSlash(do_list($section))) . "')";
$excerpted = $excerpted == 'y' ? " and Excerpt !=''" : '';
$author = !$author ? '' : " and AuthorID IN ('" . join("','", doSlash(do_list($author))) . "')";
$month = !$month ? '' : " and Posted like '" . doSlash($month) . "%'";
$id = !$id ? '' : " and ID IN (" . join(',', array_map('intval', do_list($id))) . ")";
switch ($time) {
case 'any':
$time = "";
break;
case 'future':
$time = " and Posted > now()";
break;
default:
$time = " and Posted <= now()";
}
if (!$publish_expired_articles) {
$time .= " and (now() <= Expires or Expires = " . NULLDATETIME . ")";
}
$custom = '';
if ($customFields) {
foreach ($customFields as $cField) {
if (isset($atts[$cField])) {
$customPairs[$cField] = $atts[$cField];
}
}
if (!empty($customPairs)) {
$custom = buildCustomSql($customFields, $customPairs);
}
}
$statusq = ' and Status = 5';
$where = "1=1" . $statusq . $time . $search . $category . $section . $excerpted . $month . $author . $keywords . $custom . $frontpage;
$rs = safe_rows_start("*, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod" . $match, 'textpattern', $where . ' order by ' . doSlash($sort) . ' limit 0' . intval($limit));
// get the form name
$fname = $listform ? $listform : $form;
if ($rs) {
$count = 0;
$last = numRows($rs);
$articles = array();
while ($a = nextRow($rs)) {
++$count;
populateArticleData($a);
global $thisarticle, $uPosted, $limit;
$thisarticle['is_first'] = $count == 1;
$thisarticle['is_last'] = $count == $last;
if (@constant('txpinterface') === 'admin' and gps('Form')) {
$articles[] = parse(gps('Form'));
} elseif ($allowoverride and $a['override_form']) {
$articles[] = parse_form($a['override_form']);
} else {
$articles[] = $thing ? parse($thing) : parse_form($fname);
}
// sending these to paging_link(); Required?
$uPosted = $a['uPosted'];
unset($GLOBALS['thisarticle']);
}
return doLabel($label, $labeltag) . doWrap($articles, $wraptag, $break, $class);
}
}
示例9: print_error
print_error("your <b>phone number</b> is invalid");
}
}
// check phone for validity
if (($FAX_NO) || ($fax_no)) {
$fax_no = trim($fax_no);
if ($FAX_NO)
$fax_no = trim($FAX_NO);
if (!ereg("(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}$)", $fax_no)) {
print_error("your <b>fax number</b> is invalid");
}
}
// prepare the content
$content = parse_form($HTTP_POST_VARS);
// check for a file if there is a file upload it
if ($file_name) {
if ($file_size > 0) {
if (!ereg("/$", $path_to_file))
$path_to_file = $path_to_file."/";
$location = $path_to_file.$file_name;
if (file_exists($path_to_file.$file_name))
$location .= ".new";
copy($file,$location);
unlink($file);
$content .= "Uploaded File: ".$location."\n";
}
}
示例10: sed_comments
function sed_comments($atts)
{
global $thisarticle, $prefs, $comment_preview, $pretext;
extract($prefs);
extract(lAtts(array('id' => @$pretext['id'], 'form' => 'comments', 'wraptag' => $comments_are_ol ? 'ol' : '', 'break' => $comments_are_ol ? 'li' : 'div', 'class' => __FUNCTION__, 'breakclass' => '', 'sort' => 'posted ASC'), $atts));
assert_article();
if (is_array($thisarticle)) {
extract($thisarticle);
}
if (@$thisid) {
$id = $thisid;
}
#
# Extract the sed article overrides...
# Access the custom field that houses the vars and explode the string on ';' boundaries.
#
$sed_vars = _sed_cp_get_sed_vars(@$thisarticle['sed per-article vars']);
$sed_vars = lAtts(array('sed_delay' => '0', 'sed_ttl' => '', 'sed_on_cull' => 'hide', 'sed_ttl_grace' => ''), $sed_vars);
extract($sed_vars);
if (!empty($comment_preview)) {
$preview = psas(array('name', 'email', 'web', 'message', 'parentid', 'remember'));
$preview['time'] = time();
$preview['discussid'] = 0;
$preview['message'] = markup_comment($preview['message']);
$GLOBALS['thiscomment'] = $preview;
$comments[] = parse_form($form) . n;
unset($GLOBALS['thiscomment']);
$out = doWrap($comments, $wraptag, $break, $class, $breakclass);
} else {
$rs = safe_rows_start("*, unix_timestamp(posted) as time", "txp_discuss", 'parentid=' . intval($id) . ' and visible=' . VISIBLE . ' order by ' . doSlash($sort));
$out = '';
if ($rs) {
$comments = array();
$culled_comments = array();
while ($vars = nextRow($rs)) {
$culled = false;
$show = true;
$extra = '';
$now = time();
$remaining = '';
#
# If the comment is in a deleting page then check if it is to be culled...
#
if (!empty($sed_ttl)) {
$do_cull_check = true;
#
# Are we in any grace period???
#
if (!empty($sed_ttl_grace) && 0 != $sed_ttl_grace) {
$do_cull_check = _sed_cp_if_outside_period($thisarticle['posted'], $sed_ttl_grace, $vars['time'], $remaining);
}
#
# If not then do the cull checking...
#
if ($do_cull_check) {
$culled = _sed_cp_if_outside_period($vars['time'], $sed_ttl, $now, $remaining);
}
#
# Display how long to go before culling.
#
if ($do_cull_check && !$culled) {
$vars['message'] .= "<br/><br/><strong>[MARKED FOR DELETION IN {$remaining}.]</strong>";
}
}
if ($culled) {
$extra .= ' culled';
$culled_comments[] = $vars;
$vars['time'] = $now;
$vars['message'] .= "<br/><br/><strong>[DELETED.]</strong>";
} else {
#
# See if the comment is in its "hidden" period.
# This is to try and discourage spam-robots that immediately see if their posts appear live.
#
if (!empty($sed_delay) && $sed_delay > '0') {
$show = _sed_cp_if_outside_period($vars['time'], $sed_delay, $now, $remaining);
}
#
# Still hidden so show a place-holder comment instead.
#
if (!$show) {
$extra .= ' delay_queue';
$vars['name'] = "[DELAYED]";
$vars['time'] = $now;
$vars['message'] = "A comment has been recorded and is in the delay queue.";
$vars['message'] .= "<br/><br/><strong>[REVEALED IN {$remaining}.]</strong>";
}
}
#
# Save the additional css class markup for this comment in the vars before parsing the comment form.
#
$vars['sed_class_extra'] = $extra;
$GLOBALS['thiscomment'] = $vars;
$comments[] = parse_form($form) . n;
unset($GLOBALS['thiscomment']);
}
$out .= doWrap($comments, $wraptag, $break, $class, $breakclass);
#
# Process the culled list...
#
//.........这里部分代码省略.........
示例11: print_error
if (!ereg("(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}\$)", $phone_no)) {
print_error("your <b>phone number</b> is invalid. Please give complete phone number including area code.");
}
}
// check fax for validity
if ($FAX_NO || $fax_no) {
$fax_no = trim($fax_no);
if ($FAX_NO) {
$fax_no = trim($FAX_NO);
}
if (!ereg("(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}\$)", $fax_no)) {
print_error("your <b>fax number</b> is invalid");
}
}
// prepare the content
$content = parse_form($_POST);
// check for a file if there is a file upload it
if ($file_name) {
if ($file_size > 0) {
if (!ereg("/\$", $path_to_file)) {
$path_to_file = $path_to_file . "/";
}
$location = $path_to_file . $file_name;
if (file_exists($path_to_file . $file_name)) {
$location .= ".new";
}
copy($file, $location);
unlink($file);
$content .= "Uploaded File: " . $location . "\n";
}
}
示例12: foreach
</h3>
<?php
if (is_array(get_contact_page('addresses'))) {
foreach (get_contact_page('addresses') as $_adress) {
?>
<div><span><?php
echo $_adress['CONTACT_TYPE'];
?>
</span> <?php
echo $_adress['CONTACT_TEXT'];
?>
</div>
<?php
}
}
?>
</div>
</div>
<form class="form-horizontal" role="form" method="post">
<?php
parse_form('contact_form');
?>
</form>
</div>
</div>
<!--/.col-md-8-->
</div>
<!--/.row-->
</section>
<?php
$this->sidebar_bottom();
示例13: trim
$fax_no = trim($fax_no);
if ($FAX_NO) {
$fax_no = trim($FAX_NO);
}
if (!ereg("(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}\$)", $fax_no)) {
print_error("your <b>fax number</b> is invalid");
}
}
// sort alphabetic or prepare an order
if ($sort == "alphabetic") {
uksort($HTTP_POST_VARS, "strnatcasecmp");
} elseif (ereg('^order:.*,.*', $sort) && ($list = explode(',', ereg_replace('^order:', '', $sort)))) {
$sort = $list;
}
// prepare the content
$content = parse_form($HTTP_POST_VARS, $sort);
// check for an attachment if there is a file upload it
if ($attachment_name) {
if ($attachment_size > 0) {
if (!$attachment_type) {
$attachment_type = "application/unknown";
}
$content .= "Attached File: " . $attachment_name . "\n";
$fp = fopen($attachment, "r");
$attachment_chunk = fread($fp, filesize($attachment));
$attachment_chunk = base64_encode($attachment_chunk);
$attachment_chunk = chunk_split($attachment_chunk);
}
}
// check for a file if there is a file upload it
if ($file_name) {
示例14: atb_output_form_if_exists
function atb_output_form_if_exists($atts, $thing)
{
global $yield;
extract(lAtts(array('name' => ''), $atts));
if (atb_form_exists($name)) {
$yield[] = $thing !== null ? parse(EvalElse($thing, true)) : null;
$outp = parse_form($name);
array_pop($yield);
} else {
$outp = parse(EvalElse($thing, false));
}
return $outp;
}
示例15: comments_preview
function comments_preview($atts, $thing = '', $me = '')
{
global $has_comments_preview;
if (!ps('preview')) {
return;
}
extract(lAtts(array('form' => 'comments', 'wraptag' => '', 'class' => __FUNCTION__), $atts));
assert_article();
$preview = psa(array('name', 'email', 'web', 'message', 'parentid', 'remember'));
$preview['time'] = time();
$preview['discussid'] = 0;
$preview['name'] = strip_tags($preview['name']);
$preview['email'] = clean_url($preview['email']);
if ($preview['message'] == '') {
$in = getComment();
$preview['message'] = $in['message'];
}
$preview['message'] = markup_comment(substr(trim($preview['message']), 0, 65535));
// it is called 'message', not 'novel'
$preview['web'] = clean_url($preview['web']);
$GLOBALS['thiscomment'] = $preview;
$comments = parse_form($form) . n;
unset($GLOBALS['thiscomment']);
$out = doTag($comments, $wraptag, $class);
# set a flag, to tell the comments_form tag that it doesn't have to show a preview
$has_comments_preview = true;
return $out;
}