极乐门资源网 Design By www.ioogu.com
复制代码 代码如下:
<?php
/*
php Ubb代码编辑器
*/
function get_ubb($ubb){
$ubb=preg_replace("/([B])(.*)([/B])/","<B>\2</B>" ,$ubb);//替换B粗体字
$ubb=preg_replace("/([I])(.*)([/I])/","<I>\2</I>" ,$ubb);
$ubb=preg_replace("/([U])(.*)([/U])/","<U>\2</U>" ,$ubb);
$ubb=preg_replace("/([LEF])(.*)([/LEF])/","<div align=left>\2</div>" ,$ubb);
$ubb=preg_replace("/([MID ])(.*)([/MID ])/","<div align=center>\2</div>" ,$ubb);
$ubb=preg_replace("/([RIG])(.*)([/RIG])/","<div align=right>\2</div>" ,$ubb);
$ubb=preg_replace("/([LINK])(.*)([/LINK])/","<a href=\2>\2</a>",$ubb);
$ubb=preg_replace("/([Email])(.*)([/Email])/","<a href=mailto:\2>\2</a>",$ubb);
$ubb=preg_replace("/([IMAGE])(.*)([/IMAGE])/","<img src=\2>",$ubb);
$ubb=preg_replace("/([FLASH])(.*)([/FLASH])/","<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=400 height=400><PARAM NAME=movie VALUE="\2"><PARAM NAME=quality VALUE=high><embed src="/UploadFiles/2021-04-02/\2">$ubb=preg_replace("/([MUSIC])(.*)([/MUSIC])/","<embed src=\2 autostart=false loop=3>" ,$ubb);
$ubb=preg_replace("/([PHOTO name=)([0-9]*)(])/","<img src=Ubb_img/biaoqing/\2.gif >" ,$ubb);
$ubb=preg_replace("/([FONT=)(.{1,10})(])(.*)([/FONT])/","<div style=font:\2>\4</div>" ,$ubb);
$ubb=preg_replace("/([FONT-SIZE=)([0-9]*)(])(.*)([/FONT-SIZE])/","<div style=font-size:\2px>\4</div>" ,$ubb);
$ubb=preg_replace("/([FONT-COLOR=)(.{1,10})(])(.*)([/FONT-COLOR])/","<div style=color:\2>\4</div>" ,$ubb);
//$ubb=preg_replace("/([])(.*)([/])/","" ,$ubb);
return $ubb;
}
$str=get_ubb($_POST['cont']);
$str="<div style=font:宋体>[FONT=黑体]asdasd</div><div style=font:Georgia>asdasdas[/FONT]</div>";
echo get_ubb($str);
?>
<?php
/*
php Ubb代码编辑器
*/
function get_ubb($ubb){
$ubb=preg_replace("/([B])(.*)([/B])/","<B>\2</B>" ,$ubb);//替换B粗体字
$ubb=preg_replace("/([I])(.*)([/I])/","<I>\2</I>" ,$ubb);
$ubb=preg_replace("/([U])(.*)([/U])/","<U>\2</U>" ,$ubb);
$ubb=preg_replace("/([LEF])(.*)([/LEF])/","<div align=left>\2</div>" ,$ubb);
$ubb=preg_replace("/([MID ])(.*)([/MID ])/","<div align=center>\2</div>" ,$ubb);
$ubb=preg_replace("/([RIG])(.*)([/RIG])/","<div align=right>\2</div>" ,$ubb);
$ubb=preg_replace("/([LINK])(.*)([/LINK])/","<a href=\2>\2</a>",$ubb);
$ubb=preg_replace("/([Email])(.*)([/Email])/","<a href=mailto:\2>\2</a>",$ubb);
$ubb=preg_replace("/([IMAGE])(.*)([/IMAGE])/","<img src=\2>",$ubb);
$ubb=preg_replace("/([FLASH])(.*)([/FLASH])/","<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=400 height=400><PARAM NAME=movie VALUE="\2"><PARAM NAME=quality VALUE=high><embed src="/UploadFiles/2021-04-02/\2">$ubb=preg_replace("/([MUSIC])(.*)([/MUSIC])/","<embed src=\2 autostart=false loop=3>" ,$ubb);
$ubb=preg_replace("/([PHOTO name=)([0-9]*)(])/","<img src=Ubb_img/biaoqing/\2.gif >" ,$ubb);
$ubb=preg_replace("/([FONT=)(.{1,10})(])(.*)([/FONT])/","<div style=font:\2>\4</div>" ,$ubb);
$ubb=preg_replace("/([FONT-SIZE=)([0-9]*)(])(.*)([/FONT-SIZE])/","<div style=font-size:\2px>\4</div>" ,$ubb);
$ubb=preg_replace("/([FONT-COLOR=)(.{1,10})(])(.*)([/FONT-COLOR])/","<div style=color:\2>\4</div>" ,$ubb);
//$ubb=preg_replace("/([])(.*)([/])/","" ,$ubb);
return $ubb;
}
$str=get_ubb($_POST['cont']);
$str="<div style=font:宋体>[FONT=黑体]asdasd</div><div style=font:Georgia>asdasdas[/FONT]</div>";
echo get_ubb($str);
?>
标签:
Ubb,代码编辑器
极乐门资源网 Design By www.ioogu.com
极乐门资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
极乐门资源网 Design By www.ioogu.com
暂无php Ubb代码编辑器函数代码的评论...
更新日志
2025年01月10日
2025年01月10日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]