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

PHP format_urls函数代码示例

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

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



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

示例1: format_comment

function format_comment($text, $strip_html = true)
{
    global $smilies, $privatesmilies, $pic_base_url, $customsmilies, $CURUSER, $badwords, $DEFAULTBASEURL;
    $s = $text;
    // This fixes the extraneous ;) smilies problem. When there was an html escaped
    // char before a closing bracket - like >), "), ... - this would be encoded
    // to &xxx;), hence all the extra smilies. I created a new :wink: label, removed
    // the ;) one, and replace all genuine ;) by :wink: before escaping the body.
    // (What took us so long? :blush:)- wyz
    $s = str_replace(";)", ":wink:", $s);
    if ($strip_html) {
        $s = htmlspecialchars($s);
    }
    // [php]php code[/php]
    $s = preg_replace_callback("/\\[php\\]((\\s|.)+?)\\[\\/php\\]/ims", "source_highlighter", $s);
    // [sql]sql code[/sql]
    $s = preg_replace_callback("/\\[sql\\]((\\s|.)+?)\\[\\/sql\\]/ims", "source_highlighter", $s);
    // [html]html code[/html]
    $s = preg_replace_callback("/\\[html\\]((\\s|.)+?)\\[\\/html\\]/ims", "source_highlighter", $s);
    // format urls
    $s = format_urls($s);
    // [url=http://www.example.com]Text[/url]
    $s = preg_replace_callback("/\\[url=([^()<>\\s]+?)\\]((\\s|.)+?)\\[\\/url\\]/i", "islocal", $s);
    // [url]http://www.example.com[/url]
    $s = preg_replace_callback("/\\[url\\]([^()<>\\s]+?)\\[\\/url\\]/i", "islocal", $s);
    // [*]
    $s = preg_replace("/\\[\\*\\]/", "<li>", $s);
    // [b]Bold[/b]
    $s = preg_replace("/\\[b\\]((\\s|.)+?)\\[\\/b\\]/", "<b>\\1</b>", $s);
    // [i]Italic[/i]
    $s = preg_replace("/\\[i\\]((\\s|.)+?)\\[\\/i\\]/", "<i>\\1</i>", $s);
    // [u]Underline[/u]
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/", "<u>\\1</u>", $s);
    // [u]Underline[/u]
    // the [you] tag
    $s = preg_replace("/\\[you\\]/i", $CURUSER['username'], $s);
    // Dynamic Vars
    $s = dynamic_user_vars($s);
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/i", "<u>\\1</u>", $s);
    // YouTube Vids
    $s = preg_replace("/\\[video=[^\\s'\"<>]*youtube.com.*v=([^\\s'\"<>]+)\\]/ims", "<object width=\"500\" height=\"410\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1\"></param><embed src=\"http://www.youtube.com/v/\\1\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></object>", $s);
    // Google Vids
    $s = preg_replace("/\\[video=[^\\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\\]/ims", "<embed style=\"width:500px; height:410px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=\\1\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"#ffffff\" scale=\"noScale\" wmode=\"window\" salign=\"TL\"  FlashVars=\"playerMode=embedded\"> </embed>", $s);
    // [highlight]Highlight text[/highlight]
    $s = preg_replace("/\\[highlight\\]((\\s|.)+?)\\[\\/highlight\\]/", "<table border=0 cellspacing=0 cellpadding=1>" . "<tr><td bgcolor=green><b>\\1</b></td></tr>" . "</table>", $s);
    // [marquee]Marquee[/marquee]
    $s = preg_replace("/\\[marquee\\]((\\s|.)+?)\\[\\/marquee\\]/", "<marquee>\\1</marquee>", $s);
    // [blink]blink[/blink]
    $s = preg_replace("/\\[blink\\]((\\s|.)+?)\\[\\/blink\\]/", "<blink>\\1</blink>", $s);
    // [mcom]Text[/mcom]
    $s = preg_replace("/\\[mcom\\]\\s*((\\s|.)+?)\\s*\\[\\/mcom\\]\\s*/i", "<span style=\"font-size: 18pt; line-height: 50%;\">\n   <div style=\"border-color: red; background-color: red; color: white; text-align: center; font-weight: bold; font-size: large;\">\n   <b>\\1</b>\n   </div>\n   </span>", $s);
    // [color=blue]Text[/color]
    $s = preg_replace("/\\[color=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color=\\1>\\2</font>", $s);
    // [color=#ffcc99]Text[/color]
    $s = preg_replace("/\\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color=\\1>\\2</font>", $s);
    // [size=4]Text[/size]
    $s = preg_replace("/\\[size=([1-7])\\]((\\s|.)+?)\\[\\/size\\]/i", "<font size=\\1>\\2</font>", $s);
    // [font=Arial]Text[/font]
    $s = preg_replace("/\\[font=([a-zA-Z ,]+)\\]((\\s|.)+?)\\[\\/font\\]/i", "<font face=\"\\1\">\\2</font>", $s);
    // Quotes
    $s = format_quotes($s);
    // URLs
    // $s = format_local_urls($s);
    // Linebreaks
    $s = nl2br($s);
    // [pre]Preformatted[/pre]
    $s = preg_replace("/\\[pre\\]((\\s|.)+?)\\[\\/pre\\]/i", "<tt><nobr>\\1</nobr></tt>", $s);
    // [nfo]NFO-preformatted[/nfo]
    $s = preg_replace("/\\[nfo\\]((\\s|.)+?)\\[\\/nfo\\]/i", "<tt><nobr><font face='MS Linedraw' size=2 style='font-size: 10pt; line-height: " . "10pt'>\\1</font></nobr></tt>", $s);
    // Maintain spacing
    $s = str_replace("  ", " &nbsp;", $s);
    // //////////////////
    $s = preg_replace("#<(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is", "&lt;script", $s);
    $s = preg_replace("#<(\\s+?)?/(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is", "&lt;/script", $s);
    $s = preg_replace("/javascript/i", "j&#097;v&#097;script", $s);
    $s = preg_replace("/alert/i", "&#097;lert", $s);
    $s = preg_replace("/about:/i", "&#097;bout:", $s);
    $s = preg_replace("/onmouseover/i", "&#111;nmouseover", $s);
    $s = preg_replace("/onclick/i", "&#111;nclick", $s);
    $s = preg_replace("/onsubmit/i", "&#111;nsubmit", $s);
    $s = preg_replace("/<body/i", "&lt;body", $s);
    $s = preg_replace("/<html/i", "&lt;html", $s);
    $s = preg_replace("/document\\./i", "&#100;ocument.", $s);
    // ///////
    $s = preg_replace_callback("/\\[img\\](http:\\/\\/[^\\s'\"<>]+(\\.(jpg|gif|png)))\\[\\/img\\]/i", "scale", $s);
    $s = preg_replace_callback("/\\[img=(http:\\/\\/[^\\s'\"<>]+(\\.(gif|jpg|png)))\\]/i", "scale", $s);
    // [hr=xxx]/[hr=xxx%]/[hr=xxxpt]/[hr=xxxpx]
    $s = preg_replace("/\\[hr(\\=([0-9]{1,4})(%|px|pt)?)\\]/i", "<hr align=center width=\"\\1\" />", $s);
    // [hr]
    $s = str_replace("[hr]", "<hr>", $s);
    // [center]
    $s = preg_replace("/\\[center\\]((\\s|.)+?)\\[\\/center\\]/i", "<div align='center'><tt><nobr><font face='Verdana' size=2 style='font-size: 10pt; line-height: " . "10pt'>\\1</font></nobr></tt></div>", $s);
    // [Spoiler]TEXT[/Spoiler]
    $s = preg_replace("/\\[spoiler\\]((\\s|.)+?)\\[\\/spoiler\\]/", "<div class=\"smallfont\" align=\"center\">\n                <small><b><blink>Click the button to show/hide Spoiler.</blink><br></b></small><input type=\"button\" value=\"Show\" style=\"width:75px;font-size:10px;margin:0px;padding:0px;\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\">\n                <div style=\"margin: 10px; padding: 10px; border: 1px inset;\" align=\"left\"><div style=\"display: none;\">\\1</div></div></div>", $s);
    // [s]Stroke[/s]
    $s = preg_replace("/\\[s\\]((\\s|.)+?)\\[\\/s\\]/", "<s>\\1</s>", $s);
    //[align=(center|left|right|justify)]text[/align]
    $s = preg_replace("/\\[align=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/align\\]/i", "<div style=\"text-align:\\1\">\\2</div>", $s);
    //[mail]mail[/mail]
    $s = preg_replace("/\\[mail\\]((\\s|.)+?)\\[\\/mail\\]/i", "<a href=\"mailto:\\1\" targe=\"_blank\">\\1</a>", $s);
//.........这里部分代码省略.........
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:101,代码来源:bbcode_functions.php


示例2: format_urls

}
if (curuser::$blocks['userdetails_page'] & block_userdetails::REPORT_USER && $BLOCKS['userdetails_report_user_on']) {
    require_once BLOCK_DIR . 'userdetails/report.php';
}
if (curuser::$blocks['userdetails_page'] & block_userdetails::USERSTATUS && $BLOCKS['userdetails_user_status_on']) {
    require_once BLOCK_DIR . 'userdetails/userstatus.php';
}
if (curuser::$blocks['userdetails_page'] & block_userdetails::SHOWPM && $BLOCKS['userdetails_showpm_on']) {
    require_once BLOCK_DIR . 'userdetails/showpm.php';
}
$HTMLOUT .= "</table></div>";
$HTMLOUT .= "<div id='activity'>";
$HTMLOUT .= "<table align='center' width='100%' border='1' cellspacing='0' cellpadding='5'>\n";
//==where is user now
if (!empty($user['where_is'])) {
    $HTMLOUT .= "<tr><td class='rowhead' width='1%'>{$lang['userdetails_location']}</td><td align='left' width='99%'>" . format_urls($user['where_is']) . "</td></tr>\n";
}
//==
$moodname = isset($mood['name'][$user['mood']]) ? htmlsafechars($mood['name'][$user['mood']]) : $lang['userdetails_neutral'];
$moodpic = isset($mood['image'][$user['mood']]) ? htmlsafechars($mood['image'][$user['mood']]) : 'noexpression.gif';
$HTMLOUT .= '<tr><td class="rowhead">' . $lang['userdetails_currentmood'] . '</td><td align="left"><span class="tool">
       <a href="javascript:;" onclick="PopUp(\'usermood.php\',\'' . $lang['userdetails_mood'] . '\',530,500,1,1);">
       <img src="' . $INSTALLER09['pic_base_url'] . 'smilies/' . $moodpic . '" alt="' . $moodname . '" border="0" />
       <span class="tip">' . htmlsafechars($user['username']) . ' ' . $moodname . ' !</span></a></span></td></tr>';
if (curuser::$blocks['userdetails_page'] & block_userdetails::SEEDBONUS && $BLOCKS['userdetails_seedbonus_on']) {
    require_once BLOCK_DIR . 'userdetails/seedbonus.php';
}
if (curuser::$blocks['userdetails_page'] & block_userdetails::IRC_STATS && $BLOCKS['userdetails_irc_stats_on']) {
    require_once BLOCK_DIR . 'userdetails/irc.php';
}
if (curuser::$blocks['userdetails_page'] & block_userdetails::REPUTATION && $BLOCKS['userdetails_reputation_on']) {
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:31,代码来源:userdetails.php


示例3: tr

    $HTMLOUT .= tr($lang['usercp_browse'], $categories, 1);
    $HTMLOUT .= tr($lang['usercp_clearnewtagmanually'], "<input type='checkbox' name='clear_new_tag_manually'" . ($CURUSER["clear_new_tag_manually"] == "yes" ? " checked='checked'" : "") . " /> {$lang['usercp_default_clearnewtagmanually']}", 1);
    $HTMLOUT .= tr($lang['usercp_scloud'], "<input type='checkbox' name='viewscloud'" . ($CURUSER["viewscloud"] == "yes" ? " checked='checked'" : "") . " /> {$lang['usercp_scloud1']}", 1);
    $HTMLOUT .= "<tr><td align='center' colspan='2'><input type='submit' value='Submit changes!' style='height: 25px' /></td></tr>";
    $HTMLOUT .= end_table();
} elseif ($action == "personal") {
    $HTMLOUT .= begin_table(true);
    $HTMLOUT .= "<tr><td class='colhead' colspan='2'  style='height:25px;' ><input type='hidden' name='action' value='personal' />Personal Options</td></tr>";
    if ($CURUSER['class'] >= UC_VIP) {
        $HTMLOUT .= tr($lang['usercp_title'], "<input size='50' value='" . htmlspecialchars($CURUSER["title"]) . "' name='title' /><br />", 1);
    }
    //==status mod
    $CURUSER['archive'] = unserialize($CURUSER['archive']);
    $HTMLOUT .= "<tr><td class='rowhead'>Online status</td><td><fieldset><legend><strong>Status update</strong></legend>";
    if (isset($CURUSER['last_status'])) {
        $HTMLOUT .= "<div id='current_holder'>\r\n    <small style='font-weight:bold;'>Current status</small>\r\n    <h2 id='current_status' title='Click to edit' onclick='status_pedit()'>" . format_urls($CURUSER["last_status"]) . "</h2></div>";
    }
    $HTMLOUT .= "<small style='font-weight:bold;'>Update status</small>\r\n    <textarea name='status' id='status' onkeyup='status_count()' cols='50' rows='4'></textarea>\r\n    <div style='width:390px;'>\r\n    <div style='float:left;padding-left:5px;'>NO bbcode or html allowed</div>\r\n    <div style='float:right;font-size:12px;font-weight:bold;' id='status_count'>140</div>\r\n    <div style='clear:both;'></div></div>";
    if (count($CURUSER['archive'])) {
        $HTMLOUT .= "<div style='width:390px'>\r\n    <div style='float:left;padding-left:5px;'><small style='font-weight:bold;'>Status archive</small></div>\r\n    <div style='float:right;cursor:pointer' id='status_archive_click' onclick='status_slide()'>+</div>\r\n    <div style='clear:both;'></div>\r\n    <div id='status_archive' style='padding-left:15px;display:none;'>";
        if (is_array($CURUSER['archive'])) {
            foreach (array_reverse($CURUSER['archive'], true) as $a_id => $sa) {
                $HTMLOUT .= '<div id="status_' . $a_id . '">
    <div style="float:left">' . htmlspecialchars($sa['status']) . '
    <small>added ' . get_date($sa['date'], '', 0, 1) . '</small></div>
    <div style="float:right;cursor:pointer;"><span onclick="status_delete(' . $a_id . ')"></span></div>
    <div style="clear:both;border:1px solid #222;border-width:1px 0 0 0;margin-bottom:3px;"></div></div>';
            }
        }
        $HTMLOUT .= "</div></div>";
    }
开发者ID:CharlieHD,项目名称:U-232-V2,代码行数:31,代码来源:usercp.php


示例4: dbconn

|   http://www.tbdev.net
|   =============================================
|   svn: http://sourceforge.net/projects/tbdevnet/
|   Licence Info: GPL
+------------------------------------------------
|   $Date$
|   $Revision$
|   $Author$
|   $URL$
+------------------------------------------------
*/
require "include/bittorrent.php";
require "include/user_functions.php";
require "include/bbcode_functions.php";
dbconn(false);
loggedinorreturn();
$lang = array_merge(load_language('global'), load_language('viewnfo'));
$id = 0 + $_GET["id"];
if ($CURUSER['class'] < UC_POWER_USER || !is_valid_id($id)) {
    die;
}
$r = mysql_query("SELECT name,nfo FROM torrents WHERE id={$id}") or sqlerr();
$a = mysql_fetch_assoc($r) or die("{$lang['text_puke']}");
$nfo = htmlspecialchars($a["nfo"]);
$HTMLOUT = '';
$HTMLOUT .= "<h1>{$lang['text_nfofor']}<a href='details.php?id={$id}'>{$a['name']}</a></h1>\n";
$HTMLOUT .= "<table border='1' cellspacing='0' cellpadding='5'><tr><td class='text'>\n";
$HTMLOUT .= "<pre>" . format_urls(htmlentities($nfo, ENT_QUOTES, 'UTF-8')) . "</pre>\n";
$HTMLOUT .= "</td></tr></table>\n";
$HTMLOUT .= "<p align='center'>{$lang['text_forbest']}" . "<a href='ftp://{$_SERVER['HTTP_HOST']}/misc/linedraw.ttf'>{$lang['text_linedraw']}</a>{$lang['text_font']}</p>\n";
print stdhead() . $HTMLOUT . stdfoot();
开发者ID:CHEZDESIGN,项目名称:mytorrent,代码行数:31,代码来源:viewnfo.php


示例5: format_comment

function format_comment($text, $strip_html = true)
{
    global $smilies, $pic_base_url;
    $s = $text;
    unset($text);
    // This fixes the extraneous ;) smilies problem. When there was an html escaped
    // char before a closing bracket - like >), "), ... - this would be encoded
    // to &xxx;), hence all the extra smilies. I created a new :wink: label, removed
    // the ;) one, and replace all genuine ;) by :wink: before escaping the body.
    // (What took us so long? :blush:)- wyz
    $s = str_replace(";)", ":wink:", $s);
    if ($strip_html) {
        $s = htmlentities($s, ENT_QUOTES);
    }
    // [*]
    $s = preg_replace("/\\[\\*\\]/", "<li>", $s);
    // [b]Bold[/b]
    $s = preg_replace("/\\[b\\]((\\s|.)+?)\\[\\/b\\]/", "<b>\\1</b>", $s);
    // [i]Italic[/i]
    $s = preg_replace("/\\[i\\]((\\s|.)+?)\\[\\/i\\]/", "<i>\\1</i>", $s);
    // [u]Underline[/u]
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/", "<u>\\1</u>", $s);
    // [u]Underline[/u]
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/i", "<u>\\1</u>", $s);
    // [img]http://www/image.gif[/img]
    $s = preg_replace("/\\[img\\](http:\\/\\/[^\\s'\"<>]+(\\.(jpg|gif|png)))\\[\\/img\\]/i", "<img border=\"0\" src=\"\\1\" alt='' />", $s);
    // [img=http://www/image.gif]
    $s = preg_replace("/\\[img=(http:\\/\\/[^\\s'\"<>]+(\\.(gif|jpg|png)))\\]/i", "<img border=\"0\" src=\"\\1\" alt='' />", $s);
    // [color=blue]Text[/color]
    $s = preg_replace("/\\[color=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color='\\1'>\\2</font>", $s);
    // [color=#ffcc99]Text[/color]
    $s = preg_replace("/\\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color='\\1'>\\2</font>", $s);
    // [url=http://www.example.com]Text[/url]
    $s = preg_replace("/\\[url=([^()<>\\s]+?)\\]((\\s|.)+?)\\[\\/url\\]/i", "<a href=\"\\1\">\\2</a>", $s);
    // [url]http://www.example.com[/url]
    $s = preg_replace("/\\[url\\]([^()<>\\s]+?)\\[\\/url\\]/i", "<a href=\"\\1\">\\1</a>", $s);
    // [size=4]Text[/size]
    $s = preg_replace("/\\[size=([1-7])\\]((\\s|.)+?)\\[\\/size\\]/i", "<font size='\\1'>\\2</font>", $s);
    // [font=Arial]Text[/font]
    $s = preg_replace("/\\[font=([a-zA-Z ,]+)\\]((\\s|.)+?)\\[\\/font\\]/i", "<font face=\"\\1\">\\2</font>", $s);
    //  //[quote]Text[/quote]
    //  $s = preg_replace(
    //    "/\[quote\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i",
    //    "<p class=sub><b>Quote:</b></p><table class=main border=1 cellspacing=0 cellpadding=10><tr><td style='border: 1px black dotted'>\\1</td></tr></table><br />", $s);
    //  //[quote=Author]Text[/quote]
    //  $s = preg_replace(
    //    "/\[quote=(.+?)\]\s*((\s|.)+?)\s*\[\/quote\]\s*/i",
    //    "<p class=sub><b>\\1 wrote:</b></p><table class=main border=1 cellspacing=0 cellpadding=10><tr><td style='border: 1px black dotted'>\\2</td></tr></table><br />", $s);
    // Quotes
    $s = format_quotes($s);
    // URLs
    $s = format_urls($s);
    //	$s = format_local_urls($s);
    // Linebreaks
    $s = nl2br($s);
    // [pre]Preformatted[/pre]
    $s = preg_replace("/\\[pre\\]((\\s|.)+?)\\[\\/pre\\]/i", "<tt><span style=\"white-space: nowrap;\">\\1</span></tt>", $s);
    // [nfo]NFO-preformatted[/nfo]
    $s = preg_replace("/\\[nfo\\]((\\s|.)+?)\\[\\/nfo\\]/i", "<tt><span style=\"white-space: nowrap;\"><font face='MS Linedraw' size='2' style='font-size: 10pt; line-height: " . "10pt'>\\1</font></span></tt>", $s);
    // Maintain spacing
    $s = str_replace("  ", " &nbsp;", $s);
    foreach ($smilies as $code => $url) {
        $s = str_replace($code, "<img border='0' src=\"{$pic_base_url}smilies/{$url}\" alt=\"" . htmlspecialchars($code) . "\" />", $s);
    }
    return $s;
}
开发者ID:CtrlSystem,项目名称:biotorrents,代码行数:66,代码来源:bbcode_functions.php


示例6: format_comment

function format_comment($text, $strip_html = true, $urls = true, $images = true)
{
    global $smilies, $staff_smilies, $customsmilies, $INSTALLER09, $CURUSER;
    $s = $text;
    unset($text);
    // This fixes the extraneous ;) smilies problem. When there was an html escaped
    // char before a closing bracket - like >), "), ... - this would be encoded
    // to &xxx;), hence all the extra smilies. I created a new :wink: label, removed
    // the ;) one, and replace all genuine ;) by :wink: before escaping the body.
    // (What took us so long? :blush:)- wyz
    $s = str_replace(';)', ':wink:', $s);
    // fix messed up links
    $s = str_replace('&amp;', '&', $s);
    if ($strip_html) {
        $s = htmlsafechars($s, ENT_QUOTES, charset());
    }
    if (preg_match("#function\\s*\\((.*?)\\|\\|#is", $s)) {
        $s = str_replace(":", "&#58;", $s);
        $s = str_replace("[", "&#91;", $s);
        $s = str_replace("]", "&#93;", $s);
        $s = str_replace(")", "&#41;", $s);
        $s = str_replace("(", "&#40;", $s);
        $s = str_replace("{", "&#123;", $s);
        $s = str_replace("}", "&#125;", $s);
        $s = str_replace("\$", "&#36;", $s);
    }
    // BBCode to find...
    $bb_code_in = array('/\\[b\\]\\s*((\\s|.)+?)\\s*\\[\\/b\\]/i', '/\\[i\\]\\s*((\\s|.)+?)\\s*\\[\\/i\\]/i', '/\\[u\\]\\s*((\\s|.)+?)\\s*\\[\\/u\\]/i', '/\\[email\\](.*?)\\[\\/email\\]/i', '/\\[align=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/align\\]/i', '/\\[blockquote\\]\\s*((\\s|.)+?)\\s*\\[\\/blockquote\\]/i', '/\\[strike\\]\\s*((\\s|.)+?)\\s*\\[\\/strike\\]/i', '/\\[s\\]\\s*((\\s|.)+?)\\s*\\[\\/s\\]/i', '/\\[pre\\]\\s*((\\s|.)+?)\\s*\\[\\/pre\\]/i', '/\\[marquee\\](.*?)\\[\\/marquee\\]/i', '/\\[collapse=(.*?)\\]\\s*((\\s|.)+?)\\s*\\[\\/collapse\\]/i', '/\\[size=([1-7])\\]\\s*((\\s|.)+?)\\s*\\[\\/size\\]/i', '/\\[color=([a-zA-Z]+)\\]\\s*((\\s|.)+?)\\s*\\[\\/color\\]/i', '/\\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\\]\\s*((\\s|.)+?)\\s*\\[\\/color\\]/i', '/\\[font=([a-zA-Z ,]+)\\]((\\s|.)+?)\\[\\/font\\]/i', '/\\[spoiler\\]\\s*((\\s|.)+?)\\s*\\[\\/spoiler\\]/i', '/\\[video=[^\\s\'"<>]*youtube.com.*v=([^\\s\'"<>]+)\\]/ims', "/\\[video=[^\\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\\]/ims", '/\\[audio\\](http:\\/\\/[^\\s\'"<>]+(\\.(mp3|aiff|wav)))\\[\\/audio\\]/i', '/\\[list=([0-9]+)\\]((\\s|.)+?)\\[\\/list\\]/i', '/\\[list\\]((\\s|.)+?)\\[\\/list\\]/i', '/\\[\\*\\]\\s?(.*?)\\n/i', '/\\[li\\]\\s?(.*?)\\n/i', '/\\[hr\\]/');
    // And replace them by...
    $bb_code_out = array('<span style="font-weight: bold;">\\1</span>', '<span style="font-style: italic;">\\1</span>', '<span style="text-decoration: underline;">\\1</span>', '<a class="altlink" href="mailto:\\1">\\1</a>', '<div style="text-align: \\1;">\\2</div>', '<blockquote class="style"><span>\\1</span></blockquote>', '<span style="text-decoration: line-through;">\\1</span>', '<span style="text-decoration: line-through;">\\1</span>', '<span style="white-space: nowrap;">\\1</span>', '<marquee class="style">\\1</marquee>', '<div style="padding-top: 2px; white-space: nowrap"><span style="cursor: hand; cursor: pointer; border-bottom: 1px dotted" onclick="if (document.getElementById(\'collapseobj\\1\').style.display==\'block\') {document.getElementById(\'collapseobj\\1\').style.display=\'none\' } else { document.getElementById(\'collapseobj\\1\').style.display=\'block\' }">\\1</span></div><div id="collapseobj\\1" style="display:none; padding-top: 2px; padding-left: 14px; margin-bottom:10px; padding-bottom: 2px; background-color: #FEFEF4;">\\2</div>', '<span class="size\\1">\\2</span>', '<span style="color:\\1;">\\2</span>', '<span style="color:\\1;">\\2</span>', '<span style="font-family:\'\\1\';">\\2</span>', '<table cellspacing="0" cellpadding="10"><tr><td class="forum_head_dark" style="padding:5px">Spoiler! to view, roll over the spoiler box.</td></tr><tr><td class="spoiler"><a href="#">\\1</a></td></tr></table><br />', '<object width="500" height="410"><param name="movie" value="http://www.youtube.com/v/\\1"></param><embed src="http://www.youtube.com/v/\\1" type="application/x-shockwave-flash" width="500" height="410"></embed></object>', "<embed style=\"width:500px; height:410px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=\\1\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"#ffffff\" scale=\"noScale\" wmode=\"window\" salign=\"TL\"  FlashVars=\"playerMode=embedded\"> </embed>", '<span style="text-align: center;"><p>Audio From: \\1</p><embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=\\1" width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" /></span>', '<ol class="style" start="\\1">\\2</ol>', '<ul class="style">\\1</ul>', '<li>\\1</li>', '<li>\\1</li>', '<hr />');
    $s = preg_replace($bb_code_in, $bb_code_out, $s);
    if ($urls) {
        $s = format_urls($s);
    }
    if (stripos($s, '[url') !== false && $urls) {
        $s = preg_replace_callback("/\\[url=([^()<>\\s]+?)\\](.+?)\\[\\/url\\]/is", "islocal", $s);
        // [url]http://www.example.com[/url]
        $s = preg_replace_callback("/\\[url\\]([^()<>\\s]+?)\\[\\/url\\]/is", "islocal", $s);
    }
    // Linebreaks
    $s = nl2br($s);
    // Dynamic Vars
    $s = dynamic_user_vars($s);
    // [pre]Preformatted[/pre]
    if (stripos($s, '[pre]') !== false) {
        $s = preg_replace("/\\[pre\\]((\\s|.)+?)\\[\\/pre\\]/i", "<tt><span style=\"white-space: nowrap;\">\\1</span></tt>", $s);
    }
    // [nfo]NFO-preformatted[/nfo]
    if (stripos($s, '[nfo]') !== false) {
        $s = preg_replace("/\\[nfo\\]((\\s|.)+?)\\[\\/nfo\\]/i", "<tt><span style=\"white-space: nowrap;\"><font face='MS Linedraw' size='2' style='font-size: 10pt; line-height:" . "10pt'>\\1</font></span></tt>", $s);
    }
    //==Media tag
    if (stripos($s, '[media=') !== false) {
        $s = preg_replace("#\\[media=(youtube|liveleak|GameTrailers|vimeo|imdb)\\](.+?)\\[/media\\]#ies", "_MediaTag('\\2','\\1')", $s);
    }
    if (stripos($s, '[img') !== false && $images) {
        // [img=http://www/image.gif]
        $s = preg_replace("/\\[img\\]((http|https):\\/\\/[^\\s'\"<>]+(\\.(jpg|gif|png|bmp)))\\[\\/img\\]/i", "<a href=\"\\1\" rel=\"lightbox\"><img src=\"\\1\" border=\"0\" alt=\"\" style=\"max-width: 150px;\" /></a>", $s);
        // [img=http://www/image.gif]
        $s = preg_replace("/\\[img=((http|https):\\/\\/[^\\s'\"<>]+(\\.(gif|jpg|png|bmp)))\\]/i", "<a href=\"\\1\" rel=\"lightbox\"><img src=\"\\1\" border=\"0\" alt=\"\" style=\"max-width: 150px;\" /></a>", $s);
    }
    // [mcom]Text[/mcom]
    if (stripos($s, '[mcom]') !== false) {
        $s = preg_replace("/\\[mcom\\](.+?)\\[\\/mcom\\]/is", "<div style=\"font-size: 18pt; line-height: 50%;\">\r\n   <div style=\"border-color: red; background-color: red; color: white; text-align: center; font-weight: bold; font-size: large;\"><b>\\1</b></div></div>", $s);
    }
    // the [you] tag
    if (stripos($s, '[you]') !== false) {
        $s = preg_replace("/\\[you\\]/i", $CURUSER['username'], $s);
    }
    // [php]code[/php]
    if (stripos($s, '[php]') !== false) {
        $s = preg_replace("#\\[(php|sql|html)\\](.+?)\\[\\/\\1\\]#ise", "source_highlighter('\\2','\\1')", $s);
    }
    // Maintain spacing
    $s = str_replace('  ', ' &nbsp;', $s);
    if (isset($smilies)) {
        foreach ($smilies as $code => $url) {
            $s = str_replace($code, "<img border='0' src=\"{$INSTALLER09['pic_base_url']}smilies/{$url}\" alt=\"\" />", $s);
            //$s = str_replace($code, '<span id="'.$attr.'"></span>', $s);
        }
    }
    if (isset($staff_smilies)) {
        foreach ($staff_smilies as $code => $url) {
            $s = str_replace($code, "<img border='0' src=\"{$INSTALLER09['pic_base_url']}smilies/{$url}\" alt=\"\" />", $s);
            //$s = str_replace($code, '<span id="'.$attr.'"></span>', $s);
        }
    }
    if (isset($customsmilies)) {
        foreach ($customsmilies as $code => $url) {
            $s = str_replace($code, "<img border='0' src=\"{$INSTALLER09['pic_base_url']}smilies/{$url}\" alt=\"\" />", $s);
            //$s = str_replace($code, '<span id="'.$attr.'"></span>', $s);
        }
    }
    $s = format_quotes($s);
    $s = check_BBcode($s);
    return $s;
}
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:97,代码来源:bbcode_functions.php


示例7: htmlentities

}
$nfo = "";
if ($view == "latin-1" || $view == "fonthack") {
    // Do not convert from ibm-437, read bytes as is.
    // NOTICE: TBSource specifies Latin-1 encoding in include/bittorrent.php:
    $nfo = htmlentities($a["nfo"]);
} else {
    // Convert from ibm-437 to html unicode entities.
    // take special care of Swedish letters if in magic view.
    $nfo = code($a["nfo"], $view == "magic");
}
$HTMLOUT = '';
$HTMLOUT .= "<h1>nfo for <a href='{$INSTALLER09['baseurl']}/details.php?id={$id}'>" . htmlentities($a["name"]) . "</a></h1>\n\r\n<table border='1' cellspacing='0' cellpadding='10' align='center'>\r\n<tr>\r\n<td align='center' width='50%'>\r\n<a href='{$INSTALLER09['baseurl']}/viewnfo.php?id=" . $id . "&amp;view=magic' title='Magisk IBM-437'>\r\n<b>DOS-vy</b></a></td>\r\n<td align='center' width='50%'>\r\n<a href='{$INSTALLER09['baseurl']}/viewnfo.php?id=" . $id . "&amp;view=latin-1' title='Latin-1'><b>Windows-vy</b></a></td>\r\n</tr>\r\n<tr>\r\n<td colspan='3'>\r\n<table border='1' cellspacing='0' cellpadding='5'><tr>\r\n<td class='text'>";
// -- About to output NFO data
if ($view == "fonthack") {
    // Please notice: MS LineDraw's glyphs are included in the Courier New font
    // as of Courier New version 2.0, but uses the correct mappings instead.
    // [url="http://support.microsoft.com/kb/q179422/"]http://support.microsoft.com/kb/q179422/[/url]
    $HTMLOUT .= "<pre style=\"font-size:10pt; font-family: 'MS LineDraw', 'Terminal', monospace;\">";
} else {
    // IE6.0 need to know which font to use, Mozilla can figure it out in its own
    // (windows firefox at least)
    // Anything else than 'Courier New' looks pretty broken.
    // 'Lucida Console', 'FixedSys'
    $HTMLOUT .= "<pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">";
}
// Writes the (eventually modified) NFO data to output, first formating urls.
$HTMLOUT .= format_urls($nfo);
$HTMLOUT .= "</pre>\n";
$HTMLOUT .= "</td></tr></table></td></tr></table>";
echo stdhead() . $HTMLOUT . stdfoot();
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:31,代码来源:viewnfo.php


示例8: format_urls

		title="Strikt: Visar nfo-filen som den ser ut i teckentabellen IBM-437">
		<b>Strikt DOS-vy</b></a></td>*/
?>
	</tr>
	<tr>
		<td colspan="3">
			<table border="1" cellspacing="0" cellpadding="5">
				<tr>
					<td class="text">
						<?php 
// -- About to output NFO data
// Please notice: MS LineDraw's glyphs are included in the Courier New font
// as of Courier New version 2.0, but uses the correct mappings instead.
// http://support.microsoft.com/kb/q179422/
$font = $view == "fonthack" ? "font-1" : "font-2";
?>
						<pre class="<?php 
echo $font;
?>
"><?php 
echo format_urls($nfo);
?>
</pre>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<?php 
stdfoot();
开发者ID:CptTZ,项目名称:NexusPHP-1,代码行数:31,代码来源:viewnfo.php


示例9: format_comment


//.........这里部分代码省略.........
        $s = preg_replace('/\\[u\\](.+?)\\[\\/u\\]/is', "<span style='text-decoration:underline;'>\\1</span>", $s);
    }
    // [color=blue]Text[/color]
    if (stripos($s, '[color=') !== false) {
        $s = preg_replace('/\\[color=([a-zA-Z]+)\\](.+?)\\[\\/color\\]/is', '<span style="color: \\1">\\2</span>', $s);
        // [color=#ffcc99]Text[/color]
        $s = preg_replace('/\\[color=(#[a-f0-9]{6})\\](.+?)\\[\\/color\\]/is', '<span style="color: \\1">\\2</span>', $s);
    }
    //==Media tag
    if (stripos($s, '[media=') !== false) {
        $s = preg_replace("#\\[media=(youtube|liveleak|GameTrailers|imdb)\\](.+?)\\[/media\\]#ies", "_MediaTag('\\2','\\1')", $s);
        $s = preg_replace("#\\[media=(youtube|liveleak|GameTrailers|vimeo)\\](.+?)\\[/media\\]#ies", "_MediaTag('\\2','\\1')", $s);
    }
    //--img
    if (stripos($s, '[img') !== false) {
        $s = preg_replace_callback("/\\[img\\](http:\\/\\/[^\\s'\"<>]+(\\.(jpg|gif|png)))\\[\\/img\\]/i", "scale", $s);
        $s = preg_replace_callback("/\\[img=(http:\\/\\/[^\\s'\"<>]+(\\.(gif|jpg|png)))\\]/i", "scale", $s);
    }
    // [size=4]Text[/size]
    if (stripos($s, '[size=') !== false) {
        $s = preg_replace('/\\[size=([1-7])\\](.+?)\\[\\/size\\]/is', "<span class='size\\1'>\\2</span>", $s);
    }
    // [font=Arial]Text[/font]
    if (stripos($s, '[font=') !== false) {
        $s = preg_replace('/\\[font=([a-zA-Z ,]+)\\](.+?)\\[\\/font\\]/is', '<span style="font-family: \\1">\\2</span>', $s);
    }
    // [s]Stroke[/s]
    if (stripos($s, '[s]') !== false) {
        $s = preg_replace("/\\[s\\](.+?)\\[\\/s\\]/is", "<s>\\1</s>", $s);
    }
    // the [you] tag
    if (stripos($s, '[you]') !== false) {
        $s = preg_replace("/\\[you\\]/i", $CURUSER['username'], $s);
    }
    // Dynamic Vars
    $s = dynamic_user_vars($s);
    // [Spoiler]TEXT[/Spoiler]
    if (stripos($s, '[spoiler]') !== false) {
        $s = preg_replace("/\\[spoiler\\](.+?)\\[\\/spoiler\\]/is", "<div class=\"smallfont\" align=\"left\">\r\n    <input type=\"button\" value=\"Show\" style=\"width:75px;font-size:10px;margin:0px;padding:0px;\" onclick=\"if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }\" />\r\n    <div style=\"margin: 10px; padding: 10px; border: 1px inset;\" align=\"left\"><div style=\"display: none;\">\\1</div></div></div>", $s);
    }
    // [mcom]Text[/mcom]
    if (stripos($s, '[mcom]') !== false) {
        $s = preg_replace("/\\[mcom\\](.+?)\\[\\/mcom\\]/is", "<div style=\"font-size: 18pt; line-height: 50%;\">\r\n    <div style=\"border-color: red; background-color: red; color: white; text-align: center; font-weight: bold; font-size: large;\"><b>\\1</b></div></div>", $s);
    }
    // [php]php code[/php]
    if (stripos($s, '[php]') !== false) {
        $s = preg_replace_callback("/\\[php\\](.+?)\\[\\/php\\]/ims", "source_highlighter", $s);
    }
    // [sql]sql code[/sql]
    if (stripos($s, '[sql]') !== false) {
        $s = preg_replace_callback("/\\[sql\\](.+?)\\[\\/sql\\]/ims", "source_highlighter", $s);
    }
    // [html]html code[/html]
    if (stripos($s, '[html]') !== false) {
        $s = preg_replace_callback("/\\[html\\](.+?)\\[\\/html\\]/ims", "source_highlighter", $s);
    }
    //[mail]mail[/mail]
    if (stripos($s, '[mail]') !== false) {
        $s = preg_replace("/\\[mail\\](.+?)\\[\\/mail\\]/is", "<a href=\"mailto:\\1\" targe=\"_blank\">\\1</a>", $s);
    }
    //[align=(center|left|right|justify)]text[/align]
    if (stripos($s, '[align=') !== false) {
        $s = preg_replace("/\\[align=([a-zA-Z]+)\\](.+?)\\[\\/align\\]/is", "<div style=\"text-align:\\1\">\\2</div>", $s);
    }
    // Quotes
    $s = format_quotes($s);
    // URLs
    $s = format_urls($s);
    //	$s = format_local_urls($s);
    // [url=http://www.example.com]Text[/url]
    if (stripos($s, '[url') !== false) {
        $s = preg_replace_callback("/\\[url=([^()<>\\s]+?)\\](.+?)\\[\\/url\\]/is", "islocal", $s);
        // [url]http://www.example.com[/url]
        $s = preg_replace_callback("/\\[url\\]([^()<>\\s]+?)\\[\\/url\\]/is", "islocal", $s);
    }
    // Linebreaks
    $s = nl2br($s);
    // [pre]Preformatted[/pre]
    if (stripos($s, '[pre]') !== false) {
        $s = preg_replace("/\\[pre\\](.+?)\\[\\/pre\\]/is", "<tt><span style=\"white-space: nowrap;\">\\1</span></tt>", $s);
    }
    // [nfo]NFO-preformatted[/nfo]
    if (stripos($s, '[nfo]') !== false) {
        $s = preg_replace("/\\[nfo\\](.+?)\\[\\/nfo\\]/i", "<tt><span style=\"white-space: nowrap;\"><font face='MS Linedraw' size='2' style='font-size: 10pt; line-height: " . "10pt'>\\1</font></span></tt>", $s);
    }
    // Maintain spacing
    $s = str_replace("  ", " &nbsp;", $s);
    //==Smilies
    if (isset($smilies)) {
        foreach ($smilies as $code => $url) {
            $s = str_replace($code, "<img border='0' src=\"{$TBDEV['pic_base_url']}smilies/{$url}\" alt=\"" . htmlspecialchars($code) . "\" />", $s);
        }
    }
    if (isset($customsmilies)) {
        foreach ($customsmilies as $code => $url) {
            $s = str_replace($code, "<img border='0' src=\"{$TBDEV['pic_base_url']}smilies/{$url}\" alt=\"" . htmlspecialchars($code) . "\" />", $s);
        }
    }
    return $s;
}
开发者ID:thefkboss,项目名称:U-232,代码行数:101,代码来源:bbcode_functions.php


示例10: dbconn

<?php

require "include/bittorrent.php";
require_once "include/user_functions.php";
require_once "include/bbcode_functions.php";
dbconn(false);
maxcoder();
if (!logged_in()) {
    header("HTTP/1.0 404 Not Found");
    // moddifed logginorreturn by retro//Remember to change the following line to match your server
    print "<html><h1>Not Found</h1><p>The requested URL /{$_SERVER['PHP_SELF']} was not found on this server.</p><hr /><address>Apache/1.1.11 " . $SITENAME . " Server at " . $_SERVER['SERVER_NAME'] . " Port 80</address></body></html>\n";
    die;
}
$id = 0 + $_GET["id"];
if (get_user_class() < UC_POWER_USER || !is_valid_id($id)) {
    die;
}
$r = mysql_query("SELECT name,nfo FROM torrents WHERE id={$id}") or sqlerr();
$a = mysql_fetch_assoc($r) or die("Puke");
$nfo = htmlspecialchars($a["nfo"]);
stdhead();
print "<h1>NFO for <a href=details.php?id={$id}>{$a['name']}</a></h1>\n";
print "<table border=1 cellspacing=0 cellpadding=5><tr><td class=text>\n";
print "<pre><font face='MS Linedraw' size=2 style='font-size: 10pt; line-height: 10pt'>" . format_urls($nfo) . "</font></pre>\n";
print "</td></tr></table>\n";
print "<p align=center>For best visual result, install the " . "<a href=ftp://{$_SERVER['HTTP_HOST']}/misc/linedraw.ttf>MS Linedraw</a> font!</p>\n";
stdfoot();
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:27,代码来源:viewnfo.php


