• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bbcodeurl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fparseimg

function fparseimg($src, $extra = '')
{
    global $_G;
    $rimg_id = random(5);
    $html = bbcodeurl($src, '<img id="iimg_' . $rimg_id . '" src="' . $src . '" border="0" alt="" ' . $extra . ' style="cursor: pointer;" />');
    return fcodedisp($html, 'image');
}
开发者ID:lemonstory,项目名称:bbs,代码行数:7,代码来源:function_followcode.php


示例2: parseimg

function parseimg($width, $height, $src)
{
    $extra = '';
    if ($width > IMAGEMAXWIDTH) {
        $height = intval(IMAGEMAXWIDTH * $height / $width);
        $width = IMAGEMAXWIDTH;
        $extra = ' onclick="zoom(this)" style="cursor:pointer"';
    }
    return bbcodeurl($src, '<img' . ($width > 0 ? ' width="' . $width . '"' : '') . ($height > 0 ? ' height="' . $height . '"' : '') . ' src="' . $src . '"' . $extra . ' border="0" alt="" />');
}
开发者ID:v998,项目名称:discuzx-en,代码行数:10,代码来源:function_discuzcode.php


示例3: parseimg

function parseimg($width, $height, $src, $lazyload, $pid, $extra = '')
{
    global $_G;
    static $styleoutput = null;
    if ($_G['setting']['domainwhitelist_affectimg']) {
        $tmp = parse_url($src);
        if (!empty($tmp['host']) && !iswhitelist($tmp['host'])) {
            return $src;
        }
    }
    if (strstr($src, 'file:') || substr($src, 1, 1) == ':') {
        return $src;
    }
    if ($width > $_G['setting']['imagemaxwidth']) {
        $height = intval($_G['setting']['imagemaxwidth'] * $height / $width);
        $width = $_G['setting']['imagemaxwidth'];
        if (defined('IN_MOBILE')) {
            $extra = '';
        } else {
            $extra = 'onmouseover="img_onmouseoverfunc(this)" onclick="zoom(this)" style="cursor:pointer"';
        }
    }
    $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src';
    $rimg_id = random(5);
    $GLOBALS['aimgs'][$pid][] = $rimg_id;
    $guestviewthumb = !empty($_G['setting']['guestviewthumb']['flag']) && empty($_G['uid']);
    $img = '';
    if ($guestviewthumb) {
        if (!isset($styleoutput)) {
            $img .= guestviewthumbstyle();
            $styleoutput = true;
        }
        $img .= '<div class="guestviewthumb"><img id="aimg_' . $rimg_id . '" class="guestviewthumb_cur" onclick="showWindow(\'login\', \'{loginurl}\'+\'&referer=\'+encodeURIComponent(location))" ' . $attrsrc . '="{url}" border="0" alt="" />
				<br><a href="{loginurl}" onclick="showWindow(\'login\', this.href+\'&referer=\'+encodeURIComponent(location));">' . lang('forum/template', 'guestviewthumb') . '</a></div>';
    } else {
        if (defined('IN_MOBILE')) {
            $img = '<img' . ($width > 0 ? ' width="' . $width . '"' : '') . ($height > 0 ? ' height="' . $height . '"' : '') . ' src="{url}" border="0" alt="" />';
        } else {
            $img = '<img id="aimg_' . $rimg_id . '" onclick="zoom(this, this.src, 0, 0, ' . ($_G['setting']['showexif'] ? 1 : 0) . ')" class="zoom"' . ($width > 0 ? ' width="' . $width . '"' : '') . ($height > 0 ? ' height="' . $height . '"' : '') . ' ' . $attrsrc . '="{url}" ' . ($extra ? $extra . ' ' : '') . 'border="0" alt="" />';
        }
    }
    $code = bbcodeurl($src, $img);
    if ($guestviewthumb) {
        $code = str_replace('{loginurl}', 'member.php?mod=logging&action=login', $code);
    }
    return $code;
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:47,代码来源:function_discuzcode.php


示例4: parseimg

function parseimg($width, $height, $src, $lazyload, $pid, $extra = '')
{
    global $_G;
    if (strstr($src, 'file:') || substr($src, 1, 1) == ':') {
        return $src;
    }
    if ($width > $_G['setting']['imagemaxwidth']) {
        $height = intval($_G['setting']['imagemaxwidth'] * $height / $width);
        $width = $_G['setting']['imagemaxwidth'];
        if (defined('IN_MOBILE') && !defined('TPL_DEFAULT')) {
            $extra = '';
        } else {
            $extra = 'onmouseover="img_onmouseoverfunc(this)" onclick="zoom(this)" style="cursor:pointer"';
        }
    }
    $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src';
    $rimg_id = random(5);
    $GLOBALS['aimgs'][$pid][] = $rimg_id;
    return bbcodeurl($src, '<img id="aimg_' . $rimg_id . '" onclick="zoom(this, this.src, 0, 0, ' . ($_G['setting']['showexif'] ? 1 : 0) . ')" class="zoom"' . ($width > 0 ? ' width="' . $width . '"' : '') . ($height > 0 ? ' height="' . $height . '"' : '') . ' ' . $attrsrc . '="' . $src . '" ' . ($extra ? $extra . ' ' : '') . 'border="0" alt="" />');
}
开发者ID:softhui,项目名称:discuz,代码行数:20,代码来源:function_discuzcode.php


示例5: parseimg

function parseimg($width, $height, $src) {
	return bbcodeurl($src, '<img'.($width > 0 ? " width=\"$width\"" : '').($height > 0 ? " height=\"$height\"" : '')." src=\"$src\" border=\"0\" alt=\"\" />");
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:3,代码来源:discuzcode.func.php


示例6: parseimg

function parseimg($width, $height, $src, $lazyload)
{
    global $_G;
    $extra = '';
    if ($width > $_G['setting']['imagemaxwidth']) {
        $height = intval($_G['setting']['imagemaxwidth'] * $height / $width);
        $width = $_G['setting']['imagemaxwidth'];
        if (defined('IN_MOBILE') && !defined('TPL_DEFAULT')) {
            $extra = '';
        } else {
            $extra = ' onclick="zoom(this)" style="cursor:pointer"';
        }
    }
    $attrsrc = !IS_ROBOT && $lazyload ? 'file' : 'src';
    return bbcodeurl($src, '<img' . ($width > 0 ? ' width="' . $width . '"' : '') . ($height > 0 ? ' height="' . $height . '"' : '') . ' ' . $attrsrc . '="' . $src . '"' . $extra . ' border="0" alt="" />');
}
开发者ID:v998,项目名称:discuzx-en,代码行数:16,代码来源:function_discuzcode.php


示例7: mobile_discuzcode

function mobile_discuzcode($param)
{
    global $_G;
    list($message, $smileyoff, $bbcodeoff, $htmlon, $allowsmilies, $allowbbcode, $allowimgcode, $allowhtml, $jammer, $parsetype, $authorid, $allowmediacode, $pid, $lazyload, $pdateline, $first) = $param;
    static $authorreplyexist;
    $message = preg_replace(array(lang('forum/misc', 'post_edit_regexp'), lang('forum/misc', 'post_edithtml_regexp'), lang('forum/misc', 'post_editnobbcode_regexp')), '', $message);
    if ($pid && strpos($message, '[/password]') !== FALSE) {
        if ($authorid != $_G['uid'] && !$_G['forum']['ismoderator']) {
            $message = preg_replace_callback("/\\s?\\[password\\](.+?)\\[\\/password\\]\\s?/i", function ($matches) use($pid) {
                return parsepassword($matches[1], $pid);
            }, $message);
            if ($_G['forum_discuzcode']['passwordlock'][$pid]) {
                return '';
            }
        } else {
            $message = preg_replace("/\\s?\\[password\\](.+?)\\[\\/password\\]\\s?/i", "", $message);
            $_G['forum_discuzcode']['passwordauthor'][$pid] = 1;
        }
    }
    if ($parsetype != 1 && !$bbcodeoff && $allowbbcode && (strpos($message, '[/code]') || strpos($message, '[/CODE]')) !== FALSE) {
        $message = preg_replace_callback("/\\s?\\[code\\](.+?)\\[\\/code\\]\\s?/is", function ($matches) {
            return mobile_parsecode($matches[1]);
        }, $message);
    }
    $msglower = strtolower($message);
    $htmlon = $htmlon && $allowhtml ? 1 : 0;
    if (!$htmlon) {
        $message = dhtmlspecialchars($message);
    } else {
        $message = preg_replace("/<script[^\\>]*?>(.*?)<\\/script>/i", '', $message);
    }
    if (!$smileyoff && $allowsmilies) {
        $message = mobile_parsesmiles($message);
    }
    if ($_G['setting']['allowattachurl'] && strpos($msglower, 'attach://') !== FALSE) {
        $message = preg_replace_callback("/attach:\\/\\/(\\d+)\\.?(\\w*)/i", function ($matches) {
            return parseattachurl($matches[1], $matches[2], 1);
        }, $message);
    }
    if ($allowbbcode) {
        if (strpos($msglower, 'ed2k://') !== FALSE) {
            $message = preg_replace_callback("/ed2k:\\/\\/(.+?)\\//", function ($matches) {
                return mobile_parseed2k($matches[1]);
            }, $message);
        }
    }
    if (!$bbcodeoff && $allowbbcode) {
        if (strpos($msglower, '[/url]') !== FALSE) {
            $message = preg_replace_callback("/\\[url(=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\\/\\/|www\\.|mailto:)?([^\r\n\\[\"']+?))?\\](.+?)\\[\\/url\\]/is", function ($matches) {
                return mobile_parseurl($matches[1], $matches[5], $matches[2]);
            }, $message);
        }
        if (strpos($msglower, '[/email]') !== FALSE) {
            $message = preg_replace_callback("/\\[email(=([a-z0-9\\-_.+]+)@([a-z0-9\\-_]+[.][a-z0-9\\-_.]+))?\\](.+?)\\[\\/email\\]/is", function ($matches) {
                return strip_tags(parseemail($matches[1], $matches[4]));
            }, $message);
        }
        $nest = 0;
        while (strpos($msglower, '[table') !== FALSE && strpos($msglower, '[/table]') !== FALSE) {
            $message = preg_replace_callback("/\\[table(?:=(\\d{1,4}%?)(?:,([\\(\\)%,#\\w ]+))?)?\\]\\s*(.+?)\\s*\\[\\/table\\]/is", function ($matches) {
                return mobile_parsetable($matches[1], $matches[2], $matches[3]);
            }, $message);
            if (++$nest > 4) {
                break;
            }
        }
        $message = str_replace(array('[/color]', '[/backcolor]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]', '[s]', '[/s]', '[hr]', '[/p]', '[i=s]', '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]', '[list=A]', "\r\n[*]", '[*]', '[/list]', '[indent]', '[/indent]', '[/float]'), array('</font>', '</font>', '', '', '', '<strong>', '</strong>', '<strike>', '</strike>', '<hr class="l" />', '</p>', '', '', '', '', '', '<ul>', '<ul type="1" class="litype_1">', '<ul type="a" class="litype_2">', '<ul type="A" class="litype_3">', '<li>', '<li>', '</ul>', '', '', ''), preg_replace(array("/\\[color=([#\\w]+?)\\]/i", "/\\[color=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[backcolor=([#\\w]+?)\\]/i", "/\\[backcolor=((rgb|rgba)\\([\\d\\s,]+?\\))\\]/i", "/\\[size=(\\d{1,2}?)\\]/i", "/\\[size=(\\d{1,2}(\\.\\d{1,2}+)?(px|pt)+?)\\]/i", "/\\[font=([^\\[\\<]+?)\\]/i", "/\\[align=(left|center|right)\\]/i", "/\\[p=(\\d{1,2}|null), (\\d{1,2}|null), (left|center|right)\\]/i", "/\\[float=left\\]/i", "/\\[float=right\\]/i"), array("<font color=\"\\1\">", "<font style=\"color:\\1\">", "<font style=\"background-color:\\1\">", "<font style=\"background-color:\\1\">", "", "", "", "", "<p>", "", ""), $message));
        $message = preg_replace("/\\s?\\[postbg\\]\\s*([^\\[\\<\r\n;'\"\\?\\(\\)]+?)\\s*\\[\\/postbg\\]\\s?/is", "", $message);
        if ($parsetype != 1) {
            if (strpos($msglower, '[/quote]') !== FALSE) {
                $message = preg_replace("/\\s?\\[quote\\][\n\r]*(.+?)[\n\r]*\\[\\/quote\\]\\s?/is", mobile_quote(), $message);
            }
            if (strpos($msglower, '[/free]') !== FALSE) {
                $message = preg_replace("/\\s*\\[free\\][\n\r]*(.+?)[\n\r]*\\[\\/free\\]\\s*/is", mobile_free(), $message);
            }
        }
        if (strpos($msglower, '[/media]') !== FALSE) {
            $message = preg_replace_callback("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/is", function ($matches) {
                return bbcodeurl($matches[2], '<a class="media" href="{url}" target="_blank">{url}</a>');
            }, $message);
        }
        if (strpos($msglower, '[/audio]') !== FALSE) {
            $message = preg_replace_callback("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/is", function ($matches) {
                return bbcodeurl($matches[2], '<a href="{url}" target="_blank">{url}</a>');
            }, $message);
        }
        if (strpos($msglower, '[/flash]') !== FALSE) {
            $message = preg_replace_callback("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/is", function ($matches) {
                return bbcodeurl($matches[4], '<a href="{url}" target="_blank">{url}</a>');
            }, $message);
        }
        if ($parsetype != 1 && $allowbbcode < 0 && isset($_G['cache']['bbcodes'][-$allowbbcode])) {
            $message = preg_replace($_G['cache']['bbcodes'][-$allowbbcode]['searcharray'], $_G['cache']['bbcodes'][-$allowbbcode]['replacearray'], $message);
        }
        if ($parsetype != 1 && strpos($msglower, '[/hide]') !== FALSE && $pid) {
            if ($_G['setting']['hideexpiration'] && $pdateline && (TIMESTAMP - $pdateline) / 86400 > $_G['setting']['hideexpiration']) {
                $message = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", "\\3", $message);
                $msglower = strtolower($message);
            }
            if (strpos($msglower, '[hide=d') !== FALSE) {
//.........这里部分代码省略.........
开发者ID:imnpc,项目名称:discuzx-php7-patch,代码行数:101,代码来源:discuzcode.func.php


示例8: parseimg

function parseimg($width, $height, $src)
{
    $img = '<img' . ($width > 0 ? ' width="' . $width . '"' : '') . ($height > 0 ? ' height="' . $height . '"' : '') . ' src="{url}" border="0" alt="" />';
    $code = bbcodeurl($src, $img);
    return $code;
}
开发者ID:druphliu,项目名称:dzzoffice,代码行数:6,代码来源:function_code.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bbencode_first_pass函数代码示例发布时间:2022-05-24
下一篇:
PHP bbcode_nl2br函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap