ubbc-codes
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/* Ik kan hier niet alle scripts neerzetten, het 'script' bevat namelijk ook nog het één en ander aan HTML, plaatjes en JavaScript. Het is werkend te zien op http://fratsloos.nl/phphulp/UBBC/.
Verder staat niet het hele script van ubbc.php hier, want die is best groot. Het hele script staat natuurlijk wel op de download.
Als laatse heb ik ook niet de code van alle smilyes gedaan, maar slechts 3, toch allemaal hetzelfde...*/
// UBBC.PHP
// Enters V
$bericht = str_replace ("[br]","\n",$bericht);
$bericht = str_replace ("\n","<br>",$bericht);
// Code V
$bericht = str_replace ("","<b>Code:</b><br /><table bgcolor=\"#000000\" cellspacing=\"1\" width=\"90%\"><tr><td><table cellpadding=2 cellspacing=\"0\" bgcolor=\"#FFFFFF\" width=\"100%\"><tr><td><font face=Courier size=\"1\" color=\"#000000\">", $bericht);
$bericht = str_replace ("", "</font></td></tr></table></td></tr></table>", $bericht);
// Vet, schuin, etc V
$bericht = preg_replace("/\[b\](.+?)\[\/b\]/is",'<strong>\1</strong>', $bericht);
$bericht = preg_replace("/\[i\](.+?)\[\/i\]/is",'<em>\1</em>', $bericht);
$bericht = preg_replace("/\[u\](.+?)\[\/u\]/is",'<u>\1</u>', $bericht);
$bericht = preg_replace("/\[s\](.+?)\[\/s\]/is",'<s>\1</s>', $bericht);
// Marquee
$bericht = str_replace ("[move]", "<div align=\"center\"><marquee width=\"90%\">", $bericht);
$bericht = str_replace ("[/move]", "</marquee></div>", $bericht);
// Color, font & size V
$bericht = preg_replace ("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "<font color=\"\\1\">\\2</font>", $bericht);
$bericht = preg_replace ("/\[font=(.*)\](.*)\[\/font\]/", "<font face=\"$1\">$2</font>", $bericht);
$bericht = preg_replace ("/\[size=(.*)\](.*)\[\/size\]/", "<font size=\"$1\">$2</font>", $bericht);
// Plaatje toevoegen V
$bericht = preg_replace("/\[img\](.*?)\[\/img\]/si", "<img src=\"\\1\" border=\"0\">",$bericht);
// Diversen V
$bericht = str_replace ("[tt]", "<tt>", $bericht);
$bericht = str_replace ("[/tt]", "</tt>", $bericht);
$bericht = str_replace ("[left]", "<div align=left>", $bericht);
$bericht = str_replace ("[/left]", "</div>", $bericht);
$bericht = str_replace ("[center]", "<div align=\"center\">", $bericht);
$bericht = str_replace ("[/center]", "</div>", $bericht);
$bericht = str_replace ("[right]", "<div align=\"right\">", $bericht);
$bericht = str_replace ("[/right]", "</div>", $bericht);
$bericht = str_replace ("[sub]", "<sub>", $bericht);
$bericht = str_replace ("[/sub]", "</sub>", $bericht);
$bericht = str_replace ("[sup]", "<sup>", $bericht);
$bericht = str_replace ("[/sup]", "</sup>", $bericht);
$bericht = str_replace ("[fixed]", "<font face=\"Courier New\">", $bericht);
$bericht = str_replace ("[/fixed]", "</font>", $bericht);
$bericht = str_replace ("[[","{{",$bericht);
$bericht = str_replace ("]]","}}",$bericht);
$bericht = str_replace ("|","|",$bericht);
$bericht = str_replace ("[pre]","<pre>",$bericht);
$bericht = str_replace ("[/pre]","</pre>",$bericht);
$bericht = str_replace ("{{","[",$bericht);
$bericht = str_replace ("}}","]",$bericht);
// Horizontale lijn V
$bericht = str_replace ("[hr]","<hr color=\"#000000\" noshade />",$bericht);
// Lijst V
$bericht = str_replace ("[list]","<ul>",$bericht);
$bericht = str_replace ("[*]","<li>",$bericht);
$bericht = str_replace ("[/list]","</li></ul>",$bericht);
// Tabel V
$bericht = str_replace ("[table]","<table class=\"main\">",$bericht);
$bericht = str_replace ("[/table]","</table>",$bericht);
$bericht = str_replace ("[tr]","<tr>",$bericht);
$bericht = str_replace ("[/tr]","</tr>",$bericht);
$bericht = str_replace ("[td]","<td>",$bericht);
$bericht = str_replace ("[/td]","</td>",$bericht);
// Smiley's V
// Roll Eyes
$bericht = str_replace ("::)","<img src=\"img/ubbc/rolleyes.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("[rolleyes]","<img src=\"img/ubbc/rolleyes.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("::-)","<img src=\"img/ubbc/rolleyes.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
// Smile
$bericht = str_replace (":)","<img src=\"img/ubbc/smiley.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("[smile]","<img src=\"img/ubbc/smiley.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace (":-)","<img src=\"img/ubbc/smiley.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
// Wink
$bericht = str_replace (";)","<img src=\"img/ubbc/wink.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("[wink]","<img src=\"img/ubbc/wink.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace (";-)","<img src=\"img/ubbc/wink.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
?>
/* Ik kan hier niet alle scripts neerzetten, het 'script' bevat namelijk ook nog het één en ander aan HTML, plaatjes en JavaScript. Het is werkend te zien op http://fratsloos.nl/phphulp/UBBC/.
Verder staat niet het hele script van ubbc.php hier, want die is best groot. Het hele script staat natuurlijk wel op de download.
Als laatse heb ik ook niet de code van alle smilyes gedaan, maar slechts 3, toch allemaal hetzelfde...*/
// UBBC.PHP
// Enters V
$bericht = str_replace ("[br]","\n",$bericht);
$bericht = str_replace ("\n","<br>",$bericht);
// Code V
$bericht = str_replace ("","<b>Code:</b><br /><table bgcolor=\"#000000\" cellspacing=\"1\" width=\"90%\"><tr><td><table cellpadding=2 cellspacing=\"0\" bgcolor=\"#FFFFFF\" width=\"100%\"><tr><td><font face=Courier size=\"1\" color=\"#000000\">", $bericht);
$bericht = str_replace ("", "</font></td></tr></table></td></tr></table>", $bericht);
// Vet, schuin, etc V
$bericht = preg_replace("/\[b\](.+?)\[\/b\]/is",'<strong>\1</strong>', $bericht);
$bericht = preg_replace("/\[i\](.+?)\[\/i\]/is",'<em>\1</em>', $bericht);
$bericht = preg_replace("/\[u\](.+?)\[\/u\]/is",'<u>\1</u>', $bericht);
$bericht = preg_replace("/\[s\](.+?)\[\/s\]/is",'<s>\1</s>', $bericht);
// Marquee
$bericht = str_replace ("[move]", "<div align=\"center\"><marquee width=\"90%\">", $bericht);
$bericht = str_replace ("[/move]", "</marquee></div>", $bericht);
// Color, font & size V
$bericht = preg_replace ("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "<font color=\"\\1\">\\2</font>", $bericht);
$bericht = preg_replace ("/\[font=(.*)\](.*)\[\/font\]/", "<font face=\"$1\">$2</font>", $bericht);
$bericht = preg_replace ("/\[size=(.*)\](.*)\[\/size\]/", "<font size=\"$1\">$2</font>", $bericht);
// Plaatje toevoegen V
$bericht = preg_replace("/\[img\](.*?)\[\/img\]/si", "<img src=\"\\1\" border=\"0\">",$bericht);
// Diversen V
$bericht = str_replace ("[tt]", "<tt>", $bericht);
$bericht = str_replace ("[/tt]", "</tt>", $bericht);
$bericht = str_replace ("[left]", "<div align=left>", $bericht);
$bericht = str_replace ("[/left]", "</div>", $bericht);
$bericht = str_replace ("[center]", "<div align=\"center\">", $bericht);
$bericht = str_replace ("[/center]", "</div>", $bericht);
$bericht = str_replace ("[right]", "<div align=\"right\">", $bericht);
$bericht = str_replace ("[/right]", "</div>", $bericht);
$bericht = str_replace ("[sub]", "<sub>", $bericht);
$bericht = str_replace ("[/sub]", "</sub>", $bericht);
$bericht = str_replace ("[sup]", "<sup>", $bericht);
$bericht = str_replace ("[/sup]", "</sup>", $bericht);
$bericht = str_replace ("[fixed]", "<font face=\"Courier New\">", $bericht);
$bericht = str_replace ("[/fixed]", "</font>", $bericht);
$bericht = str_replace ("[[","{{",$bericht);
$bericht = str_replace ("]]","}}",$bericht);
$bericht = str_replace ("|","|",$bericht);
$bericht = str_replace ("[pre]","<pre>",$bericht);
$bericht = str_replace ("[/pre]","</pre>",$bericht);
$bericht = str_replace ("{{","[",$bericht);
$bericht = str_replace ("}}","]",$bericht);
// Horizontale lijn V
$bericht = str_replace ("[hr]","<hr color=\"#000000\" noshade />",$bericht);
// Lijst V
$bericht = str_replace ("[list]","<ul>",$bericht);
$bericht = str_replace ("[*]","<li>",$bericht);
$bericht = str_replace ("[/list]","</li></ul>",$bericht);
// Tabel V
$bericht = str_replace ("[table]","<table class=\"main\">",$bericht);
$bericht = str_replace ("[/table]","</table>",$bericht);
$bericht = str_replace ("[tr]","<tr>",$bericht);
$bericht = str_replace ("[/tr]","</tr>",$bericht);
$bericht = str_replace ("[td]","<td>",$bericht);
$bericht = str_replace ("[/td]","</td>",$bericht);
// Smiley's V
// Roll Eyes
$bericht = str_replace ("::)","<img src=\"img/ubbc/rolleyes.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("[rolleyes]","<img src=\"img/ubbc/rolleyes.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("::-)","<img src=\"img/ubbc/rolleyes.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
// Smile
$bericht = str_replace (":)","<img src=\"img/ubbc/smiley.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("[smile]","<img src=\"img/ubbc/smiley.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace (":-)","<img src=\"img/ubbc/smiley.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
// Wink
$bericht = str_replace (";)","<img src=\"img/ubbc/wink.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace ("[wink]","<img src=\"img/ubbc/wink.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
$bericht = str_replace (";-)","<img src=\"img/ubbc/wink.gif\" width=\"15\" height=\"15\" border=\"0\">",$bericht);
?>