当前位置: 首页>>代码示例>>PHP>>正文


PHP MakePageName函数代码示例

本文整理汇总了PHP中MakePageName函数的典型用法代码示例。如果您正苦于以下问题:PHP MakePageName函数的具体用法?PHP MakePageName怎么用?PHP MakePageName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MakePageName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ReadTrail

function ReadTrail($pagename, $trailname) {
  global $RASPageName, $SuffixPattern, $GroupPattern, $WikiWordPattern,
    $LinkWikiWords;
  if (preg_match('/^\\[\\[(.+?)(->|\\|)(.+?)\\]\\]$/', $trailname, $m)) 
    $trailname = ($m[2] == '|') ? $m[1] : $m[3];
  $trailtext = RetrieveAuthSection($pagename, $trailname);
  $trailname = $RASPageName;
  $t = array();
  $n = 0;
  foreach(explode("\n", htmlspecialchars(@$trailtext, ENT_NOQUOTES)) 
          as $x) {
    $x = preg_replace("/\\[\\[([^\\]]*)->([^\\]]*)\\]\\]/",'[[$2|$1]]',$x);
    if (!preg_match("/^([#*:]+) \\s* 
          (\\[\\[([^:#!|][^|:]*?)(\\|.*?)?\\]\\]($SuffixPattern)
          | (($GroupPattern([\\/.]))?$WikiWordPattern)) (.*)/x",$x,$match))
       continue;
    if (@$match[6]) {
       if (!$LinkWikiWords) continue;
       $tgt = MakePageName($trailname, $match[6]);
    } else $tgt = MakePageName($trailname,
                               preg_replace('/[#?].+/', '', $match[3]));
    $t[$n]['depth'] = $depth = strlen($match[1]);
    $t[$n]['pagename'] = $tgt;
    $t[$n]['markup'] = $match[2];
    $t[$n]['detail'] = $match[9];
    for($i=$depth;$i<10;$i++) $d[$i]=$n;
    if ($depth>1) $t[$n]['parent']=@$d[$depth-1];
    $n++;
  }
  return $t;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:trails.php

示例2: ReadTrail

function ReadTrail($pagename, $trailname)
{
    global $SuffixPattern, $GroupPattern, $WikiWordPattern;
    $trailname = MakePageName($pagename, $trailname);
    $trailpage = ReadPage($trailname);
    if (!$trailpage) {
        return false;
    }
    $t = array();
    $n = 0;
    foreach (explode("\n", @$trailpage['text']) as $x) {
        $x = preg_replace("/^([#*]+)\\s*(({$GroupPattern}([\\.]))?{$WikiWordPattern})/", '$1 [[$2]]', $x);
        $x = preg_replace("/\\[\\[([^\\]]*)->([^\\]]*)\\]\\]/", '[[$2|$1]]', $x);
        if (!preg_match("/^([#*]+)\\s*(\\[\\[([^|]*?)(\\|.*?)?\\]\\]({$SuffixPattern}))(.*)\$/", $x, $match)) {
            continue;
        }
        $tgt = MakePageName($trailname, $match[3]);
        $t[$n]['depth'] = $depth = strlen($match[1]);
        $t[$n]['pagename'] = $tgt;
        $t[$n]['markup'] = $match[2];
        for ($i = $depth; $i < 10; $i++) {
            $d[$i] = $n;
        }
        if ($depth > 1) {
            $t[$n]['parent'] = @$d[$depth - 1];
        }
        $n++;
    }
    return $t;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:30,代码来源:trails.php

示例3: HandleNew

function HandleNew($pagename)
{
    $name = @$_REQUEST['name'];
    if (!$name) {
        Redirect($pagename);
    }
    $base = MakePageName($pagename, $_REQUEST['base']);
    $newpage = MakePageName($base, $name);
    $urlfmt = '$PageUrl?action=edit';
    if (@$_REQUEST['template']) {
        $urlfmt .= '&template=' . MakePageName($base, $_REQUEST['template']);
    }
    Redirect($newpage, $urlfmt);
}
开发者ID:prometheus-ev,项目名称:promwiki,代码行数:14,代码来源:newpagebox3.php

示例4: FmtUploadList2

function FmtUploadList2($pagename, $args)
{
    global $UploadDir, $UploadPrefixFmt, $UploadUrlFmt, $EnableUploadOverwrite, $FileListTimeFmt, $EnableDirectDownload, $HTMLStylesFmt, $FarmPubDirUrl;
    $HTMLStylesFmt['filelist'] = "\r\n   table.filelist { padding:0; margin:0; border-spacing:0; }\r\n   table.filelist td { padding:3px 0 0 0; margin:0; }\r\n   .filelist a { text-decoration:underline; }\r\n   .dotted  { background:url({$FarmPubDirUrl}/images/dot3.png) repeat-x bottom; }\r\n   .nodots { background:#feffff; }\r\n   ";
    $opt = ParseArgs($args);
    if (@$opt[''][0]) {
        $pagename = MakePageName($pagename, $opt[''][0]);
    }
    if (@$opt['re']) {
        $matchre = '/^(' . $opt['re'] . ')$/i';
    }
    if (@$opt['ext']) {
        $matchext = '/\\.(' . implode('|', preg_split('/\\W+/', $opt['ext'], -1, PREG_SPLIT_NO_EMPTY)) . ')$/i';
    }
    $uploaddir = FmtPageName("{$UploadDir}{$UploadPrefixFmt}", $pagename);
    $uploadurl = FmtPageName(IsEnabled($EnableDirectDownload, 1) ? "{$UploadUrlFmt}{$UploadPrefixFmt}/" : "\$PageUrl?action=download&amp;upname=", $pagename);
    $dirp = @opendir($uploaddir);
    if (!$dirp) {
        return '';
    }
    $filelist = array();
    while (($file = readdir($dirp)) !== false) {
        if ($file[0] == '.') {
            continue;
        }
        if (@$matchext && !preg_match(@$matchext, $file)) {
            continue;
        }
        if (@$matchre && !preg_match(@$matchre, $file)) {
            continue;
        }
        $filelist[$file] = $file;
    }
    closedir($dirp);
    $out = array();
    #asort($filelist);
    $overwrite = '';
    foreach ($filelist as $file => $x) {
        $name = PUE("{$uploadurl}{$file}");
        $stat = stat("{$uploaddir}/{$file}");
        if ($EnableUploadOverwrite) {
            $overwrite = FmtPageName("<a class='createlink'\r\n        href='\$PageUrl?action=upload&amp;upname={$file}'>&nbsp;&Delta;</a>", $pagename);
        }
        $out[] = "<tr><td class='dotted'> <a href='{$name}'>{$file}</a>{$overwrite} &nbsp;&nbsp;</td>" . "<td class='dotted' align=right><span class='nodots'>" . number_format($stat['size'] / 1024) . "Kb</span></td>" . "<td>&nbsp;&nbsp;&nbsp;" . strftime($FileListTimeFmt, $stat['mtime']) . "</td>" . "<tr>";
    }
    return implode("\n", $out);
}
开发者ID:anomen-s,项目名称:pmwiki-recipes,代码行数:47,代码来源:filelist.php

示例5: 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

示例6: FPLFauxTrail

function FPLFauxTrail($pagename, &$matches, $opt)
{
    $matches = MakePageList($pagename, $opt, 0);
    // make the matches array into a number-indexed array
    $matches = array_values($matches);
    // check for a minimum count
    if (@$opt['min']) {
        if (count($matches) < $opt['min']) {
            return '';
        }
    }
    $trailpage = '{$Group}';
    if (@$opt['trailpage']) {
        $trailpage = $opt['trailpage'];
    }
    $label = '{$Title}';
    if (@$opt['label']) {
        $label = $opt['label'];
    }
    $index_itemfmt = "<a href='{\$PageUrl}'>{$label}</a>";
    $tp_val = FmtPageName($trailpage, $pagename);
    $tp_page = MakePageName($pagename, $tp_val);
    $itemfmt = "<a href='{\$PageUrl}'>{\$Title}</a>";
    $prev_link = '';
    $next_link = '';
    $out = '';
    for ($i = 0; $i < count($matches); $i++) {
        if ($matches[$i] == $pagename) {
            if ($i > 0) {
                $prev_page = $matches[$i - 1];
                $prev_link = FmtPageName($itemfmt, $prev_page);
            }
            $trailindex = FmtPageName($index_itemfmt, $tp_page);
            if ($i + 1 < count($matches)) {
                $next_page = $matches[$i + 1];
                $next_link = FmtPageName($itemfmt, $next_page);
            }
            $out = "<p>&lt;&lt; {$prev_link} | {$trailindex} | {$next_link} &gt;&gt;</p>";
            break;
        }
    }
    return $out;
}
开发者ID:rubykat,项目名称:pmwiki-fauxtrail,代码行数:43,代码来源:fauxtrail.php

示例7: ReadTrail

function ReadTrail($pagename, $trailname)
{
    global $SuffixPattern, $GroupPattern, $WikiWordPattern, $LinkWikiWords;
    if (preg_match('/^\\[\\[(.+?)(-&gt;|\\|)(.+?)\\]\\]$/', $trailname, $m)) {
        $trailname = $m[2] == '|' ? $m[1] : $m[3];
    }
    $trailname = MakePageName($pagename, $trailname);
    $trailpage = ReadPage($trailname, READPAGE_CURRENT);
    if (!$trailpage) {
        return false;
    }
    $t = array();
    $n = 0;
    foreach (explode("\n", @$trailpage['text']) as $x) {
        $x = preg_replace("/\\[\\[([^\\]]*)->([^\\]]*)\\]\\]/", '[[$2|$1]]', $x);
        if (!preg_match("/^([#*:]+) \\s* \n          (\\[\\[([^:#!|][^|:]*?)(\\|.*?)?\\]\\]({$SuffixPattern})\n          | (({$GroupPattern}([\\/.]))?{$WikiWordPattern})) (.*)/x", $x, $match)) {
            continue;
        }
        if (@$match[6]) {
            if (!$LinkWikiWords) {
                continue;
            }
            $tgt = MakePageName($trailname, $match[6]);
        } else {
            $tgt = MakePageName($trailname, preg_replace('/[#?].+/', '', $match[3]));
        }
        $t[$n]['depth'] = $depth = strlen($match[1]);
        $t[$n]['pagename'] = $tgt;
        $t[$n]['markup'] = $match[2];
        $t[$n]['detail'] = $match[9];
        for ($i = $depth; $i < 10; $i++) {
            $d[$i] = $n;
        }
        if ($depth > 1) {
            $t[$n]['parent'] = @$d[$depth - 1];
        }
        $n++;
    }
    return $t;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:40,代码来源:trails.php

示例8: ReadTrail

function ReadTrail($pagename, $trailname)
{
    global $RASPageName, $SuffixPattern, $GroupPattern, $WikiWordPattern, $LinkWikiWords;
    if (preg_match('/^\\[\\[(.+?)(-&gt;|\\|)(.+?)\\]\\]$/', $trailname, $m)) {
        $trailname = $m[2] == '|' ? $m[1] : $m[3];
    }
    $trailtext = RetrieveAuthSection($pagename, $trailname);
    $trailname = $RASPageName;
    $trailtext = Qualify($trailname, $trailtext);
    $t = array();
    $n = 0;
    foreach (explode("\n", PHSC(@$trailtext, ENT_NOQUOTES)) as $x) {
        $x = preg_replace("/\\[\\[([^\\]]*)-&gt;([^\\]]*)\\]\\]/", '[[$2|$1]]', $x);
        if (!preg_match("/^([#*:]+) \\s* \n          (\\[\\[([^:#!|][^|:]*?)(?:\".*?\")?(\\|.*?)?\\]\\]({$SuffixPattern})\n          | (({$GroupPattern}([\\/.]))?{$WikiWordPattern})) (.*)/x", $x, $match)) {
            continue;
        }
        if (@$match[6]) {
            if (!$LinkWikiWords) {
                continue;
            }
            $tgt = MakePageName($trailname, $match[6]);
        } else {
            $tgt = MakePageName($trailname, $match[3]);
        }
        $t[$n]['depth'] = $depth = strlen($match[1]);
        $t[$n]['pagename'] = $tgt;
        $t[$n]['markup'] = $match[2];
        $t[$n]['detail'] = $match[9];
        for ($i = $depth; $i < 10; $i++) {
            $d[$i] = $n;
        }
        if ($depth > 1) {
            $t[$n]['parent'] = @$d[$depth - 1];
        }
        $n++;
    }
    return $t;
}
开发者ID:LOZORD,项目名称:UPL-Website-Revamp,代码行数:38,代码来源:trails.php

示例9: MakePageList

function MakePageList($pagename, $opt)
{
    global $MakePageListOpt, $SearchPatterns, $EnablePageListProtect, $PCache, $FmtV;
    StopWatch('MakePageList begin');
    SDVA($MakePageListOpt, array('list' => 'default'));
    $opt = array_merge((array) $MakePageListOpt, $opt);
    $readf = $opt['readf'];
    # we have to read the page if order= is anything but name
    $order = $opt['order'];
    $readf |= $order && $order != 'name' && $order != '-name';
    $pats = @(array) $SearchPatterns[$opt['list']];
    if (@$opt['group']) {
        array_unshift($pats, "/^({$opt['group']})\\./i");
    }
    # inclp/exclp contain words to be included/excluded.
    $inclp = array();
    $exclp = array();
    foreach ((array) @$opt[''] as $i) {
        $inclp[] = '/' . preg_quote($i, '/') . '/i';
    }
    foreach ((array) @$opt['+'] as $i) {
        $inclp[] = '/' . preg_quote($i, '/') . '/i';
    }
    foreach ((array) @$opt['-'] as $i) {
        $exclp[] = '/' . preg_quote($i, '/') . '/i';
    }
    $searchterms = count($inclp) + count($exclp);
    $readf += $searchterms;
    # forced read if incl/excl
    if (@$opt['trail']) {
        $trail = ReadTrail($pagename, $opt['trail']);
        foreach ($trail as $tstop) {
            $pn = $tstop['pagename'];
            $list[] = $pn;
            $tstop['parentnames'] = array();
            PCache($pn, $tstop);
        }
        foreach ($trail as $tstop) {
            $PCache[$tstop['pagename']]['parentnames'][] = $trail[$tstop['parent']]['pagename'];
        }
    } else {
        $list = ListPages($pats);
    }
    if (IsEnabled($EnablePageListProtect, 0)) {
        $readf = 1000;
    }
    $matches = array();
    $FmtV['$MatchSearched'] = count($list);
    # link= (backlinks)
    if (@$opt['link']) {
        $link = MakePageName($pagename, $opt['link']);
        $linkpat = "/(^|,){$link}(,|\$)/i";
        $readf++;
        $xlist = BacklinksTo($link, false);
        $list = array_diff($list, $xlist);
    }
    $xlist = array();
    StopWatch('MakePageList scan');
    foreach ((array) $list as $pn) {
        if ($readf) {
            $page = $readf >= 1000 ? RetrieveAuthPage($pn, 'read', false, READPAGE_CURRENT) : ReadPage($pn, READPAGE_CURRENT);
            if (!$page) {
                continue;
            }
            if (@$linkpat && !preg_match($linkpat, @$page['targets'])) {
                $PCache[$pn]['targets'] = @$page['targets'];
                $xlist[] = $pn;
                continue;
            }
            if ($searchterms) {
                $text = $pn . "\n" . @$page['targets'] . "\n" . @$page['text'];
                foreach ($inclp as $i) {
                    if (!preg_match($i, $text)) {
                        continue 2;
                    }
                }
                foreach ($exclp as $i) {
                    if (preg_match($i, $text)) {
                        continue 2;
                    }
                }
            }
            $page['size'] = strlen(@$page['text']);
        } else {
            $page = array();
        }
        $page['pagename'] = $page['name'] = $pn;
        PCache($pn, $page);
        $matches[] =& $PCache[$pn];
    }
    StopWatch('MakePageList sort');
    SortPageList($matches, $order);
    StopWatch('MakePageList update');
    if ($xlist) {
        LinkIndexUpdate($xlist);
    }
    StopWatch('MakePageList end');
    return $matches;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:99,代码来源:pagelist.php

示例10: SDV

SDV($AuthorCookieExpires, $Now + 60 * 60 * 24 * 30);
SDV($AuthorCookieDir, '/');
SDV($AuthorGroup, 'Profiles');
SDV($AuthorRequiredFmt, "<h3 class='wikimessage'>\$[An author name is required.]</h3>");
Markup('[[~', '<[[', '/\\[\\[~(.*?)\\]\\]/', "[[{$AuthorGroup}/\$1]]");
if (!isset($Author)) {
    if (isset($_POST['author'])) {
        $Author = htmlspecialchars(stripmagic($_POST['author']), ENT_QUOTES);
        setcookie('author', $Author, $AuthorCookieExpires, $AuthorCookieDir);
    } else {
        $Author = htmlspecialchars(stripmagic(@$_COOKIE['author']), ENT_QUOTES);
    }
    $Author = preg_replace('/(^[^[:alpha:]]+)|[^-\\w ]/', '', $Author);
}
if (!isset($AuthorPage)) {
    $AuthorPage = FmtPageName('$AuthorGroup/$Name', MakePageName($pagename, $Author));
}
SDV($AuthorLink, $Author ? "[[~{$Author}]]" : '?');
if (IsEnabled($EnableAuthorSignature, 1)) {
    $ROSPatterns['/~~~~/'] = '[[~$Author]] $CurrentTime';
    $ROSPatterns['/~~~/'] = '[[~$Author]]';
    Markup('~~~~', '<links', '/~~~~/', "[[~{$Author}]] {$CurrentTime}");
    Markup('~~~', '>~~~~', '/~~~/', "[[~{$Author}]]");
}
if (IsEnabled($EnablePostAuthorRequired, 0)) {
    array_unshift($EditFunctions, 'RequireAuthor');
}
## RequireAuthor forces an author to enter a name before posting.
function RequireAuthor($pagename, &$page, &$new)
{
    global $Author, $MessagesFmt, $AuthorRequiredFmt;
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:author.php

示例11: HandleBrowse

function HandleBrowse($pagename, $auth = 'read') {
  # handle display of a page
  global $DefaultPageTextFmt, $PageNotFoundHeaderFmt, $HTTPHeaders,
    $EnableHTMLCache, $NoHTMLCache, $PageCacheFile, $LastModTime, $IsHTMLCached,
    $FmtV, $HandleBrowseFmt, $PageStartFmt, $PageEndFmt, $PageRedirectFmt;
  $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
  if (!$page) Abort("?cannot read $pagename");
  PCache($pagename,$page);
  if (PageExists($pagename)) $text = @$page['text'];
  else {
    SDV($DefaultPageTextFmt,'(:include $[{$SiteGroup}.PageNotFound]:)');
    $text = FmtPageName($DefaultPageTextFmt, $pagename);
    SDV($PageNotFoundHeaderFmt, 'HTTP/1.1 404 Not Found');
    SDV($HTTPHeaders['status'], $PageNotFoundHeaderFmt);
  }
  $opt = array();
  SDV($PageRedirectFmt,"<p><i>($[redirected from] <a rel='nofollow' 
    href='{\$PageUrl}?action=edit'>{\$FullName}</a>)</i></p>\n");
  if (@!$_GET['from']) { $opt['redirect'] = 1; $PageRedirectFmt = ''; }
  else {
    $frompage = MakePageName($pagename, $_GET['from']);
    $PageRedirectFmt = (!$frompage) ? ''
      : FmtPageName($PageRedirectFmt, $frompage);
  }
  if (@$EnableHTMLCache && !$NoHTMLCache && $PageCacheFile && 
      @filemtime($PageCacheFile) > $LastModTime) {
    list($ctext) = unserialize(file_get_contents($PageCacheFile));
    $FmtV['$PageText'] = "<!--cached-->$ctext";
    $IsHTMLCached = 1;
    StopWatch("HandleBrowse: using cached copy");
  } else {
    $IsHTMLCached = 0;
    $text = '(:groupheader:)'.@$text.'(:groupfooter:)';
    $t1 = time();
    $FmtV['$PageText'] = MarkupToHTML($pagename, $text, $opt);
    if (@$EnableHTMLCache > 0 && !$NoHTMLCache && $PageCacheFile
        && (time() - $t1 + 1) >= $EnableHTMLCache) {
      $fp = @fopen("$PageCacheFile,new", "x");
      if ($fp) { 
        StopWatch("HandleBrowse: caching page");
        fwrite($fp, serialize(array($FmtV['$PageText']))); fclose($fp);
        rename("$PageCacheFile,new", $PageCacheFile);
      }
    }
  }
  SDV($HandleBrowseFmt,array(&$PageStartFmt, &$PageRedirectFmt, '$PageText',
    &$PageEndFmt));
  PrintFmt($pagename,$HandleBrowseFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:49,代码来源:pmwiki.php

示例12: SDV

    and loads the associated preferences.

    If there is no ?setprefs= request, then the script uses the
    'setprefs' cookie from the browser to load the preference settings.
    
    Script maintained by Petko YOTOV www.pmwiki.org/petko
*/

SDV($PrefsCookie, $CookiePrefix.'setprefs');
SDV($PrefsCookieExpires, $Now + 60 * 60 * 24 * 365);
$LogoutCookies[] = $PrefsCookie;

$sp = '';
if (@$_COOKIE[$PrefsCookie]) $sp = $_COOKIE[$PrefsCookie];
if (isset($_GET['setprefs'])) {
  $sp = MakePageName($pagename, $_GET['setprefs']);
  setcookie($PrefsCookie, $sp, $PrefsCookieExpires, '/');
}
if ($sp && PageExists($sp)) XLPage('prefs', $sp, true);

if(is_array($XL['prefs'])) {
  foreach($XL['prefs'] as $k=>$v) {
    if(! preg_match('/^(e_rows|e_cols|TimeFmt|Locale|Site\\.EditForm)$|^ak_/', $k))
      unset($XL['prefs'][$k]);
  }
}

XLSDV('en', array(
  'ak_view' => '',
  'ak_edit' => 'e',
  'ak_history' => 'h',
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:prefs.php

示例13: AttachExist

function AttachExist($pagename, $condparm='*') {
  global $UploadFileFmt;
  @list($fpat, $pn) = explode(' ', $condparm, 2);
  $pn = ($pn > '') ? MakePageName($pagename, $pn) : $pagename;
    
  $uploaddir = FmtPageName($UploadFileFmt, $pn);
  $flist = array();
  $dirp = @opendir($uploaddir);
  if ($dirp) {
    while (($file = readdir($dirp)) !== false)
      if ($file{0} != '.') $flist[] = $file;
    closedir($dirp);
    $flist = MatchNames($flist, $fpat);
  }
  return count($flist);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:16,代码来源:upload.php

示例14: Markup

Markup('[[~','<links','/\\[\\[~(.*?)\\]\\]/',"[[$AuthorGroup/$1]]");

$LogoutCookies[] = $AuthorCookie;

if (!isset($Author)) {
  if (isset($_POST['author'])) {
    $x = stripmagic($_POST['author']);
    setcookie($AuthorCookie, $x, $AuthorCookieExpires, $AuthorCookieDir);
  } elseif (@$_COOKIE[$AuthorCookie]) {
    $x = stripmagic(@$_COOKIE[$AuthorCookie]);
  } else $x = @$AuthId;
  $Author = PHSC(preg_replace("/[^$AuthorNameChars]/", '', $x), 
                ENT_COMPAT);
}
if (!isset($AuthorPage)) $AuthorPage = 
    FmtPageName('$AuthorGroup/$Name', MakePageName("$AuthorGroup.$AuthorGroup", $Author));
SDV($AuthorLink,($Author) ? "[[~$Author]]" : '?');

if (IsEnabled($EnableAuthorSignature,1)) {
  SDVA($ROSPatterns, array(
    '/(?<!~)~~~~(?!~)/' => "[[~$Author]] $CurrentTime",
    '/(?<!~)~~~(?!~)/' => "[[~$Author]]",
  ));
  Markup('~~~~','<[[~','/(?<!~)~~~~(?!~)/',"[[~$Author]] $CurrentTime");
  Markup('~~~','>~~~~','/(?<!~)~~~(?!~)/',"[[~$Author]]");
}
if (IsEnabled($EnablePostAuthorRequired,0))
  array_unshift($EditFunctions,'RequireAuthor');

## RequireAuthor forces an author to enter a name before posting.
function RequireAuthor($pagename, &$page, &$new) {
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:31,代码来源:author.php

示例15: InputDefault

function InputDefault($pagename, $type, $args)
{
    global $InputValues, $PageTextVarPatterns, $PCache;
    $args = ParseArgs($args);
    $args[''] = (array) @$args[''];
    $name = isset($args['name']) ? $args['name'] : array_shift($args['']);
    $name = preg_replace('/^\\$:/', 'ptv_', $name);
    $value = isset($args['value']) ? $args['value'] : array_shift($args['']);
    if (!isset($InputValues[$name])) {
        $InputValues[$name] = $value;
    }
    if (@$args['request']) {
        $req = array_merge($_GET, $_POST);
        foreach ($req as $k => $v) {
            if (!isset($InputValues[$k])) {
                $InputValues[$k] = PHSC(stripmagic($v), ENT_NOQUOTES);
            }
        }
    }
    $source = @$args['source'];
    if ($source) {
        $source = MakePageName($pagename, $source);
        $page = RetrieveAuthPage($source, 'read', false, READPAGE_CURRENT);
        if ($page) {
            foreach ((array) $PageTextVarPatterns as $pat) {
                if (preg_match_all($pat, IsEnabled($PCache[$source]['=preview'], $page['text']), $match, PREG_SET_ORDER)) {
                    foreach ($match as $m) {
                        #           if (!isset($InputValues['ptv_'.$m[2]])) PITS:01337
                        $InputValues['ptv_' . $m[2]] = PHSC(Qualify($source, $m[3]), ENT_NOQUOTES);
                    }
                }
            }
        }
    }
    return '';
}
开发者ID:BMLP,项目名称:memoryhole-ansible,代码行数:36,代码来源:forms.php


注:本文中的MakePageName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。