本文整理汇总了PHP中PCCF函数的典型用法代码示例。如果您正苦于以下问题:PHP PCCF函数的具体用法?PHP PCCF怎么用?PHP PCCF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PCCF函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MakeUploadName
function MakeUploadName($pagename, $x)
{
global $UploadNameChars, $MakeUploadNamePatterns;
SDV($UploadNameChars, "-\\w. ");
SDV($MakeUploadNamePatterns, array("/[^{$UploadNameChars}]/" => '', '/\\.[^.]*$/' => PCCF('return strtolower($m[0]);'), '/^[^[:alnum:]_]+/' => '', '/[^[:alnum:]_]+$/' => ''));
return PPRA($MakeUploadNamePatterns, $x);
}
示例2: Markup_e
function Markup_e($id, $when, $pat, $rep, $template = 'markup_e') {
if (!is_callable($rep)) $rep = PCCF($rep, $template);
Markup($id, $when, $pat, $rep);
}
示例3: MarkupMarkup
function MarkupMarkup($pagename, $text, $opt = '') {
global $MarkupWordwrapFunction, $MarkupWrapTag;
SDV($MarkupWordwrapFunction,
PCCF('return str_replace(" ", " ", nl2br($m));'));
SDV($MarkupWrapTag, 'code');
$MarkupMarkupOpt = array('class' => 'vert');
$opt = array_merge($MarkupMarkupOpt, ParseArgs($opt));
$html = MarkupToHTML($pagename, $text, array('escape' => 0));
if (@$opt['caption'])
$caption = str_replace("'", ''',
"<caption>{$opt['caption']}</caption>");
$class = preg_replace('/[^-\\s\\w]+/', ' ', @$opt['class']);
if (strpos($class, 'horiz') !== false)
{ $sep = ''; $pretext = $MarkupWordwrapFunction($text, 40); }
else
{ $sep = '</tr><tr>'; $pretext = $MarkupWordwrapFunction($text, 75); }
return Keep(@"<table class='markup $class' align='center'>$caption
<tr><td class='markup1' valign='top'><$MarkupWrapTag>$pretext</$MarkupWrapTag></td>$sep<td
class='markup2' valign='top'>$html</td></tr></table>");
}
示例4: urldecode
$HTMLStylesFmt['rtl-ltr'] = "\n .rtl {direction:rtl; unicode-bidi:bidi-override;}\n .ltr {direction:ltr; unicode-bidi:bidi-override;}\n ";
$pagename = @$_REQUEST['n'];
if (!$pagename) {
$pagename = @$_REQUEST['pagename'];
}
if (!$pagename && preg_match('!^' . preg_quote($_SERVER['SCRIPT_NAME'], '!') . '/?([^?]*)!', $_SERVER['REQUEST_URI'], $match)) {
$pagename = urldecode($match[1]);
}
$pagename = preg_replace('!/+$!', '', $pagename);
$FmtPV['$RequestedPage'] = "'" . PHSC($pagename, ENT_QUOTES) . "'";
$GroupPattern = '[\\w\\x80-\\xfe]+(?:-[\\w\\x80-\\xfe]+)*';
$NamePattern = '[\\w\\x80-\\xfe]+(?:-[\\w\\x80-\\xfe]+)*';
$WikiWordPattern = '[A-Z][A-Za-z0-9]*(?:[A-Z][a-z0-9]|[a-z0-9][A-Z])[A-Za-z0-9]*';
$SuffixPattern = '(?:-?[A-Za-z0-9\\x80-\\xd6]+)*';
SDV($PageNameChars, '-[:alnum:]\\x80-\\xfe');
SDV($MakePageNamePatterns, array('/[?#].*$/' => '', "/'/" => '', "/[^{$PageNameChars}]+/" => ' ', '/(?<=^| )([a-z])/' => PCCF("return strtoupper(\$m[1]);"), '/(?<=^| )([\\xc0-\\xdf].)/' => PCCF("return utf8toupper(\$m[1]);"), '/ /' => ''));
SDV($StrFoldFunction, 'utf8fold');
$AsSpacedFunction = 'AsSpacedUTF8';
function utf8toupper($x)
{
global $CaseConversions;
if (strlen($x) <= 2 && @$CaseConversions[$x]) {
return $CaseConversions[$x];
}
static $lower, $upper;
if (!@$lower) {
$lower = array_keys($CaseConversions);
$upper = array_values($CaseConversions);
}
return str_replace($lower, $upper, $x);
}
示例5: NoCache
global $Now;
if (!preg_match('/^(\\S*?)(\\.\\.(\\S*))?(\\s+\\S.*)?$/', trim($condparm), $match)) {
return false;
}
if ($match[4] == '') {
$x0 = $Now;
NoCache();
} else {
list($x0, $x1) = DRange($match[4]);
}
if ($match[1] > '') {
list($t0, $t1) = DRange($match[1]);
if ($x0 < $t0) {
return false;
}
if ($match[2] == '' && $x0 >= $t1) {
return false;
}
}
if ($match[3] > '') {
list($t0, $t1) = DRange($match[3]);
if ($x0 >= $t1) {
return false;
}
}
return true;
}
# This pattern enables the (:encrypt <phrase>:) markup/replace-on-save
# pattern.
SDV($ROSPatterns['/\\(:encrypt\\s+([^\\s:=]+).*?:\\)/'], PCCF("return crypt(\$m[1]);"));
示例6: preg_replace
$pagename = preg_replace('!/+$!','',$pagename);
$FmtPV['$RequestedPage'] = "'".PHSC($pagename, ENT_QUOTES)."'";
$GroupPattern = '[\\w\\x80-\\xfe]+(?:-[\\w\\x80-\\xfe]+)*';
$NamePattern = '[\\w\\x80-\\xfe]+(?:-[\\w\\x80-\\xfe]+)*';
$WikiWordPattern =
'[A-Z][A-Za-z0-9]*(?:[A-Z][a-z0-9]|[a-z0-9][A-Z])[A-Za-z0-9]*';
$SuffixPattern = '(?:-?[A-Za-z0-9\\x80-\\xd6]+)*';
SDV($PageNameChars, '-[:alnum:]\\x80-\\xfe');
SDV($MakePageNamePatterns, array(
'/[?#].*$/' => '', # strip everything after ? or #
"/'/" => '', # strip single-quotes
"/[^$PageNameChars]+/" => ' ', # convert everything else to space
'/(?<=^| )([a-z])/' => PCCF("return strtoupper(\$m[1]);"),
'/(?<=^| )([\\xc0-\\xdf].)/' => PCCF("return utf8toupper(\$m[1]);"),
'/ /' => ''));
SDV($StrFoldFunction, 'utf8fold');
$AsSpacedFunction = 'AsSpacedUTF8';
function utf8toupper($x) {
global $CaseConversions;
if (strlen($x) <= 2 && @$CaseConversions[$x])
return $CaseConversions[$x];
static $lower, $upper;
if (!@$lower) {
$lower = array_keys($CaseConversions);
$upper = array_values($CaseConversions);
}
return str_replace($lower, $upper, $x);
示例7: SDV
//Possibly replace with fn using mb_convert_encoding($v,$Charset,'UTF-8');
SDV($HTMLHeaderFmt['blogit-meta-tag'], '<meta name="generator" content="BlogIt ' . $RecipeInfo['BlogIt']['Version'] . '" />');
bi_SDVSA($bi_StatusType, array('draft', 'publish', 'sticky'));
//adding element is okay; removing elements may loose functionality
bi_SDVSA($bi_CommentType, array('open', 'readonly', 'none'));
//adding element is okay; removing elements may loose functionality
bi_SDVSA($bi_CommentApprovalType, array('true', 'false'));
bi_SDVSA($bi_Hooks, array());
//processing hooks, pointers to a function(). Format: $bi_Hooks[$type][$stage][] $type=blog,comment $stage=pre-entry, pre-save, post-save
SDVA($bi_Paths, array('pmform' => "{$FarmD}/cookbook/pmform.php", 'guiedit' => "{$FarmD}/scripts/guiedit.php", 'convert' => "{$FarmD}/cookbook/blogit/blogit_upgrade.php", 'feeds' => "{$FarmD}/scripts/feeds.php"));
// ----------------------------------------
// - Pagename patterns
SDV($PageNameChars, '-[:alnum:]' . ($Charset == 'UTF-8' ? '\\x80-\\xfe' : ''));
SDVA($bi_MakePageNamePatterns, array("/'/" => '', "/[^" . $PageNameChars . "]+/" => $bi_TitleSeparator, "/(^\\" . $bi_TitleSeparator . "+)|(\\" . $bi_TitleSeparator . "+\$)/" => '', "/\\" . $bi_TitleSeparator . "{2,}/" => $bi_TitleSeparator));
if (function_exists('Markup_e')) {
SDVA($bi_MakePageNamePatterns, array($Charset == 'UTF-8' ? "/^([\\xc0-\\xdf].)/" : '//' => $Charset == 'UTF-8' ? PCCF("return utf8toupper(\$m[1]);") : '', "/^([a-z])/" => PCCF("return strtoupper(\$m[1]);")));
} else {
SDVA($bi_MakePageNamePatterns, array($Charset == 'UTF-8' ? "/^([\\xc0-\\xdf].)/e" : '//' => $Charset == 'UTF-8' ? "utf8toupper('\$1')" : '', "/^([a-z])/e" => "strtoupper('\$1')"));
}
SDVA($bi_FixPageTitlePatterns, array('/[.\\/#]/' => ''));
// ----------------------------------------
// - Internal Use Only
// ----------------------------------------
SDVA($bi_Internal, array('debug' => false, 'dev' => false));
bi_debugLog('====== action: ' . $action . ' Target: ' . $_REQUEST['target'] . ' Save: ' . @$_REQUEST['save']);
SDVA($bi_Pages, array('admin' => $SiteGroup . '.BlogIt-Admin', 'blog_list' => $SiteGroup . '.BlogList', 'blocklist' => $SiteAdminGroup . '.Blocklist'));
SDV($bi_TemplateList, (isset($bi_Skin) ? $SiteGroup . '.BlogIt-SkinTemplate-' . $bi_Skin . ' ' : '') . $SiteGroup . '.BlogIt-CoreTemplate');
SDVA($bi_PageType, array('blog'));
//Comment is not in PageType list, since we don't want bloggers to be able to select 'comment' types.
SDV($FPLTemplatePageFmt, array('{$FullName}', $bi_Skin != 'pmwiki' ? '{$SiteGroup}.BlogIt-SkinTemplate-' . $bi_Skin : '', '{$SiteGroup}.BlogIt-CoreTemplate', '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates'));
SDV($bi_CommentPattern, '/^' . $bi_CommentGroup . '[\\/\\.](.*?)-(.*?)-(\\d{8}T\\d{6}){1}\\z/');