php Markup_e类(方法)实例源码

下面列出了php Markup_e 类(方法)源码代码实例,从而了解它的用法。

作者:rubyka    项目:pmwiki-tagge   
function TaggerSetup()
{
    global $TaggerGroups;
    global $FmtPV;
    if ($TaggerGroups) {
        foreach ($TaggerGroups as $tagname => $catgroup) {
            $FmtPV['$' . $tagname . 'Linked'] = "TaggerLinksVar(\$pn, '{$tagname}', '{$catgroup}', 'LinkedTitle')";
            $FmtPV['$' . $tagname . 'LinkedName'] = "TaggerLinksVar(\$pn, '{$tagname}', '{$catgroup}', 'LinkedName')";
            $FmtPV['$' . $tagname . 'Name'] = "TaggerLinksVar(\$pn, '{$tagname}', '{$catgroup}', 'Name')";
        }
        // markup to insert the links
        $tags = array_keys($TaggerGroups);
        $tagpat = implode('|', $tags);
        if (function_exists('Markup_e')) {
            # added by Petko Yotov
            Markup_e("tagger", '<directives', '/^(\\(:)?(' . $tagpat . '):(.*?)(:\\))?$/', "TaggerLinks(\$pagename, \$m[1], \$m[2], \$m[3], \$m[4])");
            // deal with the "hidden" PTVs
            Markup_e('textvar:', '<split', '/\\(:(\\w[-\\w]*):((?!\\)).*?):\\)/s', "TaggerHiddenVars(\$pagename, \$m[1], \$m[2])");
        } else {
            Markup("tagger", '<directives', '/^(\\(:)?(' . $tagpat . '):(.*?)(:\\))?$/e', "TaggerLinks(\$pagename, '\$1', '\$2', '\$3', '\$4')");
            // deal with the "hidden" PTVs
            Markup('textvar:', '<split', '/\\(:(\\w[-\\w]*):((?!\\)).*?):\\)/se', "TaggerHiddenVars(\$pagename, '\$1', '\$2')");
        }
        // hidden Tagger PTVs get hidden after link-processing
        Markup('textvar:ol', ">links", '/^\\(:\\w[-\\w]*:.*?:\\)$/', '');
    }
}

作者:BogusCurr    项目:pmwik   
PHSC(stripmagic(@$_REQUEST['q']), ENT_NOQUOTES)));
XLSDV('en', array(
  'SearchFor' => 'Results of search for <em>$Needle</em>:',
  'SearchFound' => 
    '$MatchCount pages found out of $MatchSearched pages searched.'));

SDV($PageListArgPattern, '((?:\\$:?)?\\w+)[:=]');

Markup_e('pagelist', 'directives',
  '/\\(:pagelist(\\s+.*?)?:\\)/i',
  "FmtPageList('\$MatchList', \$pagename, array('o' => \$m[1].' '))");
Markup_e('searchbox', 'directives',
  '/\\(:searchbox(\\s.*?)?:\\)/',
  "SearchBox(\$pagename, ParseArgs(\$m[1], '$PageListArgPattern'))");
Markup_e('searchresults', 'directives',
  '/\\(:searchresults(\\s+.*?)?:\\)/i',
  "FmtPageList(\$GLOBALS['SearchResultsFmt'], \$pagename, 
       array('req' => 1, 'request'=>1, 'o' => \$m[1]))");

SDV($SaveAttrPatterns['/\\(:(searchresults|pagelist)(\\s+.*?)?:\\)/i'], ' ');

SDV($HandleActions['search'], 'HandleSearchA');
SDV($HandleAuth['search'], 'read');
SDV($ActionTitleFmt['search'], '| $[Search Results]');

