本文整理汇总了PHP中PageTextVar函数的典型用法代码示例。如果您正苦于以下问题:PHP PageTextVar函数的具体用法?PHP PageTextVar怎么用?PHP PageTextVar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PageTextVar函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ThumbShoeKeywords
function ThumbShoeKeywords($pagename, $label = 'LinkedName')
{
global $ThumbShoeKeywordsGroup;
$inval = PageTextVar($pagename, 'Keywords');
$out = '';
// don't process if there are already links there
if (strpos($inval, '[[') !== false) {
$out = $inval;
} else {
$array_sep = '';
if (strpos($inval, ';') !== false) {
$array_sep = ';';
}
$oo = array();
if ($label == 'Name') {
$pn = str_replace($array_sep, ' ', $inval);
$cpage = MakePageName($pagename, "{$ThumbShoeKeywordsGroup}.{$pn}");
$out = PageVar($cpage, '$Name');
} else {
$parts = $array_sep ? explode($array_sep, $inval) : array($inval);
foreach ($parts as $part) {
$part = trim($part);
if ($part) {
$cpage = MakePageName($pagename, "{$ThumbShoeKeywordsGroup}.{$part}");
if ($label == 'LinkedTitle') {
$oo[] = "[[{$cpage}|+]]";
} else {
$oo[] = "[[{$cpage}|{$part}]]";
}
}
}
}
if ($array_sep == ',' or $array_sep == ';') {
$out .= implode("{$array_sep} ", $oo);
} else {
if ($array_sep == '/' or $array_sep == ' ') {
$out .= implode($array_sep, $oo);
} else {
$out .= implode(" {$array_sep} ", $oo);
}
}
}
rtrim($out);
return $out;
}
示例2: PageVar
function PageVar($pagename, $var, $pn = '') {
global $Cursor, $PCache, $FmtPV, $AsSpacedFunction, $ScriptUrl,
$EnablePathInfo;
if ($var == '$ScriptUrl') return PUE($ScriptUrl);
if ($pn) {
$pn = isset($Cursor[$pn]) ? $Cursor[$pn] : MakePageName($pagename, $pn);
} else $pn = $pagename;
if ($pn == '') return '';
if (preg_match('/^(.+)[.\\/]([^.\\/]+)$/', $pn, $match)
&& !isset($PCache[$pn]['time'])
&& (!@$FmtPV[$var] || strpos($FmtPV[$var], '$page') !== false))
{ $page = ReadPage($pn, READPAGE_CURRENT); PCache($pn, $page); }
@list($d, $group, $name) = $match;
$page = &$PCache[$pn];
if (@$FmtPV[$var]) return eval("return ({$FmtPV[$var]});");
if (strncmp($var, '$:', 2)==0) return PageTextVar($pn, substr($var, 2));
return '';
}
示例3: TaggerLinksVar
function TaggerLinksVar($pagename, $tagname, $catgroup, $label)
{
$inval = PageTextVar($pagename, $tagname);
$outval = TaggerProcessTags($pagename, $catgroup, $inval, $label);
rtrim($outval);
return $outval;
}
示例4: bi_GetPageVar
function bi_GetPageVar($pagename, &$page, $tag)
{
global $TimeISOZFmt, $RSSTimeFmt;
$d = (int) PageTextVar($pagename, 'entrydate');
return "<{$tag}>" . ($tag == 'dc:date' ? gmstrftime($TimeISOZFmt, $d) : ($tag == 'pubDate' ? gmdate($RSSTimeFmt, $d) : ($tag == 'author' ? PageTextVar($pagename, 'entryauthor') : ''))) . "</{$tag}>\n";
}
示例5: bi_Convert
function bi_Convert($src, $auth = 'admin', $dataset, $pagelist, $mode)
{
global $bi_ConvertRules, $bi_TagSeparator, $_GET, $SearchPatterns;
$datarules = $bi_ConvertRules[$dataset];
$pagelist = MatchPageNames($pagelist, $SearchPatterns['default']);
foreach ($pagelist as $i => $pn) {
list($group, $name) = explode('.', $pn);
#$name used to derive title.
$pagetext = '';
$org = RetrieveAuthPage($pn, $auth, 0, READPAGE_CURRENT);
echo "<b>{$pn}</b><br/>";
if (!$org) {
echo 'No admin privs on page.<br/>';
continue;
}
$entryType = PageTextVar($pn, 'entrytype');
if ($mode == 'convert' && empty($entryType) || $mode == 'upgrade' && $entryType == 'blog') {
#populate $new_field_val array for each $new_field_name based on $new_field_rules
foreach ($datarules['new'] as $new_field_name => $new_field_rules) {
$new_field_val[$new_field_name] = '';
#is the new field based on an old_field or was the field defined in the prior version, with the same name?
if (isset($datarules['old'][$new_field_name])) {
$new_field_val[$new_field_name] = PageTextVar($pn, $new_field_name);
# Get basic separated list with no formatting
if ($datarules['old'][$old_field]['format']) {
$new_field_val[$new_field_name] = implode($bi_TagSeparator, preg_match_all('/' . $datarules['old'][$old_field]['format'] . '/', $new_field_val[$new_field_name], $m) ? $m[1] : array());
}
}
# Set default value if none calculated so far
if (empty($new_field_val[$new_field_name]) && isset($datarules['new'][$new_field_name]['default'])) {
$new_field_val[$new_field_name] = eval('return (' . $datarules['new'][$new_field_name]['default'] . ');');
}
# Format the field
if (isset($datarules['new'][$new_field_name]['format'])) {
$new_field_val[$new_field_name] = str_replace('$1', $new_field_val[$new_field_name], $datarules['new'][$new_field_name]['format']);
} else {
$new_field_val[$new_field_name] = '(:' . $new_field_name . ':' . $new_field_val[$new_field_name] . ':)';
}
$pagetext .= $new_field_val[$new_field_name] . "\n";
}
} elseif ($mode == 'revert' && $entryType == 'blog') {
$pagetext = PageTextVar($pn, 'entrybody') . "\n\n" . PageTextVar($pn, 'pmmarkup');
} else {
echo 'Nothing to ' . $mode . '<br/>';
}
if ($_GET['writetofile'] == 'true') {
if (!empty($pagetext)) {
$new = $org;
$new['csum'] = $new['csum:' . $GLOBALS['Now']] = $GLOBALS['ChangeSummary'] = 'BlogIt Format: ' . $mode;
$new['diffclass'] = 'minor';
$new['text'] = $pagetext;
PostPage($pn, $org, $new);
#Don't need UpdatePage, as we don't require edit functions to run
echo 'BlogIt page attributes written.<br/>';
} else {
echo 'Nothing to write.<br/>';
}
}
echo str_replace("\n", '<br/>', $pagetext . '<br/>');
}
}
示例6: MXDisplayAllPTVs
function MXDisplayAllPTVs($pagename, $list)
{
global $PCache;
$pgout = array();
$out = array();
$plist = isset($list) ? explode(',', $list) : array($pagename);
foreach ($plist as $pn) {
$pn = MakePageName($pagename, $pn);
$pgout[$pn][0] = "!!!![[{$pn}]]\n";
PageTextVar($pn, '');
foreach ($PCache[$pn] as $key => $val) {
if (substr($key, 0, 3) != "=p_") {
continue;
}
$pgout[$pn][] = "'''" . substr($key, 3) . "''': " . $val . "\\\\\n";
}
if (!isset($pgout[$pn][1])) {
unset($pgout[$pn]);
continue;
}
sort($pgout[$pn]);
$out[] = implode("\n", $pgout[$pn]);
}
return implode("\n", $out);
}