本文整理汇总了PHP中FmtTemplateVars函数的典型用法代码示例。如果您正苦于以下问题:PHP FmtTemplateVars函数的具体用法?PHP FmtTemplateVars怎么用?PHP FmtTemplateVars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FmtTemplateVars函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: IncludeText
function IncludeText($pagename, $inclspec)
{
global $MaxIncludes, $IncludeOpt, $InclCount;
SDV($MaxIncludes, 50);
SDVA($IncludeOpt, array('self' => 1));
$npat = '[[:alpha:]][-\\w]*';
if ($InclCount++ >= $MaxIncludes) {
return Keep($inclspec);
}
$args = array_merge($IncludeOpt, ParseArgs($inclspec));
while (count($args['#']) > 0) {
$k = array_shift($args['#']);
$v = array_shift($args['#']);
if ($k == '') {
if ($v[0] != '#') {
if (isset($itext)) {
continue;
}
$iname = MakePageName($pagename, $v);
if (!$args['self'] && $iname == $pagename) {
continue;
}
$ipage = RetrieveAuthPage($iname, 'read', false, READPAGE_CURRENT);
$itext = @$ipage['text'];
}
$itext = TextSection($itext, $v, array('anchors' => 1));
continue;
}
if (preg_match('/^(?:line|para)s?$/', $k)) {
preg_match('/^(\\d*)(\\.\\.(\\d*))?$/', $v, $match);
@(list($x, $a, $dots, $b) = $match);
$upat = $k[0] == 'p' ? ".*?(\n\\s*\n|\$)" : "[^\n]*(?:\n|\$)";
if (!$dots) {
$b = $a;
$a = 0;
}
if ($a > 0) {
$a--;
}
$itext = preg_replace("/^(({$upat}){0,{$b}}).*\$/s", '$1', $itext, 1);
$itext = preg_replace("/^({$upat}){0,{$a}}/s", '', $itext, 1);
continue;
}
}
$basepage = isset($args['basepage']) ? MakePageName($pagename, $args['basepage']) : $iname;
if ($basepage) {
$itext = Qualify(@$basepage, @$itext);
}
return FmtTemplateVars(PVSE($itext), $args);
}
示例2: PmFormMail
function PmFormMail($pagename, $msgtmpl, $opt, $safe_opt)
{
global $PmFormMailHeaders, $PmFormMailParameters;
SDV($PmFormMailHeaders, '');
SDV($PmFormMailParameters, '');
if (!preg_match('/\\S/', $msgtmpl)) {
$msgtmpl = '{$$text}';
}
$msgtext = FmtTemplateVars($msgtmpl, $opt, $pagename);
$mailto = preg_split('/\\s*,\\s*/', @$safe_opt['mailto'], -1, PREG_SPLIT_NO_EMPTY);
$mailto = implode(', ', $mailto);
$from = $opt['from'];
$subject = $opt['subject'];
$header = $PmFormMailHeaders;
if ($from) {
$header = "From: {$from}\r\n{$header}";
}
$header = preg_replace("/[\r\n]*\$/", '', $header);
if ($PmFormMailParameters) {
$tf = mail($mailto, $subject, $msgtext, $header, $MailFormParameters);
} else {
$tf = mail($mailto, $subject, $msgtext, $header);
}
if (!$tf) {
return '$[An error has occurred]';
}
return NULL;
}