SDVA($PageListFilters, array(
  'PageListCache' => 80,
  'PageListProtect' => 90,
  'PageListSources' => 100,
  'PageListPasswords' => 120,
  'PageListIf' => 140,
  'PageListTermsTargets' => 160,

作者:jefmu    项目:pmwiki-bootstrap-ski   
$opt = ParseArgs($args);
    // expect link, class
    // TODO: test for options
    // TODO: handle alt params
    // TODO: handle rel=nofollow per pmwiki settings
    // what about other PmWiki shortcut-type things?
    // like... [[PmWiki/basic editing|+]]%apply=link class="btn"%
    $target = $opt['link'];
    $text = $opt['text'] ? $opt['text'] : $target;
    // if text not provided, default to the link
    $class = $opt['class'];
    $l = '<a href="%s" class="%s">%s</a>';
    $linkf = sprintf($l, $target, $class, $text);
    return $linkf;
}
Markup_e('icon', 'inline', '/\\(:icon(\\s+.*?)?:\\)/i', "BootstrapIcon(\$m[1])");
function BootstrapIcon($args)
{
    $icon = sprintf('<i class=%s ></i>', $args);
    return Keep($icon);
}
# if (:noleft:) markup is present, mainbody will be span12
# otherwise, default to span9 (ie sidebar is span3)
if (!isset($BodySpan)) {
    $BodySpan = "span9";
}
Markup('noleft', 'directives', '/\\(:noleft:\\)/i', "HideLeftBoot()");
# SetTmplDisplay() is a core pmwiki function defined in pmwiki.php
function HideLeftBoot()
{
    global $BodySpan;

作者:BogusCurr    项目:pmwik   
$Conditions['expr'] = 'CondExpr($pagename, $condname, $condparm)';
$Conditions['('] = 'CondExpr($pagename, $condname, $condparm)';
$Conditions['['] = 'CondExpr($pagename, $condname, $condparm)';

$MarkupTable['_begin']['seq'] = 'B';
$MarkupTable['_end']['seq'] = 'E';
Markup('fulltext','>_begin');
Markup('split','>fulltext',"\n",
  '$RedoMarkupLine=1; return explode("\n",$x);');
Markup('directives','>split');
Markup('inline','>directives');
Markup('links','>inline');
Markup('block','>links');
Markup('style','>block');
Markup_e('closeall', '_begin',
  '/^\\(:closeall:\\)$/',
  "'<:block>' . MarkupClose()");

$ImgExtPattern="\\.(?:gif|jpg|jpeg|png|GIF|JPG|JPEG|PNG)";
$ImgTagFmt="<img src='\$LinkUrl' alt='\$LinkAlt' title='\$LinkAlt' />";

$BlockMarkups = array(
  'block' => array('','','',0),
  'ul' => array('<ul><li>','</li><li>','</li></ul>',1),
  'dl' => array('<dl>','</dd>','</dd></dl>',1),
  'ol' => array('<ol><li>','</li><li>','</li></ol>',1),
  'p' => array('<p>','','</p>',0),
  'indent' => 
     array("<div class='indent'>","</div><div class='indent'>",'</div>',1),
  'outdent' => 
     array("<div class='outdent'>","</div><div class='outdent'>",'</div>',1),

作者:BML    项目:memoryhole-ansibl   
This file is part of PmWiki; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.  See pmwiki.php for full details.

    This script provides special handling for WikiWords that are
    preceded by a $, treating them as PmWiki variables to be looked up
    in the variable documentation pages if such documentation exists.
    The $VarPagesFmt variable contains a list of pages to be searched
    to build an index of the variable documentation.  This index is 
    generated only once per browse request, and then only when needed.
*/
SDV($VarPagesFmt, array('$[PmWiki.Variables]'));
Markup_e('varlink', '<wikilink', "/\\\$({$WikiWordPattern})\\b/", "Keep(VarLink(\$pagename,\$m[1],'\$'.\$m[1]))");
Markup('vardef', '<links', "/^:\\\$({$WikiWordPattern}):/", ':[[#$1]]$$1:');
Markup_e('varindex', 'directives', '/\\(:varindex:\\)/i', "Keep(VarIndexList(\$pagename))");
$HTMLStylesFmt['vardoc'] = "a.varlink { text-decoration:none; }\n";
function VarLink($pagename, $tgt, $txt)
{
    global $VarIndex, $FmtV, $VarLinkMissingFmt, $VarLinkExistsFmt;
    SDV($VarLinkMissingFmt, '$LinkText');
    SDV($VarLinkExistsFmt, "<a class='varlink' href='\$LinkUrl'><code class='varlink'>\$LinkText</code></a>");
    VarIndexLoad($pagename);
    $FmtV['$LinkText'] = str_replace('$', '&#36;', $txt);
    $FmtV['$LinkUrl'] = @$VarIndex[$tgt]['url'];
    if (@(!$VarIndex[$tgt]['url'])) {
        return FmtPageName($VarLinkMissingFmt, $pagename);
    }
    return FmtPageName($VarLinkExistsFmt, $pagename);
}
function VarIndexLoad($pagename)

作者:Nepheri    项目:DropShado   
$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
$FmtPV['$WikiTag'] = '$GLOBALS["WikiTag"]';
# Move any (:noleft:) or SetTmplDisplay('PageLeftFmt', 0); directives to variables for access in jScript.
$FmtPV['$LeftColumn'] = "\$GLOBALS['TmplDisplay']['PageLeftFmt']";
Markup_e('noleft', 'directives', '/\\(:noleft:\\)/i', "SetTmplDisplay('PageLeftFmt',0)");
$FmtPV['$RightColumn'] = "\$GLOBALS['TmplDisplay']['PageRightFmt']";
Markup_e('noright', 'directives', '/\\(:noright:\\)/i', "SetTmplDisplay('PageRightFmt',0)");
$FmtPV['$ActionBar'] = "\$GLOBALS['TmplDisplay']['PageActionFmt']";
Markup_e('noaction', 'directives', '/\\(:noaction:\\)/i', "SetTmplDisplay('PageActionFmt',0)");
$FmtPV['$TabsBar'] = "\$GLOBALS['TmplDisplay']['PageTabsFmt']";
Markup_e('notabs', 'directives', '/\\(:notabs:\\)/i', "SetTmplDisplay('PageTabsFmt',0)");
$FmtPV['$SearchBar'] = "\$GLOBALS['TmplDisplay']['PageSearchFmt']";
Markup_e('nosearch', 'directives', '/\\(:nosearch:\\)/i', "SetTmplDisplay('PageSearchFmt',0)");
$FmtPV['$TitleGroup'] = "\$GLOBALS['TmplDisplay']['PageTitleGroupFmt']";
Markup_e('notitlegroup', 'directives', '/\\(:notitlegroup:\\)/i', "SetTmplDisplay('PageTitleGroupFmt',0)");
Markup_e('notitle', 'directives', '/\\(:notitle:\\)/i', "SetTmplDisplay('PageTitleFmt',0); SetTmplDisplay('PageTitleGroupFmt',0)");
Markup('fieldset', 'inline', '/\\(:fieldset:\\)/i', "<fieldset>");
Markup('fieldsetend', 'inline', '/\\(:fieldsetend:\\)/i', "</fieldset>");
# Override pmwiki styles otherwise they will override styles declared in css
global $HTMLStylesFmt;
$HTMLStylesFmt['pmwiki'] = '';
# Add a custom page storage location
global $WikiLibDirs;
$PageStorePath = dirname(__FILE__) . "/wikilib.d/{\$FullName}";
$where = count($WikiLibDirs);
if ($where > 1) {
    $where--;
}
array_splice($WikiLibDirs, $where, 0, array(new PageStore($PageStorePath)));
# ----------------------------------------
# - Standard Skin Functions

作者:BML    项目:memoryhole-ansibl   
}
/*  Copyright 2007-2014 Patrick R. Michaud (pmichaud@pobox.com)
    This file is part of PmWiki; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.  See pmwiki.php for full details.

    This script adds Creole v0.4 markup (http://www.wikicreole.org/)
    to PmWiki.  To activate this script, simply add the following into
    a local customization file:

        include_once('scripts/creole.php');

*/
## **strong**
Markup('**', 'inline', '/^\\*\\*(?>(.+?)\\*\\*)(?!\\S)|(?<!^)\\*\\*(.+?)\\*\\*/', '<strong>$1$2</strong>');
## //emphasized//
Markup('//', 'inline', '/(?<!http:|https:|ftp:)\\/\\/(.*?)\\/\\//', '<em>$1</em>');
## == Headings ==
Markup_e('^=', 'block', '/^(={1,6})\\s?(.*?)(\\s*=*\\s*)$/', "'<:block,1><h'.strlen(\$m[1]).'>'.\$m[2].'</h'.strlen(\$m[1]).'>'");
## Line breaks
Markup('\\\\', 'inline', '/\\\\\\\\/', '<br />');
## Preformatted
Markup_e('^{{{', '[=', "/^\\{\\{\\{\n(.*?\n)\\}\\}\\}[^\\S\n]*\n/sm", "Keep('<pre class=\"escaped\">'.\$m[1].'</pre>')");
Markup_e('{{{', '>{{{', '/\\{\\{\\{(.*?)\\}\\}\\}/s', "Keep('<code class=\"escaped\">'.\$m[1].'</code>')");
## Tables
Markup_e('|-table', '>^||', '/^\\|(.*)$/', "FormatTableRow(\$m[0], '\\|')");
## Images
Markup_e('{{', 'inline', '/\\{\\{(?>(\\L))([^|\\]]*)(?:\\|\\s*(.*?)\\s*)?\\}\\}/', "Keep(\$GLOBALS['LinkFunctions'][\$m[1]](\$pagename, \$m[1], \$m[2], \$m[3],\n     \$m[1].\$m[2], \$GLOBALS['ImgTagFmt']),'L')");
## GUIButtons
SDVA($GUIButtons, array('em' => array(100, "//", "//", '$[Emphasized]', '$GUIButtonDirUrlFmt/em.gif"$[Emphasized (italic)]"', '$[ak_em]'), 'strong' => array(110, "**", "**", '$[Strong]', '$GUIButtonDirUrlFmt/strong.gif"$[Strong (bold)]"', '$[ak_strong]'), 'h2' => array(400, '\\n== ', ' ==\\n', '$[Heading]', '$GUIButtonDirUrlFmt/h.gif"$[Heading]"')));

作者:BogusCurr    项目:pmwik   
"<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>");
}

