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


PHP PrintFmt函数代码示例

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


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

示例1: HandleRecipeCheck

function HandleRecipeCheck($pagename, $auth = 'admin')
{
    global $RecipeListUrl, $Version, $RecipeInfo, $RecipeCheckFmt, $PageStartFmt, $PageEndFmt;
    $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
    if (!$page) {
        Abort('?admin access required');
    }
    $cvinfo = GetRecipeList($RecipeListUrl);
    if (!$cvinfo) {
        $msg = "Unable to retrieve cookbook data from {$RecipeListUrl}\n";
        $allow_url_fopen = ini_get('allow_url_fopen');
        if (!$allow_url_fopen) {
            $msg .= "\n      <br /><br />It appears that your PHP environment isn't allowing\n      the recipelist to be downloaded from pmwiki.org  \n      (allow_url_fopen&nbsp;=&nbsp;{$allow_url_fopen}).";
        }
        Abort($msg);
    }
    $rinfo['PmWiki:Upgrades'] = $Version;
    ScanRecipeInfo('cookbook', $cvinfo);
    foreach ((array) $RecipeInfo as $r => $v) {
        if (!@$v['Version']) {
            continue;
        }
        $r = preg_replace('/^(?!PmWiki:)(Cookbook[.:])?/', 'Cookbook:', $r);
        $rinfo[$r] = $v['Version'];
    }
    $markup = "!!Recipe status for {\$PageUrl}\n" . RecipeTable($rinfo, $cvinfo);
    $html = MarkupToHTML($pagename, $markup);
    SDV($RecipeCheckFmt, array(&$PageStartFmt, $html, &$PageEndFmt));
    PrintFmt($pagename, $RecipeCheckFmt);
}
开发者ID:prometheus-ev,项目名称:promwiki,代码行数:30,代码来源:recipecheck.php

示例2: HandleRename

function HandleRename($pagename)
{
    global $HandleRenameFmt, $PageStartFmt, $PageRenameFmt, $PageEndFmt;
    SDV($HandleRenameFmt, array(&$PageStartFmt, &$PageRenameFmt, &$PageEndFmt));
    $PageRenameFmt = str_replace('$UnqualifiedLinks', FmtLinksList($pagename, array('o' => 'fmt=pglist', 'list' => 'unqualified')), str_replace('$RenameGroup', FmtGroupList($pagename, array('o' => 'fmt=pickgroup')), $PageRenameFmt));
    PrintFmt($pagename, $HandleRenameFmt);
}
开发者ID:jefmud,项目名称:pmwiki-kit-bootstrap-compass,代码行数:7,代码来源:rename.php

示例3: HandleCrypt

