當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PageTextVar函數代碼示例

本文整理匯總了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;
}
開發者ID:rubykat,項目名稱:pmwiki-thumbshoe,代碼行數:45,代碼來源:vars.php

示例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 '';
}
開發者ID:BogusCurry,項目名稱:pmwiki,代碼行數:18,代碼來源:pmwiki.php

示例3: TaggerLinksVar

function TaggerLinksVar($pagename, $tagname, $catgroup, $label)
{
    $inval = PageTextVar($pagename, $tagname);
    $outval = TaggerProcessTags($pagename, $catgroup, $inval, $label);
    rtrim($outval);
    return $outval;
}
開發者ID:rubykat,項目名稱:pmwiki-tagger,代碼行數:7,代碼來源:tagger.php

示例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";
}
開發者ID:jefmud,項目名稱:pmwiki-kit-bootstrap-compass,代碼行數:6,代碼來源:blogit.php

示例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/>');
    }
}
開發者ID:Nepherim,項目名稱:BlogIt,代碼行數:61,代碼來源:blogit_upgrade.php

示例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);
}
開發者ID:jefmud,項目名稱:pmwiki-kit-bootstrap-compass,代碼行數:25,代碼來源:powertools.php


注:本文中的PageTextVar函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。