示例11: format_urls

title="Strikt: Visar nfo-filen som den ser ut i teckentabellen IBM-437">
<b>Strikt DOS-vy</b></a></td>*/
?>
</tr>
<tr>
<td colspan="3">
<table border=1 cellspacing=0 cellpadding=5><tr><td class=text>
<?php 
// -- About to output NFO data
if ($view == "fonthack") {
    // Please notice: MS LineDraw's glyphs are included in the Courier New font
    // as of Courier New version 2.0, but uses the correct mappings instead.
    // http://support.microsoft.com/kb/q179422/
    print "<pre style=\"font-size:10pt; font-family: 'MS LineDraw', 'Terminal', monospace;\">";
} else {
    // IE6.0 need to know which font to use, Mozilla can figure it out in its own
    // (windows firefox at least)
    // Anything else than 'Courier New' looks pretty broken.
    // 'Lucida Console', 'FixedSys'
    print "<pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">";
}
// Writes the (eventually modified) nfo data to output, first formating urls.
print format_urls($nfo);
print "</pre>\n";
?>
</td></tr></table>
</td>
</tr>
</table>
<?php 
stdfoot();
开发者ID:CptTZ,项目名称:NexusPHP,代码行数:31,代码来源:viewnfo.php


示例12: format_comment

function format_comment($text)
{
    global $site_config, $smilies;
    $s = $text;
    $s = htmlspecialchars($s);
    $s = format_urls($s);
    // [*]
    $s = preg_replace("/\\[\\*\\]/", "<li>", $s);
    // [b]Bold[/b]
    $s = preg_replace("/\\[b\\]((\\s|.)+?)\\[\\/b\\]/", "<b>\\1</b>", $s);
    // [i]Italic[/i]
    $s = preg_replace("/\\[i\\]((\\s|.)+?)\\[\\/i\\]/", "<i>\\1</i>", $s);
    // [u]Underline[/u]
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/", "<u>\\1</u>", $s);
    // [u]Underline[/u]
    $s = preg_replace("/\\[u\\]((\\s|.)+?)\\[\\/u\\]/i", "<u>\\1</u>", $s);
    // [img]http://www/image.gif[/img]
    $s = preg_replace("/\\[img\\]((http|https):\\/\\/[^\\s'\"<>]+(\\.gif|\\.jpg|\\.png|\\.bmp|\\.jpeg))\\[\\/img\\]/i", "<img border='0' src=\"\\1\" alt='' />", $s);
    // [img=http://www/image.gif]
    $s = preg_replace("/\\[img=((http|https):\\/\\/[^\\s'\"<>]+(\\.gif|\\.jpg|\\.png|\\.bmp|\\.jpeg))\\]/i", "<img border='0' src=\"\\1\" alt='' />", $s);
    // [color=blue]Text[/color]
    $s = preg_replace("/\\[color=([a-zA-Z]+)\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color='\\1'>\\2</font>", $s);
    // [color=#ffcc99]Text[/color]
    $s = preg_replace("/\\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\\]((\\s|.)+?)\\[\\/color\\]/i", "<font color='\\1'>\\2</font>", $s);
    // [url=http://www.example.com]Text[/url]
    $s = preg_replace("/\\[url=((http|ftp|https|ftps|irc):\\/\\/[^<>\\s]+?)\\]((\\s|.)+?)\\[\\/url\\]/i", "<a href='\$1' target='_blank'>\\1</a>", $s);
    // [url]http://www.example.com[/url]
    $s = preg_replace("/\\[url\\]((http|ftp|https|ftps|irc):\\/\\/[^<>\\s]+?)\\[\\/url\\]/i", "<a href='\$3' target='_blank'>\\3</a>", $s);
    // [size=4]Text[/size]
    $s = preg_replace("/\\[size=([1-7])\\]((\\s|.)+?)\\[\\/size\\]/i", "<font size='\\1'>\\2</font>", $s);
    // [font=Arial]Text[/font]
    $s = preg_replace("/\\[font=([a-zA-Z ,]+)\\]((\\s|.)+?)\ 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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