本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}