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


PHP LinkIMap函数代码示例

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


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

示例1: LinkHTTP

function LinkHTTP($pagename, $imap, $path, $alt, $txt, $fmt = NULL)
{
    global $EnableUrlApprovalRequired, $IMap, $WhiteUrlPatterns, $FmtV, $UnapprovedLink, $UnapprovedLinkCount, $UnapprovedLinkFmt;
    if (!IsEnabled($EnableUrlApprovalRequired, 1)) {
        return LinkIMap($pagename, $imap, $path, $alt, $txt, $fmt);
    }
    static $havereadpages;
    if (!$havereadpages) {
        ReadApprovedUrls($pagename);
        $havereadpages = true;
    }
    $p = str_replace(' ', '%20', $path);
    $url = str_replace('$1', $p, $IMap[$imap]);
    if (!isset($UnapprovedLink)) {
        $UnapprovedLink = array();
    }
    foreach ((array) $WhiteUrlPatterns as $pat) {
        if (preg_match("!^{$pat}(/|\$)!i", $url)) {
            return LinkIMap($pagename, $imap, $path, $alt, $txt, $fmt);
        }
    }
    $FmtV['$LinkUrl'] = PUE(str_replace('$1', $path, $IMap[$imap]));
    $FmtV['$LinkText'] = $txt;
    $FmtV['$LinkAlt'] = str_replace(array('"', "'"), array('"', '''), $alt);
    $UnapprovedLink[] = $url;
    @$UnapprovedLinkCount++;
    return FmtPageName($UnapprovedLinkFmt, $pagename);
}
开发者ID:libcrack,项目名称:pmwiki,代码行数:28,代码来源:urlapprove.php

示例2: LinkUpload

function LinkUpload($pagename, $imap, $path, $title, $txt, $fmt = NULL)
{
    global $FmtV, $UploadFileFmt, $LinkUploadCreateFmt, $UploadUrlFmt, $UploadPrefixFmt;
    $upname = MakeUploadName($pagename, $path);
    $filepath = FmtPageName("{$UploadFileFmt}/{$upname}", $pagename);
    if (!file_exists($filepath)) {
        $FmtV['$LinkUrl'] = FmtPageName("\$PageUrl?action=upload&upname={$upname}", $pagename);
        $FmtV['$LinkText'] = $txt;
        return FmtPageName($LinkUploadCreateFmt, $pagename);
    }
    $path = FmtPageName("{$UploadUrlFmt}{$UploadPrefixFmt}/{$upname}", $pagename);
    return LinkIMap($pagename, $imap, $path, $title, $txt, $fmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:13,代码来源:upload.php

示例3: LinkUpload

function LinkUpload($pagename, $imap, $path, $alt, $txt, $fmt = NULL)
{
    global $FmtV, $UploadFileFmt, $LinkUploadCreateFmt, $UploadUrlFmt, $UploadPrefixFmt, $EnableDirectDownload;
    if (preg_match('!^(.*)/([^/]+)$!', $path, $match)) {
        $pagename = MakePageName($pagename, $match[1]);
        $path = $match[2];
    }
    $upname = MakeUploadName($pagename, $path);
    $filepath = FmtPageName("{$UploadFileFmt}/{$upname}", $pagename);
    $FmtV['$LinkUpload'] = FmtPageName("\$PageUrl?action=upload&upname={$upname}", $pagename);
    $FmtV['$LinkText'] = $txt;
    if (!file_exists($filepath)) {
        return FmtPageName($LinkUploadCreateFmt, $pagename);
    }
    $path = PUE(FmtPageName(IsEnabled($EnableDirectDownload, 1) ? "{$UploadUrlFmt}{$UploadPrefixFmt}/{$upname}" : "{\$PageUrl}?action=download&upname={$upname}", $pagename));
    return LinkIMap($pagename, $imap, $path, $alt, $txt, $fmt);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:17,代码来源:upload.php

示例4: LinkUpload

function LinkUpload($pagename, $imap, $path, $alt, $txt, $fmt = NULL)
{
    global $FmtV, $UploadFileFmt, $LinkUploadCreateFmt, $UploadUrlFmt, $UploadPrefixFmt, $EnableDirectDownload;
    if (preg_match('!^(.*)/([^/]+)$!', $path, $match)) {
        $pagename = MakePageName($pagename, $match[1]);
        $path = $match[2];
    }
    $upname = MakeUploadName($pagename, $path);
    // tb
    $filepath = FmtPageName("{$UploadUrlFmt}/\$Group/{$upname}", $pagename);
    $FmtV['$LinkUpload'] = FmtPageName("\$PageUrl?action=upload&upname={$upname}", $pagename);
    $FmtV['$LinkText'] = $txt;
    //  if (!file_exists($filepath))
    //    return FmtPageName($LinkUploadCreateFmt, $pagename);
    $path = PUE(pmwiki_url(FmtPageName(file_exists(sys_custom($filepath)) ? "{$UploadUrlFmt}{$UploadPrefixFmt}/{$upname}" : "?page={$pagename}&file={$upname}", $pagename)));
    return LinkIMap($pagename, $imap, $path, $alt, $txt, $fmt);
}
开发者ID:drognisep,项目名称:Simple-Groupware,代码行数:17,代码来源:upload.php

示例5: LinkHTTP

function LinkHTTP($pagename, $imap, $path, $title, $txt, $fmt = NULL)
{
    global $IMap, $WhiteUrlPatterns, $FmtV, $UnapprovedLinkFmt;
    static $havereadpages;
    if (!$havereadpages) {
        ReadApprovedUrls($pagename);
        $havereadpages = true;
    }
    $p = str_replace(' ', '%20', $path);
    $url = str_replace('$1', $p, $IMap[$imap]);
    foreach ((array) $WhiteUrlPatterns as $pat) {
        if (preg_match("!^{$pat}(/|\$)!", $url)) {
            return LinkIMap($pagename, $imap, $path, $title, $txt, $fmt);
        }
    }
    $FmtV['$LinkText'] = $txt;
    return FmtPageName($UnapprovedLinkFmt, $pagename);
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:18,代码来源:urlapprove.php


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