Markup_e('markup', '<[=',
  "/\\(:markup(\\s+([^\n]*?))?:\\)[^\\S\n]*\\[([=@])(.*?)\\3\\]/si",
  "MarkupMarkup(\$pagename, \$m[4], \$m[2])");
Markup_e('markupend', '>markup',
  "/\\(:markup(\\s+([^\n]*?))?:\\)[^\\S\n]*\n(.*?)\\(:markupend:\\)/si",
  "MarkupMarkup(\$pagename, \$m[3], \$m[1])");

SDV($HTMLStylesFmt['markup'], "
  table.markup { border:2px dotted #ccf; width:90%; }
  td.markup1, td.markup2 { padding-left:10px; padding-right:10px; }
  table.vert td.markup1 { border-bottom:1px solid #ccf; }
  table.horiz td.markup1 { width:23em; border-right:1px solid #ccf; }
  table.markup caption { text-align:left; }
  div.faq p, div.faq pre { margin-left:2em; }
  div.faq p.question { margin:1em 0 0.75em 0; font-weight:bold; }
  div.faqtoc div.faq * { display:none; }
  div.faqtoc div.faq p.question 
    { display:block; font-weight:normal; margin:0.5em 0 0.5em 20px; line-height:normal; }
  div.faqtoc div.faq p.question * { display:inline; }
  ");

作者:jefmu    项目:pmwiki-bootstrap-ski   
(:bdropdown title=Groups <other params> :)

   where title is the setting for the dropdown group, and <other params> are standard pagelist parameters

   NOTE: proper display requires the containing list (ul or ol) to have the class "nav" applied
         this must be applied to the first item on the list, if it is not the dropdown
         AFAIK, this cannot be done programmatically from within this markup code

   NOTE: use of multiple link= targets requires the PageListMultiTargets recipe
         http://www.pmwiki.org/wiki/Cookbook/PageListMultiTargets
         currently this is included via config.php
         Should include it here w/in recipe

   Inspired by code from https://github.com/tamouse/pmwiki-bootstrap-skin/blob/dropdowns/bootstrap.php
*/
Markup_e("bdropdown", ">links", "/\\(:bdropdown\\s*(.*?)\\s*:\\)/", "BDropdownMenu(\$m[1])");
/* NOTE: the "B" prefix is temporary, as previous markup uses the same names (without "B" prefix)
         Once that code is removed, this should be updated to remove the "B"
*/
function BDropdownMenu($inp)
{
    $defaults = array('title' => 'Dropdown');
    $args = array_merge($defaults, ParseArgs($inp));
    // $inline_code_begin = "<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>".$args['title']."<b class='caret'></b></a><ul class='dropdown-menu'>";
    $inline_code_begin = "<li class='dropdown'><a href='#' class='dropdown-toggle' data-toggle='dropdown'>" . $args['title'];
    $inline_code_begin .= "<b class='caret'></b></a><ul class='dropdown-menu'>";
    // if we're using MakePageList, we have to pass ALL the opts along...
    // in this case, named $args
    $group_list = BGetWikiPages($args);
    $formatted_list = BBuildGroupList($group_list);
    $inline_code_end = "</ul></li>";

作者:rubyka    项目:pmwiki-cluste   
$FmtPV['$BreadCrumb'] = 'ClusterSlice($pn, "separator=\'' . $ClusterBreadCrumbSeparator . '\' return=links")';
$FmtPV['$BreadCrumbTitle'] = 'ClusterSlice($pn, "separator=\'' . $ClusterBreadCrumbSeparator . '\' return=links title=true space=true ")';
$FmtPV['$BreadCrumbNoTitle'] = 'ClusterSlice($pn, "separator=\'' . $ClusterBreadCrumbSeparator . '\' return=links title=false space=false ")';
# Grouptitle PVs
$FmtPV['$GroupTitle'] = 'ClusterSlice($pn, "start=-1 name=false return=names title=true space=false")';
$FmtPV['$GroupTitlespaced'] = 'ClusterSlice($pn, "start=-1 name=false return=names title=true space=true")';
# Subpage PVs
$FmtPV['$ClusterSideBar'] = 'ClusterPageName($group, "SideBar", $name)';
$FmtPV['$ClusterRightBar'] = 'ClusterPageName($group, "RightBar", $name)';
/* ================================================================
 * Markup and directives
 */
# Markup for link shortcuts
if (function_exists('Markup_e')) {
    # added by Petko Yotov
    Markup_e('[[cluster', '<links', '/\\[\\[(-|[\\*\\^]+)(.*?)\\]\\]/', "ClusterLinks(\$pagename, \$m[1], \$m[2])");
    Markup('clusterslice', 'directives', '/\\(:clusterslice\\s*(.*?):\\)/i', "ClusterSlice(\$pagename, \$m[1])");
} else {
    Markup('[[cluster', '<links', '/\\[\\[(-|[\\*\\^]+)(.*?)\\]\\]/e', "ClusterLinks(\$pagename, '\$1', PSS('\$2'))");
    Markup('clusterslice', 'directives', '/\\(:clusterslice\\s*(.*?):\\)/ei', "ClusterSlice(\$pagename, PSS('\$1'))");
}
/* ================================================================
 * Search Patterns
 * If using name-based clustering, hide the name-based special pages
 */
if ($ClusterEnableNameClustering) {
    $SearchPatterns['normal']['clustername1'] = '!\\' . $ClusterSeparator . 'Group(Print)?(Header|Footer|Attributes)$!';
    $SearchPatterns['normal']['clustername2'] = '!\\' . $ClusterSeparator . '(Side|Right|Menu)Bar$!';
}
/* ================================================================
 * Set up clustered configurations

作者:Nepheri    项目:BlogI   
$FmtPV['$bi_PagePrev'] = $bi_CurrentPage > 0 ? $bi_CurrentPage - 1 : 0;
$FmtPV['$bi_EntryStart'] = ($bi_CurrentPage - 1) * $bi_EntryCount + 1;
$FmtPV['$bi_EntryEnd'] = $FmtPV['$bi_EntryStart'] + $bi_EntryCount - 1;
// ----------------------------------------
// - Markup
function bi_blogitMU_Handler($m)
{
    $func = 'blogitMU_' . $m[1];
    return $func($m[2], $m[3]);
}
if (function_exists('Markup_e')) {
    //PmWiki 2.2.58+ / PHP5
    Markup_e('blogit', 'fulltext', '/\\(:blogit (list|cleantext)\\s?(.*?):\\)(.*?)\\(:blogitend:\\)/si', "bi_blogitMU_Handler(\$m)");
    //need to use an interim handler
    Markup_e('blogit-skin', 'fulltext', '/\\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\\s?(.*?):\\)(.*?)\\(:blogit-skinend:\\)/si', "blogitSkinMU(\$m[1], \$m[2], \$m[3])");
    Markup_e('includesection', '>if', '/\\(:includesection\\s+(\\S.*?):\\)/i', "PRR(bi_includeSection(\$GLOBALS['bi_Pagename'], \$m[1].' '.\$GLOBALS['bi_TemplateList']))");
} else {
    //PmWiki 2.2.58-, pre PHP5
    Markup('blogit', 'fulltext', '/\\(:blogit (list|cleantext)\\s?(.*?):\\)(.*?)\\(:blogitend:\\)/esi', "blogitMU_\$1(PSS('\$2'), PSS('\$3'))");
    Markup('blogit-skin', 'fulltext', '/\\(:blogit-skin ' . '(date|intro|author|tags|edit|newentry|delete|commentcount|date|commentauthor|commentapprove|commentdelete|commentedit|commentreply|commentblock|commenttext|commentid)' . '\\s?(.*?):\\)(.*?)\\(:blogit-skinend:\\)/esi', "blogitSkinMU('\$1', PSS('\$2'), PSS('\$3'))");
    Markup('includesection', '>if', '/\\(:includesection\\s+(\\S.*?):\\)/ei', "PRR(bi_includeSection(\$GLOBALS['bi_Pagename'], PSS('\$1 '.\$GLOBALS['bi_TemplateList'])))");
}
$SaveAttrPatterns['/\\(:includesection\\s.*?:\\)/i'] = ' ';
//prevents include sections becoming part of page targets list
if (IsEnabled($EnableGUIButtons) && $FmtPV['$bi_Mode'] != 'ajax') {
    if ($action == 'bi_be' || $action == 'bi_ne' || $action == 'pmform' && $_REQUEST['target'] == 'blogit-entry') {
        include_once $bi_Paths['guiedit'];
    }
    //PmWiki only includes this automatically if action=edit.
} else {
    Markup('e_guibuttons', 'directives', '/\\(:e_guibuttons:\\)/', '');

作者:anomen-    项目:pmwiki-recipe   
displays the pmwiki feed in long layout and  the top 5 lines 
    (:RSS http://www.pmichaud.com/wiki/Pm/AllRecentChanges?action=rss long 5 :)
    displays the pmwiki feed in short layout and  all lines in the feed
    (:RSS http://www.pmichaud.com/wiki/Pm/AllRecentChanges?action=rss short -1 :)
    Copyright 2006-2011 Anomen (ludek_h@seznam.cz)
    Copyright 2005 http://www.brambring.nl
    Copyright 2005 http://mypage.iu.edu/~mweiner/index.html
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/
$RecipeInfo['RSSDisplay']['Version'] = '2016-01-14';
if (function_exists('Markup_e')) {
    Markup_e('rssdisplay', 'fulltext', '/\\(:RSS\\s*(.*?)\\s*:\\)/', "MagpieRSS(\$m[1])");
} else {
    Markup('rssdisplay', 'fulltext', '/\\(:RSS\\s*(.*?)\\s*:\\)/e', "MagpieRSS('\$1')");
}
SDV($MagpieDir, "{$FarmD}/cookbook/magpie");
SDV($MagpieDebug, false);
SDV($MagpieEnableCache, false);
SDV($MagpieCacheAge, 2 * 60 * 60);
SDV($MagpieCacheDir, "{$FarmD}/cache");
SDV($MagpieFetchTimeout, 15);
SDV($MagpieGzip, true);
SDV($MagpieProxy, '');
SDV($MagpieDefaultItems, 30);
SDV($MagpieDefaultShowHeader, true);
SDV($MagpieDefaultShowDate, false);
SDV($MagpieDefaultShowContent, true);

作者:Nepheri    项目:PhotoGaller   
if (!defined('PmWiki')) {
    exit;
}
/* PmWiki PhotoGallery skin
 *
 * Examples at: http://pmwiki.com/Cookbook/PhotoGallery and http://solidgone.com/Skins/
 * License: Copyright (c)2016 David Gilbert. This work is licensed under a [[http://creativecommons.org/licenses/by-sa/4.0/ | Creative Commons Attribution-Share Alike 4.0 International]] License. Please retain the links in the footer.
 */
global $FmtPV;
$FmtPV['$SkinName'] = '"PhotoGallery"';
$FmtPV['$SkinVersion'] = '"0.4.1"';
$FmtPV['$SkinDate'] = '"20160225"';
## Move any (:noleft:) or SetTmplDisplay('PageLeftFmt', 0); directives to variables for access in jScript.
$FmtPV['$TabsBar'] = "\$GLOBALS['TmplDisplay']['PageTabsFmt']";
Markup_e('notabs', 'directives', '/\\(:notabs:\\)/i', "SetTmplDisplay('PageTabsFmt',0)");
Markup_e('album', 'inline', "/\\(:album\\s*(.*?):\\)/s", "Keep(album(\$m[1]))");
# ----------------------------------------
# - Standard Skin Setup
# ----------------------------------------
$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
# Define a link stye for new page links
global $LinkPageCreateFmt;
SDV($LinkPageCreateFmt, "<a class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText</a>");
# Default color scheme
global $SkinColor, $ValidSkinColors;
if (!is_array($ValidSkinColors)) {
    $ValidSkinColors = array();
}
array_push($ValidSkinColors, 'red', 'blue', 'orange', 'yellow', 'green', 'lightblue');
if (isset($_GET['color']) && in_array($_GET['color'], $ValidSkinColors)) {
    $SkinColor = $_GET['color'];

作者:anomen-    项目:pmwiki-recipe   
/*
    This script adds support for gps coordinates conversion and displaying at maps
    - add (:geo [args] coords :) tag functionality

    Copyright 2006-2016 Anomen (ludek_h@seznam.cz)
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    
    TODO:
    * GPX export (see sourceblock for howto)
*/
$RecipeInfo['Geobox']['Version'] = '2016-10-12';
if (function_exists('Markup_e')) {
    Markup_e('geo', 'fulltext', '/\\(:geo\\s+((?:[dmsDMS,.]+:\\s+)?(?:[a-z]+=\\S+\\s+)*)?(.*?)\\s*:\\)/', "geobox_maps(strtolower(\$m[1]),\$m[2])");
} else {
    Markup('geo', 'fulltext', '/\\(:geo\\s+((?:[dmsDMS,.]+:\\s+)?(?:[a-z]+=\\S+\\s+)*)?(.*?)\\s*:\\)/e', "geobox_maps(strtolower('\$1'),'\$2')");
}
SDV($GeoBoxDefaultFormat, 'dm');
SDVA($GeoBoxLinks, array('maps.google.com' => 'http://maps.google.com/?q=$N%20$E', 'mapy.cz' => 'https://www.mapy.cz/?st=search&fr=$N+$E', 'geocaching.com/maps' => 'http://www.geocaching.com/map/default.aspx?lat=$N&amp;lng=$E', 'geocaching.com/near' => 'http://www.geocaching.com/seek/nearest.aspx?lat=$N&amp;lng=$E&amp;f=1'));
function geobox_asint($m, $index)
{
    $res = 0;
    if (isset($m[$index])) {
        $res = strtr($m[$index], ',', '.');
    }
    return $res;
}
function geobox_p()
{

作者:BogusCurr    项目:pmwik   
## The section below handles specialized EditForm pages.
## We don't bother to load it if we're not editing.

if ($action != 'edit') return;

SDV($PageEditForm, '$SiteGroup.EditForm');
SDV($PageEditFmt, '$EditForm');
if (@$_REQUEST['editform']) {
  $PageEditForm=$_REQUEST['editform'];
  $PageEditFmt='$EditForm';
}
$Conditions['e_preview'] = '(boolean)$_REQUEST["preview"]';

# (:e_preview:) displays the preview of formatted text.
Markup_e('e_preview', 'directives',
  '/^\\(:e_preview:\\)/',
  "isset(\$GLOBALS['FmtV']['\$PreviewText']) ? Keep(\$GLOBALS['FmtV']['\$PreviewText']): ''");

# If we didn't load guiedit.php, then set (:e_guibuttons:) to
# simply be empty.
Markup('e_guibuttons', 'directives', '/\\(:e_guibuttons:\\)/', '');

# Prevent (:e_preview:) and (:e_guibuttons:) from 
# participating in text rendering step.
SDV($SaveAttrPatterns['/\\(:e_(preview|guibuttons):\\)/'], ' ');

SDVA($InputTags['e_form'], array(
  ':html' => "<form action='{\$PageUrl}?action=edit' method='post'
    \$InputFormArgs><input type='hidden' name='action' value='edit' 
    /><input type='hidden' name='n' value='{\$FullName}' 
    /><input type='hidden' name='basetime' value='\$EditBaseTime'

作者:Ekleo    项目:plata   
* inserted own function call in array $EditFunctions before 'ReplaceOnSave'

  May 11, 2004 - Working Beta.  Still a few improvements to be made, but
                 the script is ready for public testing.  Please feel
         free to email me your comments/suggestions.  Thanks!
  May 8, 2004  - Alpha release.  Not released to public.

  * Configuration *
  There aren't (yet) any configuration variables for this script.    */
//----------------------------------------------------------------------
## [[hidden-email:target]]
Markup_e('hidden-email', '<links', "/\\[\\[hidden-email:([^\\s{$UrlExcludeChars}]*)\\s*\\]\\]({$SuffixPattern})/", "eProtectDecode(\$m[1],'')");
## [[hidden-email:target | text]]
Markup_e('hidden-email|', '<hidden-email', "/\\[\\[hidden-email:([^\\s{$UrlExcludeChars}]*)\\s*\\|\\s*(.*?)\\s*\\]\\]({$SuffixPattern})/", "eProtectDecode(\$m[1],\$m[2])");
## [[ text -> hidden-email:target]]
Markup_e('-hidden-email', '<hidden-email', "/\\[\\[(.*?)\\s*-+&gt;\\s*hidden-email:([^\\s{$UrlExcludeChars}]*)\\s*\\]\\]({$SuffixPattern})/", "eProtectDecode(\$m[2],\$m[1])");
## Add own function in array $EditFunctions before ReplaceOnSave, so it is called, when saving is performed.
array_splice($EditFunctions, array_search('ReplaceOnSave', $EditFunctions), 1, array('eProtectEncode', 'ReplaceOnSave'));
## Add decoding script to Header
$HTMLHeaderFmt['eProtect'] = "\n<script type='text/JavaScript'>\n<!--\nNix={map:null,convert:function(a){Nix.init();var s='';for(i=0;i<a.length;i++){var b=a.charAt(i);s+=((b>='A'&&b<='Z')||(b>='a'&&b<='z')?Nix.map[b]:b);}return s;},init:function(){if(Nix.map!=null)return;var map=new Array();var s='abcdefghijklmnopqrstuvwxyz';for(i=0;i<s.length;i++)map[s.charAt(i)]=s.charAt((i+13)%26);for(i=0;i<s.length;i++)map[s.charAt(i).toUpperCase()]=s.charAt((i+13)%26).toUpperCase();Nix.map=map;},decode:function(a){document.write(Nix.convert(a));}}\n//-->\n</script>\n";
//----------------------------------------------------------------------
function eProtectStrRecode($s)
{
    /* str_rot13, extended to recode digits and @#. */
    //----------------------------------------------------------------------
    return strtr($s, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM');
}
//----------------------------------------------------------------------
function eProtectDecode($CompressedEmailAddress, $AlternateText)
{
    //----------------------------------------------------------------------

作者:BogusCurr    项目:pmwik   
'$GUIButtonDirUrlFmt/extlink.gif"$[Link to external page]"'),
  'big'      => array(300, "'+", "+'", '$[Big text]',
                  '$GUIButtonDirUrlFmt/big.gif"$[Big text]"'),
  'small'    => array(310, "'-", "-'", '$[Small text]',
                  '$GUIButtonDirUrlFmt/small.gif"$[Small text]"'),
  'sup'      => array(320, "'^", "^'", '$[Superscript]',
                  '$GUIButtonDirUrlFmt/sup.gif"$[Superscript]"'),
  'sub'      => array(330, "'_", "_'", '$[Subscript]',
                  '$GUIButtonDirUrlFmt/sub.gif"$[Subscript]"'),
  'h2'       => array(400, '\\n!! ', '\\n', '$[Heading]',
                  '$GUIButtonDirUrlFmt/h.gif"$[Heading]"'),
  'center'   => array(410, '%center%', '', '',
                  '$GUIButtonDirUrlFmt/center.gif"$[Center]"')));

Markup_e('e_guibuttons', 'directives',
  '/\\(:e_guibuttons:\\)/',
  "Keep(FmtPageName(GUIButtonCode(\$pagename), \$pagename))");

function GUIButtonCode($pagename) {
  global $GUIButtons;
  $cmpfn = create_function('$a,$b', 'return $a[0]-$b[0];');
  usort($GUIButtons, $cmpfn);
  $out = "<script type='text/javascript'><!--\n";
  foreach ($GUIButtons as $k => $g) {
    if (!$g) continue;
    @list($when, $mopen, $mclose, $mtext, $tag, $mkey) = $g;
    if ($tag{0} == '<') { 
        $out .= "document.write(\"$tag\");\n";
        continue; 
    }
    if (preg_match('/^(.*\\.(gif|jpg|png))("([^"]+)")?$/', $tag, $m)) {

作者:anomen-    项目:pmwiki-recipe   
exit;
}
/*
    CachedNumberOfArticles script adds support for printing number of pages in wiki
    - add (:numberofarticles:) tag functionality
    - this version uses WikiDir->ls() to obtin number of articles

    Copyright 2006-2011 Anomen (ludek_h@seznam.cz)
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/
$RecipeInfo['CachedNumberOfArticles']['Version'] = '2016-01-13';
if (function_exists('Markup_e')) {
    Markup_e('numberofarticles', 'inline', '/\\(:numberofarticles(\\s+refresh)?\\s*:\\)/', "Keep(getNumArticles(\$m[1]))");
} else {
    Markup('numberofarticles', 'inline', '/\\(:numberofarticles(\\s+refresh)?\\s*:\\)/e', "Keep(getNumArticles('\$1'))");
}
$NOAFile = "{$WorkDir}/.noa";
function refreshNumArticles()
{
    global $NOAFile;
    global $WikiDir;
    $count = count($WikiDir->ls());
    $f = fopen($NOAFile, 'w');
    fwrite($f, $count);
    fclose($f);
    return "<!--fresh-->{$count}\n";
}
function getNumArticles($refresh)

作者:BogusCurr    项目:pmwik   
'ULbadtype' => '\'$upext\' is not an allowed file extension',
  'ULtoobig' => 'file is larger than maximum allowed by webserver',
  'ULtoobigext' => 'file is larger than allowed maximum of $upmax
     bytes for \'$upext\' files',
  'ULpartial' => 'incomplete file received',
  'ULnofile' => 'no file uploaded',
  'ULexists' => 'file with that name already exists',
  'ULpquota' => 'group quota exceeded',
  'ULtquota' => 'upload quota exceeded'));
SDV($PageAttributes['passwdupload'],'$[Set new upload password:]');
SDV($DefaultPasswords['upload'],'*');
SDV($AuthCascade['upload'], 'read');
SDV($FmtPV['$PasswdUpload'], 'PasswdVar($pn, "upload")');

Markup_e('attachlist', 'directives',
  '/\\(:attachlist\\s*(.*?):\\)/i',
  "Keep('<ul>'.FmtUploadList('$pagename',\$m[1]).'</ul>')");
SDV($GUIButtons['attach'], array(220, 'Attach:', '', '$[file.ext]',
  '$GUIButtonDirUrlFmt/attach.gif"$[Attach file]"'));
SDV($LinkFunctions['Attach:'], 'LinkUpload');
SDV($IMap['Attach:'], '$1');
SDVA($HandleActions, array('upload' => 'HandleUpload',
  'postupload' => 'HandlePostUpload',
  'download' => 'HandleDownload'));
SDVA($HandleAuth, array('upload' => 'upload',
  'download' => 'read'));
SDV($HandleAuth['postupload'], $HandleAuth['upload']);
SDV($UploadVerifyFunction, 'UploadVerifyBasic');

function MakeUploadName($pagename,$x) {
  global $UploadNameChars, $MakeUploadNamePatterns;

作者:BogusCurr    项目:pmwik   
$attr .= " valign='top'";
            }
            if (!@$MarkupFrame[0]['closeall']['table']) {
                $MarkupFrame[0]['closeall']['table'] = "</td></tr></table>";
                $out .= "<table {$tattr}><tr><td {$attr}>";
            } else {
                if ($name == 'cellnr') {
                    $out .= "</td></tr><tr><td {$attr}>";
                } else {
                    $out .= "</td><td {$attr}>";
                }
            }
        }
        return $out;
    }
    Markup_e('table', '<block', '/^\\(:(table|cell|cellnr|tableend|div|divend)(\\s.*?)?:\\)/i', "TCells(\$m[1],\$m[2])");
}
## Transitions from 2.1.7
if (@$Transition['version'] < 2001007) {
    SDVA($Transition, array('vspace' => 1));
}
## vspace:
##   This restores PmWiki's use of <p class='vspace'></p> to mark
##   vertical space in the output.
if (@$Transition['vspace']) {
    $HTMLVSpace = "<p class='vspace'></p>";
}
## Transitions from 2.1.beta15
if (@$Transition['version'] < 2000915) {
    SDVA($Transition, array('fplbygroup' => 1));
}


问题


面经


文章

微信
公众号

扫码关注公众号