社区
基础编程
帖子详情
PHP如何结合UBB代码?
tonyvicky1
2003-10-18 06:36:02
请给个例子,谢谢。
...全文
81
2
打赏
收藏
PHP如何结合UBB代码?
请给个例子,谢谢。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tonyvicky1
2003-10-18
打赏
举报
回复
感谢啊。谢谢谢谢谢谢。
谢谢。
feel8
2003-10-18
打赏
举报
回复
看看ctb里的替换。。
<?php
$str = "welcome to
Csdn.Net
!";
echo ubb($str);
function ubb($msg){
$search_array = array(
"/\[code](.*)\[\/code]/isU",
"/\[quote](.*)\[\/quote]/isU",
"/\[img]([^'\"\?\&\+]*(\.gif|jpg|jpeg|png|bmp))\[\/img]/iU",
"/\[img=([^'\"\?\&\+]*(\.gif|jpg|jpeg|png|bmp))]([^'\"]*)\[\/img]/iU",
"/\[url]www.([^'\"]*)\[\/url]/iU",
"/\[url]([^'\"]*)\[\/url]/iU",
"/\[url=www.([^'\"\s]*)](.*)\[\/url]/iU",
"/\[url=([^'\"\s]*)](.*)\[\/url]/iU",
"/\[email]([^'\"\s]*)\[\/email]/iU",
"/\*)](.*)\[\/email]/iU",
"/\[b](.*)\[\/b]/isU",
"/\[i](.*)\[\/i]/isU",
"/\[u](.*)\[\/u]/isU",
"/\[size=([1-7])](.*)\[\/size]/isU",
"/\[color=(#?[\da-fA-F]{6})](.*)\[\/color]/isU",
"/\[color=([a-zA-Z]{3,20})](.*)\[\/color]/isU",
"/\[font=([^'\"]*)](.*)\[\/font]/isU",
"/\[center](.*)\[\/center]/isU",
"/\[right](.*)\[\/right]/isU",
"/\[shadow](.*)\[\/shadow]/isU",
"/\[glow](.*)\[\/glow]/isU",
"/\[fly](.*)\[\/fly]/isU",
"/\[move](.*)\[\/move]/isU",
"/\[swf]www.([^'\"\s]*)\[\/swf]/iU",
"/\[swf]([^'\"\s]*)\[\/swf]/iU",
"/\[swf width=([1-6]\d\d) height=([1-9]\d\d)]www.([^'\"\s]*)\[\/swf]/iU",
"/\[swf width=([1-6]\d\d) height=([1-9]\d\d)]([^'\"\s]*)\[\/swf]/iU",
"/\[mp]([^'\"\s]*)\[\/mp]/iU",
"/\[rp]([^'\"\s]*)\[\/rp]/iU",
);
$replace_array = array(
"<center>代码:<br /><table cellpadding=\"4\" cellspacing=\"1\" class=\"tInner\"><tr class=\"tBody2\"><td style=\"WORD-BREAK: break-all\">\\1</td></tr></table></center>",
"<center>引用:<br /><table cellpadding=\"4\" cellspacing=\"1\" class=\"tInner\"><tr class=\"tBody2\"><td style=\"WORD-BREAK: break-all\">\\1</td></tr></table></center>",
" <img src=\"\\1\" alt=\"User's Image\" onload=\"if(this.width>screen.width-750) this.width=screen.width-750;\" onmouseover=\"this.style.cursor='hand';\" onclick=\"window.open('\\1');\" /> ",
" <img src=\"\\1\" alt=\"\\3\" onload=\"if(this.width>screen.width-750) this.width=screen.width-750;\" onmouseover=\"this.style.cursor='hand';\" onclick=\"window.open('\\1');\" /> ",
"<a href=\"http://www.\\1\" target=\"_blank\">www.\\1</a>",
"<a href=\"\\1\" target=\"_blank\">\\1</a>",
"<a href=\"http://www.\\1\" target=\"_blank\">\\2</a>",
"<a href=\"\\1\" target=\"_blank\">\\2</a>",
"<a href=\"mailto:\\1\">\\1</a>",
"<a href=\"mailto:\\1\">\\2</a>",
"<b>\\1</b>",
"<i>\\1</i>",
"<u>\\1</u>",
"<font size=\"\\1\">\\2</font>",
"<font color=\"\\1\">\\2</font>",
"<font color=\"\\1\">\\2</font>",
"<font face=\"\\1\">\\2</font>",
"<center>\\1</center>",
"<div align=\"right\">\\1</div>",
"<table style=\"filter: shadow(color='#ff5555', direction='135')\"><nobr><font color=\"ffffff\">\\1</font></nobr></table>",
"<table style=\"filter: glow(color='#5555ff', strength='4')\"><nobr><font color=\"ffffff\">\\1</font></nobr></table>",
"<marquee behavior=\"alternate\">\\1</marquee>",
"<marquee>\\1</marquee>",
"<embed src=\"http://www.\\1\" width=\"400\" height=\"300\"></embed><br />",
"<embed src=\"\\1\" width=\"400\" height=\"300\"></embed><br />",
"<embed src=\"http://www.\\3\" width=\"\\1\" height=\"\\2\"></embed><br />",
"<embed src=\"\\3\" width=\"\\1\" height=\"\\2\"></embed><br />",
"<br /><object classid=\"clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6\" name=\"MediaPlayer\" codeBase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,1,5,217\" type=\"application/x-oleobject\" standby=\"Loading Microsoft Windows Media Player components...\" width=\"360\" height=\"300\"><param name=\"URL\" value=\"\\1\"><param name=\"autostart\" value=\"false\"></object><br />",
"<br /><object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" width=\"360\" height=\"240\"><param name=\"src\" value=\"\\1\"><param name=\"controls\" value=\"ImageWindow\"><param name=\"console\" value=\"console_$this->i\"><param name=\"autostart\" value=\"false\"></object><br /><object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" width=\"360\" height=\"100\"><param name=\"controls\" value=\"All\"><param name=\"console\" value=\"console_$this->i\"></object><br />",
);
$msg = preg_replace($search_array, $replace_array, $msg);
return $msg;
}
?>
UBB
代码
.rar
这是
UBB
代码
,希望您能用上,希望对你有用 欢迎下载 谢谢
PHP
100视频教程 40:
PHP
中开发自己的
UBB
代码
软件说明:1、什么是
UBB
代码
UBB
代码
是HTML的一个变种,是Ultimate Bulletin Board (国外一个BBS程序,国内也有不少地方使用这个程序)采用的一种特殊的TAG。
UBB
代码
很简单,虽然功能很少,但基本实现了我们常用的一些功能.2、
UBB
代码
运行过程3、介绍几种简单的
UBB
代码
4、写一个自己的
UBB
php
在线
ubb
编辑器
一款不错的网站
ubb
编辑器,支持
php
。方便大家进行网上留言板的开发
PHP
100视频教程 40:
PHP
中开发自己的
UBB
代码
.rar
软件介绍 软件说明: 1、什么是
UBB
代码
UBB
代码
是HTML的一个变种,是Ultimate Bulletin Board (国外一个BBS程序, 国内也有不少地方使用这个程序)采用的一种特殊的TAG。
UBB
代码
很简单, 虽然功能很少,但基本实现了我们常用的一些功能. 2、
UBB
代码
运行过程 3、介绍几种简单的
UBB
代码
4、写一个自己的
UBB
PHP
100视频教程40:
PHP
中开发自己的-
UBB
代码
.rar
PHP
100视频教程40:
PHP
中开发自己的-
UBB
代码
.rar
基础编程
21,882
社区成员
140,366
社区内容
发帖
与我相关
我的任务
基础编程
从PHP安装配置,PHP入门,PHP基础到PHP应用
复制链接
扫一扫
分享
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章