Php processes ubb functions. PhpUbb code essence * programming: Lin Jian Hyun (floating maple design room) madein Lu Feng by2007-03-07 noon QQ: 5818500 Email: linzhenxuan@163.com if you use, modify please keep the information php Ubb code essence /*
Program Design: Lin Jianxuan (floating maple design room)
Made in Lu Feng by noon
QQ: 5818500
Email: linzhenxuan@163.com
Keep this information if you use or modify it!
Function: Ubb type
Advantage: compared with normal ubb, Ubb quickly matches the corresponding html problem.
*/
Class Cls_Ubb
{
Var $ type = '';
Function _ htm ($ string)
{
If (! $ String) {return "";}
If (ereg ("<(. +) *> (. + )* ", $ String ))
{
$ String = eregi_replace ("<", "<", $ string );
$ String = eregi_replace (">", ">", $ string );
}
If (eregi ("[(/* B)]", $ string) {$ this-> type. = "1 ,";}
If (eregi ("[(/* I)]", $ string) {$ this-> type. = "2 ,";}
If (eregi ("[(/* u)]", $ string) {$ this-> type. = "3 ,";}
If (eregi ("[align = ([a-zA-Z] *)]", $ string) {$ this-> type. = "4 ,";}
If (eregi ("[fly] (. +) * [/fly]", $ string) {$ this-> type. = "5 ,";}
If (eregi ("[move] (. +) * [/move]", $ string) {$ this-> type. = "6 ,";}
If (eregi ("[light] (. +) * [/light]", $ string) {$ this-> type. = "7 ,";}
If (eregi ("[SHADOW = ([0-9] {1, 3}), ([a-zA-Z] *), ([0-9] {1,})] (. +) * [/shadow] ", $ string) {$ this-> type. = "8 ,";}
If (eregi ("[url = (. +)] (. +) [/url] ", $ string) {$ this-> type. = "9 ,";}
If (eregi ("[email] ([a-zA-Z0-9] {1,} @ ([a-zA-Z0-9] {1 ,}. [a-zA-Z0-9] {1,}) *) [/email] ", $ string) {$ this-> type. = "10 ,";}
If (eregi ("[em ([0-9] {1,})]", $ string) {$ this-> type. = "11 ,";}
If (eregi ("[img] (. +) * [/img]", $ string) {$ this-> type. = "12 ,";}
If (eregi ("[flash = * ([0-9] *), * ([0-9] *)] (. +) * [/flash] ", $ string) {$ this-> type. = "13 ,";}
If (eregi ("[mp = * ([0-9] {1, 3}), ([0-9] {1, 3})] (. +) * [/mp] ", $ string) {$ this-> type. = "14 ,";}
If (eregi ("[rm = ([0-9] {1, 3}), ([0-9] {1, 3})] (. +) * [/rm] ", $ string) {$ this-> type. = "15 ,";}
If (eregi ("[sound] (. +) * [/sound]", $ string) {$ this-> type. = "16 ,";}
If (eregi ("[code] (. +) * [/code]", $ string) {$ this-> type. = "17 ,";}
If (eregi ("[sup] (. +) * [/sup]", $ string) {$ this-> type. = "18 ,";}
If (eregi ("[sub] (. +) * [/sub]", $ string) {$ this-> type. = "19 ,";}
If (eregi ("[color = (. +) *] (. +) * [/color] ", $ string) {$ this-> type. = "20 ,";}
If (eregi ("[size = ([0-9] {1})] (. +) * [/size] ", $ string) {$ this-> type. = "21 ,";}
If ($ this-> type) {$ this-> type = substr ($ this-> type, 0, (strlen ($ this-> type)-1 ));}
Return $ string;
}
?>
Http://www.bkjia.com/PHPjc/445529.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/445529.htmlTechArticlephp Ubb code essence/* Program Design: Lin Jian Hyun (floating maple design room) made in Lu Feng by noon QQ: 5818500 Email: linzhenxuan@163.com if you use, modify please keep this information...