function HandleCrypt($pagename, $auth='read') {
  global $ScriptUrl,$HTMLStartFmt,$HTMLEndFmt;
  PrintFmt($pagename,$HTMLStartFmt);
  $passwd = stripmagic(@$_POST["passwd"]);
  echo FmtPageName(
    "<form action='{\$ScriptUrl}' method='POST'><p>
      Enter password to encrypt: 
      <input type='text' name='passwd' value='"
      . PHSC($passwd, ENT_QUOTES) ."' />
      <input type='submit' />
      <input type='hidden' name='n' value='{\$FullName}' />
      <input type='hidden' name='action' value='crypt' /></p></form>",
    $pagename);
  if ($passwd) { 
    $crypt = pmcrypt($passwd);
    echo "<p class='vspace'>Encrypted password = $crypt</p>"; 
    echo "<p class='vspace'>To set a site-wide password, insert the line below
      in your <i>config.php</i> file, <br />replacing <tt>'type'</tt> with
      one of <tt>'admin'</tt>, <tt>'read'</tt>, <tt>'edit'</tt>,
      or <tt>'attr'</tt>.  <br />See <a 
      href='$ScriptUrl?n=PmWiki.PasswordsAdmin'>PasswordsAdmin</a> for more
      details.</p>
      <pre class='vspace'>  \$DefaultPasswords['type']='$crypt';</pre>";
  }
  PrintFmt($pagename,$HTMLEndFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:26,代码来源:crypt.php

示例4: HTTPBasicAuth

function HTTPBasicAuth($pagename, $level, $authprompt = true)
{
    global $AuthRealmFmt, $AuthDeniedFmt, $DefaultPasswords, $AllowPassword, $GroupAttributesFmt;
    SDV($GroupAttributesFmt, '$Group/GroupAttributes');
    SDV($AllowPassword, 'nopass');
    SDV($AuthRealmFmt, $GLOBALS['WikiTitle']);
    SDV($AuthDeniedFmt, 'A valid password is required to access this feature.');
    $page = ReadPage($pagename);
    if (!$page) {
        return false;
    }
    $passwd = @$page["passwd{$level}"];
    if ($passwd == "") {
        $grouppg = ReadPage(FmtPageName($GroupAttributesFmt, $pagename));
        $passwd = @$grouppg["passwd{$level}"];
        if ($passwd == '') {
            $passwd = @$DefaultPasswords[$level];
        }
        if ($passwd == '') {
            $passwd = @$page["passwdread"];
        }
        if ($passwd == '') {
            $passwd = @$grouppg["passwdread"];
        }
        if ($passwd == '') {
            $passwd = @$DefaultPasswords['read'];
        }
    }
    if ($passwd == '') {
        return $page;
    }
    if (crypt($AllowPassword, $passwd) == $passwd) {
        return $page;
    }
    @session_start();
    if (@$_SERVER['PHP_AUTH_PW']) {
        @$_SESSION['authpw'][$_SERVER['PHP_AUTH_PW']]++;
    }
    $authpw = array_keys((array) @$_SESSION['authpw']);
    foreach (array_merge((array) $DefaultPasswords['admin'], (array) $passwd) as $pwchal) {
        foreach ($authpw as $pwresp) {
            if (@crypt($pwresp, $pwchal) == $pwchal) {
                return $page;
            }
        }
    }
    if (!$authprompt) {
        return false;
    }
    $realm = FmtPageName($AuthRealmFmt, $pagename);
    header("WWW-Authenticate: Basic realm=\"{$realm}\"");
    header("Status: 401 Unauthorized");
    header("HTTP-Status: 401 Unauthorized");
    PrintFmt($pagename, $AuthDeniedFmt);
    exit;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:56,代码来源:httpauth.php

示例5: HTTPBasicAuthPrompt

function HTTPBasicAuthPrompt($pagename)
{
    global $AuthRealmFmt, $AuthDeniedFmt;
    SDV($AuthRealmFmt, $GLOBALS['WikiTitle']);
    SDV($AuthDeniedFmt, 'A valid password is required to access this feature.');
    $realm = FmtPageName($AuthRealmFmt, $pagename);
    header("WWW-Authenticate: Basic realm=\"{$realm}\"");
    header("Status: 401 Unauthorized");
    header("HTTP-Status: 401 Unauthorized");
    PrintFmt($pagename, $AuthDeniedFmt);
    exit;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:12,代码来源:httpauth.php

示例6: HandleCrypt

function HandleCrypt($pagename)
{
    global $ScriptUrl, $HTMLStartFmt, $HTMLEndFmt;
    PrintFmt($pagename, $HTMLStartFmt);
    $passwd = @$_POST["passwd"];
    echo "<form action='{$ScriptUrl}' method='POST'><p>\n    Enter password to encrypt: <input type='text' name='passwd' value='{$passwd}' />\n    <input type='submit' />\n    <input type='hidden' name='action' value='crypt' /></p></form>";
    if ($passwd) {
        $crypt = crypt($passwd);
        echo "<p class='vspace'>Encrypted password = {$crypt}</p>";
        echo "<p class='vspace'>To set a site-wide password, insert the line below\n      in your <i>config.php</i> file, <br />replacing <tt>'type'</tt> with\n      one of <tt>'admin'</tt>, <tt>'read'</tt>, <tt>'edit'</tt>,\n      or <tt>'attr'</tt>.  <br />See <a \n      href='{$ScriptUrl}?pagename=PmWiki.PasswordsAdmin'>PasswordsAdmin</a> for more\n      details.</p>\n      <pre class='vspace'>  \$DefaultPasswords['type']='{$crypt}';</pre>";
    }
    PrintFmt($pagename, $HTMLEndFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:13,代码来源:crypt.php

示例7: HandleUpload

function HandleUpload($pagename)
{
    global $FmtV, $UploadExtMax, $HandleUploadFmt, $PageStartFmt, $PageEndFmt, $PageUploadFmt;
    $page = RetrieveAuthPage($pagename, 'upload');
    if (!$page) {
        Abort("?cannot upload to {$pagename}");
    }
    SetPage($pagename, $page);
    $FmtV['$UploadName'] = MakeUploadName($pagename, @$_REQUEST['upname']);
    $upresult = @$_REQUEST['upresult'];
    $FmtV['$upext'] = @$_REQUEST['upext'];
    $FmtV['$upmax'] = @$_REQUEST['upmax'];
    $FmtV['$UploadResult'] = $upresult ? FmtPageName("<i>\$UploadName</i>: \$[UL{$upresult}]", $pagename) : '';
    SDV($HandleUploadFmt, array(&$PageStartFmt, &$PageUploadFmt, &$PageEndFmt));
    PrintFmt($pagename, $HandleUploadFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:16,代码来源:upload.php

示例8: HandleThumbShoeRename

function HandleThumbShoeRename($pagename, $auth = 'edit')
{
    global $WikiLibDirs, $LastModFile;
    global $ThumbShoeImgExt;
    global $TSHandleRenameFmt, $PageStartFmt, $ThumbShoeRenameFmt, $PageEndFmt;
    $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
    if (!$page) {
        Abort("?cannot rename {$pagename}; not authorized");
        return;
    }
    $imgRx = '(' . implode('|', $ThumbShoeImgExt) . ')';
    if (!preg_match("/(.*)_{$imgRx}\$/i", $pagename, $m1)) {
        if (function_exists('HandleRename')) {
            // use the normal Rename
            return HandleRename($pagename);
        } else {
            Abort("Cannot rename {$pagename}; is not an Image page");
            return;
        }
    }
    $tsdir = '';
    foreach ((array) $WikiLibDirs as $dir) {
        if ($dir->exists($pagename) and $dir->iswrite) {
            $tsdir = $dir;
            break;
        }
    }
    if (!$tsdir) {
        Abort("Cannot rename {$pagename}; cannot find page");
        return;
    }
    // Okay, should be able to rename this page now.
    $img_name = PageVar($pagename, '$TSPageImage');
    SDV($TSHandleRenameFmt, array(&$PageStartFmt, &$ThumbShoeRenameFmt, &$PageEndFmt));
    $ThumbShoeRenameFmt = str_replace('$FullName', $pagename, $ThumbShoeRenameFmt);
    $ThumbShoeRenameFmt = str_replace('$ImgName', $img_name, $ThumbShoeRenameFmt);
    $ThumbShoeRenameFmt = str_replace('$RenamePage', TSFmtPageList($pagename, $tsdir->galleryGroup, array('o' => 'fmt=pickpage')), $ThumbShoeRenameFmt);
    PrintFmt($pagename, $TSHandleRenameFmt);
}
开发者ID:rubykat,项目名称:pmwiki-thumbshoe,代码行数:39,代码来源:rename.php

示例9: HandleRefCount

function HandleRefCount($pagename)
{
    global $HandleRefCountFmt, $PageStartFmt, $PageEndFmt;
    SDV($HandleRefCountFmt, array(&$PageStartFmt, 'function:PrintRefCount', &$PageEndFmt));
    PrintFmt($pagename, $HandleRefCountFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:6,代码来源:refcount.php

示例10: HandleSearchA

function HandleSearchA($pagename, $level = 'read') {
  global $PageSearchForm, $FmtV, $HandleSearchFmt, 
    $PageStartFmt, $PageEndFmt;
  SDV($HandleSearchFmt,array(&$PageStartFmt, '$PageText', &$PageEndFmt));
  SDV($PageSearchForm, '$[{$SiteGroup}/Search]');
  $form = RetrieveAuthPage($pagename, $level, true, READPAGE_CURRENT);
  if (!$form) Abort("?unable to read $pagename");
  PCache($pagename, $form);
  $text = preg_replace('/\\[([=@])(.*?)\\1\\]/s', ' ', @$form['text']);
  if (!preg_match('/\\(:searchresults(\\s.*?)?:\\)/', $text))
    foreach((array)$PageSearchForm as $formfmt) {
      $form = ReadPage(FmtPageName($formfmt, $pagename), READPAGE_CURRENT);
      if ($form['text']) break;
    }
  $text = @$form['text'];
  if (!$text) $text = '(:searchresults:)';
  $FmtV['$PageText'] = MarkupToHTML($pagename,$text);
  PrintFmt($pagename, $HandleSearchFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:19,代码来源:pagelist.php

示例11: HandleFastCacheBrowse

function HandleFastCacheBrowse($pagename, $auth = 'read')
{
    # handle display of a page
    global $DefaultPageTextFmt, $PageNotFoundHeaderFmt, $HTTPHeaders, $EnableHTMLCache, $NoHTMLCache, $PageCacheFile, $LastModTime, $IsHTMLCached, $FmtV, $HandleBrowseFmt, $PageStartFmt, $PageEndFmt, $PageRedirectFmt;
    ## begin added
    global $FastCachePage, $FastCacheDir, $FastCacheValid, $FastCacheSuffix;
    if (!$FastCacheValid || !$FastCacheDir) {
        HandleBrowse($pagename, $auth);
        return;
    }
    SDV($FastCacheSuffix, '.html');
    $fcfile = "{$FastCacheDir}/{$pagename}{$FastCacheSuffix}";
    if (@filemtime($fcfile) > $LastModTime) {
        if ($FastCachePage = file_get_contents($fcfile)) {
            StopWatch("HandleFastCacheBrowse: using FastCached copy of {$pagename}");
            echo $FastCachePage;
        } else {
            $FastCacheValid = FALSE;
            StopWatch("HandleFastCacheBrowse: read error on {$fcfile}");
            HandleBrowse($pagename, $auth);
        }
        return;
    }
    ## end added
    $page = RetrieveAuthPage($pagename, $auth, true, READPAGE_CURRENT);
    if (!$page) {
        Abort("?cannot read {$pagename}");
    }
    PCache($pagename, $page);
    if (PageExists($pagename)) {
        $text = @$page['text'];
    } else {
        $FastCacheValid = FALSE;
        ## added
        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'\n    href='{\$PageUrl}?action=edit'>{\$FullName}</a>)</i></p>\$HTMLVSpace\n");
    if (@(!$_GET['from'])) {
        $opt['redirect'] = 1;
        $PageRedirectFmt = '';
    } else {
        $PageRedirectFmt = FmtPageName($PageRedirectFmt, $_GET['from']);
    }
    if (@$EnableHTMLCache && !$NoHTMLCache && $PageCacheFile && @filemtime($PageCacheFile) > $LastModTime) {
        list($ctext) = unserialize(file_get_contents($PageCacheFile));
        $FmtV['$PageText'] = "<!--cached-->{$ctext}";
        $IsHTMLCached = 1;
        StopWatch("HandleFastCacheBrowse: using HTMLCached copy");
        ## modified
    } 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("HandleFastCacheBrowse: HTMLCaching page");
                ## modified
                fwrite($fp, serialize(array($FmtV['$PageText'])));
                fclose($fp);
                rename("{$PageCacheFile},new", $PageCacheFile);
            }
        }
    }
    SDV($HandleBrowseFmt, array(&$PageStartFmt, &$PageRedirectFmt, '$PageText', &$PageEndFmt));
    ## begin modified
    if ($FastCacheValid) {
        ob_start();
        PrintFmt($pagename, $HandleBrowseFmt);
        $FastCachePage = ob_get_contents();
        ob_end_flush();
        mkdirp(dirname($fcfile));
        if ($FastCacheValid && ($fc = fopen("{$fcfile},new", 'x'))) {
            StopWatch("HandleFastCacheBrowse: FastCaching {$pagename}");
            fwrite($fc, $FastCachePage);
            fclose($fc);
            rename("{$fcfile},new", $fcfile);
        } else {
            StopWatch("HandleFastCacheBrowse: error writing cache to {$fcfile},new");
        }
    } else {
        PrintFmt($pagename, $HandleBrowseFmt);
    }
    ## end modified
}
开发者ID:jefmud,项目名称:pmwiki-kit-bootstrap-compass,代码行数:90,代码来源:fastcache.php

示例12: HandleUpload

function HandleUpload($pagename, $auth = 'upload') {
  global $FmtV,$UploadExtMax,
    $HandleUploadFmt,$PageStartFmt,$PageEndFmt,$PageUploadFmt;
  UploadAuth($pagename, $auth, 1);
  $FmtV['$UploadName'] = MakeUploadName($pagename,@$_REQUEST['upname']);
  $upresult = htmlspecialchars(@$_REQUEST['upresult']);
  $uprname = htmlspecialchars(@$_REQUEST['uprname']);
  $FmtV['$upext'] = htmlspecialchars(@$_REQUEST['upext']);
  $FmtV['$upmax'] = htmlspecialchars(@$_REQUEST['upmax']);
  $FmtV['$UploadResult'] = ($upresult) ?
    FmtPageName("<i>$uprname</i>: $[UL$upresult]",$pagename) : '';
  SDV($HandleUploadFmt,array(&$PageStartFmt,&$PageUploadFmt,&$PageEndFmt));
  PrintFmt($pagename,$HandleUploadFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:14,代码来源:upload.php

示例13: HandleUpload

function HandleUpload($pagename, $auth = 'upload') {
  global $FmtV,$UploadExtMax, $EnableReadOnly,
    $HandleUploadFmt,$PageStartFmt,$PageEndFmt,$PageUploadFmt;
  UploadAuth($pagename, $auth, 1);
  $FmtV['$UploadName'] = MakeUploadName($pagename,@$_REQUEST['upname']);
  $upresult = PHSC(@$_REQUEST['upresult']);
  $uprname = PHSC(@$_REQUEST['uprname']);
  $FmtV['$upext'] = PHSC(@$_REQUEST['upext']);
  $FmtV['$upmax'] = PHSC(@$_REQUEST['upmax']);
  $FmtV['$UploadResult'] = ($upresult) ?
    FmtPageName("<i>$uprname</i>: $[UL$upresult]",$pagename) : 
      (@$EnableReadOnly ? XL('Cannot modify site -- $EnableReadOnly is set'): '');
  SDV($HandleUploadFmt,array(&$PageStartFmt,&$PageUploadFmt,&$PageEndFmt));
  PrintFmt($pagename,$HandleUploadFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:15,代码来源:upload.php

示例14: HandleTotalCounter


//.........这里部分代码省略.........
        }
    }
    //------------------------------------------------------------------------------------------------------------
    // OPERATING SYSTEMS
    $html .= '</table>' . '<br /><hr />' . '<h2>$[Operating systems]</h2>' . '<table border=\'0\'>' . '<tr><td' . ($TotalCounterShowNumbers ? ' colspan=\'2\'' : '') . '><b>$[Operating systems]&nbsp;</b></td><td colspan=\'2\'><b>$[Percent]</b></td><td align=\'right\'><b>$[Count]</b></td></tr>';
    @arsort($TotalCounter['OSes']);
    $tar = @array_slice($TotalCounter['OSes'], 0, $TotalCounterMaxItems);
    $max = @current($tar);
    $tot = @array_sum($tar);
    $i = 0;
    if (is_array($tar)) {
        foreach ($tar as $pn => $cnt) {
            $html .= '<tr>' . ($TotalCounterShowNumbers ? '<td align=\'right\' valign=\'bottom\'><small>' . ++$i . '.</small></td>' : '') . "<td>{$pn}&nbsp;</td><td>" . Round(100 * $cnt / $tot) . "%</td><td><div style='background-color:{$TotalCounterBarColor};height:13px;width:" . Round(200 * $cnt / $max) . "px;color:#fff'></div></td><td align='right'>&nbsp;{$cnt}</td>" . '</tr>';
        }
    }
    //------------------------------------------------------------------------------------------------------------
    // REFERERS
    $html .= '</table>' . '<br /><hr />' . '<h2>$[Referers]</h2>' . '<table border=\'0\'>' . '<tr><td' . ($TotalCounterShowNumbers ? ' colspan=\'2\'' : '') . '><b>$[Referers]&nbsp;</b></td><td colspan=\'2\'><b>$[Percent]</b></td><td align=\'right\'><b>$[Count]</b></td></tr>';
    @arsort($TotalCounter['Referers']);
    $tar = @array_slice($TotalCounter['Referers'], 0, $TotalCounterMaxItems);
    $max = @current($tar);
    $tot = @array_sum($tar);
    $i = 0;
    if (is_array($tar)) {
        foreach ($tar as $pn => $cnt) {
            $html .= '<tr>' . ($TotalCounterShowNumbers ? '<td align=\'right\' valign=\'bottom\'><small>' . ++$i . '.</small></td>' : '') . "<td>{$pn}&nbsp;</td><td>" . Round(100 * $cnt / $tot) . "%</td><td><div style='background-color:{$TotalCounterBarColor};height:13px;width:" . Round(200 * $cnt / $max) . "px;color:#fff'></div></td><td align='right'>&nbsp;{$cnt}</td>" . '</tr>';
        }
    }
    //------------------------------------------------------------------------------------------------------------
    // LOCATIONS
    $html .= '</table>' . '<br /><hr />' . '<h2>$[Locations]</h2>' . '<table border=\'0\'>' . '<tr><td' . ($TotalCounterShowNumbers ? ' colspan=\'2\'' : '') . '><b>$[Locations]&nbsp;</b></td><td colspan=\'2\'><b>$[Percent]</b></td><td align=\'right\'><b>$[Count]</b></td></tr>';
    @arsort($TotalCounter['Locations']);
    $tar = @array_slice($TotalCounter['Locations'], 0, $TotalCounterMaxItems);
    $max = @current($tar);
    $tot = @array_sum($tar);
    $i = 0;
    if (is_array($tar)) {
        foreach ($tar as $pn => $cnt) {
            $html .= '<tr>' . ($TotalCounterShowNumbers ? '<td align=\'right\' valign=\'bottom\'><small>' . ++$i . '.</small></td>' : '') . '<td>' . ($alllocations[$pn] == '' ? 'Unknown' : $alllocations[$pn]) . ' ' . ($pn == 'Unknown' || $pn == 'localhost' ? '' : "(.{$pn})") . '&nbsp;</td>' . '<td>' . Round(100 * $cnt / $tot) . '%</td>' . '<td><div style=\'background-color:$TotalCounterBarColor;height:13px;width:' . Round(200 * $cnt / $max) . "px;color:#fff'></div></td><td align='right'>&nbsp;{$cnt}</td>" . '</tr>';
        }
    }
    //------------------------------------------------------------------------------------------------------------
    // WEB BOTS
    $html .= '</table>' . '<br /><hr />' . '<h2>$[Web bots]</h2>' . '<table border=\'0\'>' . '<tr><td' . ($TotalCounterShowNumbers ? ' colspan=\'2\'' : '') . '><b>$[Web bots]&nbsp;</b></td><td colspan=\'2\'><b>$[Percent]</b></td><td align=\'right\'><b>$[Count]</b></td></tr>';
    @arsort($TotalCounter['Bots']);
    $tar = @array_slice($TotalCounter['Bots'], 0, $TotalCounterMaxItems);
    $max = @current($tar);
    $tot = @array_sum($tar);
    $i = 0;
    if (is_array($tar)) {
        foreach ($tar as $pn => $cnt) {
            $html .= '<tr>' . ($TotalCounterShowNumbers ? '<td align=\'right\' valign=\'bottom\'><small>' . ++$i . '.</small></td>' : '') . "<td>{$pn}&nbsp;</td><td>" . Round(100 * $cnt / $tot) . "%</td><td><div style='background-color:{$TotalCounterBarColor};height:13px;width:" . Round(200 * $cnt / $max) . "px;color:#fff'></div></td><td align='right'>&nbsp;{$cnt}</td>" . '</tr>';
        }
    }
    //------------------------------------------------------------------------------------------------------------
    // Downloads
    $html .= '</table>' . '<br /><hr />' . '<h2>$[File Downloads]</h2>' . '<table border=\'0\'>' . '<tr><td' . ($TotalCounterShowNumbers ? ' colspan=\'2\'' : '') . '><b>$[Downloads]&nbsp;</b></td><td colspan=\'2\'></td><td align=\'right\'><b>$[Count]</b></td></tr>';
    @arsort($TotalCounterDownloads);
    $max = count($TotalCounterDownloads);
    $tot = @array_sum($TotalCounterDownloads);
    $i = 0;
    if (is_array($TotalCounterDownloads)) {
        for ($row = 0; $row < $max; $row++) {
            $tablerow = each($TotalCounterDownloads);
            $value = $tablerow['value'];
            $html .= '<tr>' . ($TotalCounterShowNumbers ? '<td align=\'right\' valign=\'bottom\'><small>' . ++$i . '.</small></td>' : '') . '<td>' . $tablerow['key'] . '</td>' . '<td></td>' . '<td></td><td align="right">&nbsp;' . $value . '</td>' . '</tr>';
        }
    }
    //------------------------------------------------------------------------------------------------------------
    // Time statistics
    ## by MateuszCzaplinski
    foreach ($TotalCounterTimeBins as $n => $a) {
        $html .= '</table>' . '<br /><hr />' . "<h2>\$[{$n}]</h2><table border='0' class='TC-{$n} TotalCounter'>";
        SDVA($TotalCounterBinsFmt, array('"$count"', '"<div class=\\"TCprogress\\" style=\\"$direction:".Round(1+200*$count/$maxcount)."px;\\"></div>"', 'date("G",$now-$atom*($maxnr-1-$nr))'));
        $fmt = $a['fmt'];
        if (is_string($fmt)) {
            $tmp = $fmt;
            $fmt = $TotalCounterBinsFmt;
            $fmt[2] = $tmp;
        }
        if (is_array($fmt)) {
            $rows = array();
            ## Variables used in 'fmt'
            $maxcount = @max($TotalCounter[$n]);
            $direction = 'height';
            $maxnr = $a['max'];
            $atom = $a['atom'];
            $now = time();
            for ($nr = 0; $nr < $a['max']; $nr++) {
                for ($j = 0; $j < count($fmt); $j++) {
                    $count = $TotalCounter[$n][$nr];
                    $rows[$j] = (string) @$rows[$j] . "<td valign='bottom' class='seq{$j}'>" . (string) eval("global \$TotalCounterMonthsShort; return ({$fmt[$j]});") . "</td>\n";
                }
            }
        }
        $html .= '<tr>' . implode('</tr><tr>', $rows) . '</tr>';
    }
    $html .= '</table><hr /><p align=\'right\'>TotalCounter v' . TOTALCOUNTER . '</p>';
    PrintFmt($pagename, array(&$PageStartFmt, $html, &$PageEndFmt));
}
开发者ID:anomen-s,项目名称:pmwiki-recipes,代码行数:101,代码来源:totalcounter.php

示例15: HandleDiff

function HandleDiff($pagename)
{
    global $HandleDiffFmt, $PageStartFmt, $PageDiffFmt, $PageEndFmt;
    Lock(1);
    $page = ReadPage($pagename, '');
    if (!$page) {
        Abort("?cannot diff {$pagename}");
    }
    SDV($HandleDiffFmt, array(&$PageStartFmt, &$PageDiffFmt, 'function:PrintDiff', &$PageEndFmt));
    PrintFmt($pagename, $HandleDiffFmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:11,代码来源:pagerev.php


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