ubb.php
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function ubb($bericht)
{
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = htmlspecialchars("$bericht");
$bericht = stripslashes($bericht);
$bericht = nl2br("$bericht");
// Hier begint het code systeem
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[s]", "<small>", $bericht);
$bericht = str_replace("[/s]", "</small>", $bericht);
$bericht = str_replace("[quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font color=\"#000000\">", $bericht);
$bericht = str_replace("[/quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\" target=_blank>", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" target=\"_blank\">\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
//ubb codes
$bericht = eregi_replace("\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]","<font color=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]","<font size=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[font=([^\\[]*)\\]([^\\[]*)\\[/font\\]","<font face=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[img height=([^\\[]*)\\ width=([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$bericht);
$bericht = eregi_replace("\\[img]([^\\[]*)\\[/img\\]","<img src=\"\\1\">",$bericht);
$bericht = eregi_replace("\\[flash=([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/flash\\]","<object classid=\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$bericht);
$bericht = eregi_replace("\\[align=([^\\[]*)\\]([^\\[]*)\\[/align\\]","<p align=\"\\1\">\\2</p>",$bericht);
$bericht = eregi_replace("\\[shadow=([^\\[]*)\\,([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/shadow\\]","<font style=\"Filter: Shadow(color=\\1, Direction=\\2); Width=\\3px;\">\\4</font>",$bericht);
$bericht = eregi_replace("\\[glow=([^\\[]*)\\,([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/glow\\]","<font style=\"Filter: Glow(color=\\1, Strength=\\2); Width=\\3px;\">\\4</font>",$bericht);
$bericht = eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]", "<a href=\"http://www.\\1\" target=_blank>\\1</a>",$bericht);
$bericht = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\1</a>",$bericht);
$bericht = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\2</a>",$bericht);
$bericht = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)","\\1<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>\\5",$bericht);
$bericht = str_replace("[b]", "<b>",$bericht);
$bericht = str_replace("[/b]","</b>",$bericht);
$bericht = str_replace("[i]","<i>",$bericht);
$bericht = str_replace("[/i]","</i>",$bericht);
$bericht = str_replace("[u]","<u>",$bericht);
$bericht = str_replace("[/u]","</u>",$bericht);
$bericht = str_replace(":)","<img src=\"smilies/smile.gif\">",$bericht);
$bericht = str_replace(":(","<img src=\"smilies/mad.gif\">",$bericht);
$bericht = str_replace(":'(","<img src=\"smilies/cry.gif\">",$bericht);
$bericht = str_replace(";)","<img src=\"smilies/knipoog.gif\">",$bericht);
$bericht = str_replace(":D","<img src=\"smilies/biggrin.gif\">",$bericht);
$bericht = str_replace(":S","<img src=\"smilies/verbaasd.gif\">",$bericht);
$bericht = str_replace(":P","<img src=\"smilies/tongue.gif\">",$bericht);
$bericht = str_replace(":nerd:","<img src=\"smilies/nerd.gif\">",$bericht);
$bericht = str_replace(":cool:","<img src=\"smilies/cool.gif\">",$bericht);
$bericht = str_replace("9:6","<img src=\"smilies/worshippy.gif\">",$bericht);
$bericht = str_replace(":evil:","<img src=\"smilies/evil.gif\">",$bericht);
$bericht = str_replace(":vinger:","<img src=\"smilies/vinger.gif\">",$bericht);
$bericht = str_replace(":lijst:","<img src=\"smilies/lijstje.gif\">",$bericht);
$bericht = str_replace(":bier:","<img src=\"smilies/bier.gif\">",$bericht);
$bericht = str_replace(":king:","<img src=\"smilies/koning.gif\">",$bericht);
$bericht = str_replace(":koffie:","<img src=\"smilies/koffie.gif\">",$bericht);
$bericht = str_replace("|:/","<img src=\"smilies/professor.gif\">",$bericht);
$bericht = str_replace(":trek:","<img src=\"smilies/naamloos.bmp\">",$bericht);
$bericht = str_replace(":gangerstar:","<img src=\"smilies/gun.gif\">",$bericht);
$bericht = str_replace(":shoot:","<img src=\"smilies/schooting.gif\">",$bericht);
return $bericht;
}
?>
function italic($code) {
$code = "<i>".$code."</i>";
return $code;
}
function bold($code) {
$code = "<b>".$code."</b>";
return $code;
}
function underlined($code) {
$code = "<u>".$code."</u>";
return $code;
}
function ubb($bericht)
{
$kleur1 = "#EAF0FA";
$kleur2 = "#F7F7F7";
$borderkleur = "#D3D3D3";
$bericht = htmlspecialchars("$bericht");
$bericht = stripslashes($bericht);
$bericht = nl2br("$bericht");
// Hier begint het code systeem
$bericht = str_replace("[center]", "<center>", $bericht);
$bericht = str_replace("[/center]", "</center>", $bericht);
$bericht = str_replace("[s]", "<small>", $bericht);
$bericht = str_replace("[/s]", "</small>", $bericht);
$bericht = str_replace("[quote]", "<small>Quote:</small><br><table width=\"100%\" bgcolor=\"$kleur1\" style=\"BORDER-RIGHT: $borderkleur 2px solid; BORDER-TOP: $borderkleur 1px solid; BORDER-BOTTOM: $borderkleur 2px solid; BORDER-LEFT: $borderkleur 1px solid\" cellspacing=\"0\" cellpadding=\"1\"><tr><td><font color=\"#000000\">", $bericht);
$bericht = str_replace("[/quote]", "</font></td></tr></table>", $bericht);
$bericht = str_replace("[ul]", "<ul>", $bericht);
$bericht = str_replace("[/ul]", "</ul>", $bericht);
$bericht = str_replace("[li]", "<li>", $bericht);
$bericht = str_replace("[/li]", "</li>", $bericht);
//$bericht = eregi_replace("http://[^[:space:]]+","<a href=\"\\0\" target=\"_blank\">\\0</a>",$bericht);
$bericht = eregi_replace("([a-zA-Z0-9_-]+)@([a-zA-Z0-9\._-]+)(\.[a-zA-Z]+)", "<a href=\"mailto:\\1@\\2\\3\">\\1@\\2\\3</a>", $bericht);
$bericht = preg_replace('_\[i\](.*?)\[/i\]_ise', "italic(' \\1 ')", $bericht);
$bericht = preg_replace('_\[b\](.*?)\[/b\]_ise', "bold(' \\1 ')", $bericht);
$bericht = preg_replace('_\[u\](.*?)\[/u\]_ise', "underlined(' \\1 ')", $bericht);
$bericht = str_replace("[img]","<img src=\"http://",$bericht);
$bericht = str_replace("[/img]","\">",$bericht);
$bericht = eregi_replace("\[url\]www.([^\[]*)","<a href=\"http://www.\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("\[url\]([^\[]*)","<a href=\"\\1\" target=_blank>\\1", $bericht);
$bericht = eregi_replace("(\[url=)([A-Za-z0-9_~&=;\?:%@#./\-]+[A-Za-z0-9/])(\])", "<a href=\"http://\\2\" target=_blank>", $bericht);
$bericht = eregi_replace("\[url](http://(.*))", "<a href=\"\\1\" target=\"_blank\">\\1", $bericht);
$bericht = eregi_replace("(\[/url\])", "</a>", $bericht);
$bericht = str_replace("http://http://", "http://", $bericht);
//ubb codes
$bericht = eregi_replace("\\[color=([^\\[]*)\\]([^\\[]*)\\[/color\\]","<font color=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[size=([^\\[]*)\\]([^\\[]*)\\[/size\\]","<font size=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[font=([^\\[]*)\\]([^\\[]*)\\[/font\\]","<font face=\"\\1\">\\2</font>",$bericht);
$bericht = eregi_replace("\\[img height=([^\\[]*)\\ width=([^\\[]*)\\]([^\\[]*)\\[/img\\]","<img src=\"\\3\" height=\"\\1\" width=\"\\2\">",$bericht);
$bericht = eregi_replace("\\[img]([^\\[]*)\\[/img\\]","<img src=\"\\1\">",$bericht);
$bericht = eregi_replace("\\[flash=([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/flash\\]","<object classid=\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",$bericht);
$bericht = eregi_replace("\\[align=([^\\[]*)\\]([^\\[]*)\\[/align\\]","<p align=\"\\1\">\\2</p>",$bericht);
$bericht = eregi_replace("\\[shadow=([^\\[]*)\\,([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/shadow\\]","<font style=\"Filter: Shadow(color=\\1, Direction=\\2); Width=\\3px;\">\\4</font>",$bericht);
$bericht = eregi_replace("\\[glow=([^\\[]*)\\,([^\\[]*)\\,([^\\[]*)\\]([^\\[]*)\\[/glow\\]","<font style=\"Filter: Glow(color=\\1, Strength=\\2); Width=\\3px;\">\\4</font>",$bericht);
$bericht = eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]", "<a href=\"http://www.\\1\" target=_blank>\\1</a>",$bericht);
$bericht = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\1</a>",$bericht);
$bericht = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\2</a>",$bericht);
$bericht = eregi_replace("(^|[>[:space:]\n])([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])([<[:space:]\n]|$)","\\1<a href=\"\\2://\\3\\4\" target=\"_blank\">\\2://\\3\\4</a>\\5",$bericht);
$bericht = str_replace("[b]", "<b>",$bericht);
$bericht = str_replace("[/b]","</b>",$bericht);
$bericht = str_replace("[i]","<i>",$bericht);
$bericht = str_replace("[/i]","</i>",$bericht);
$bericht = str_replace("[u]","<u>",$bericht);
$bericht = str_replace("[/u]","</u>",$bericht);
$bericht = str_replace(":)","<img src=\"smilies/smile.gif\">",$bericht);
$bericht = str_replace(":(","<img src=\"smilies/mad.gif\">",$bericht);
$bericht = str_replace(":'(","<img src=\"smilies/cry.gif\">",$bericht);
$bericht = str_replace(";)","<img src=\"smilies/knipoog.gif\">",$bericht);
$bericht = str_replace(":D","<img src=\"smilies/biggrin.gif\">",$bericht);
$bericht = str_replace(":S","<img src=\"smilies/verbaasd.gif\">",$bericht);
$bericht = str_replace(":P","<img src=\"smilies/tongue.gif\">",$bericht);
$bericht = str_replace(":nerd:","<img src=\"smilies/nerd.gif\">",$bericht);
$bericht = str_replace(":cool:","<img src=\"smilies/cool.gif\">",$bericht);
$bericht = str_replace("9:6","<img src=\"smilies/worshippy.gif\">",$bericht);
$bericht = str_replace(":evil:","<img src=\"smilies/evil.gif\">",$bericht);
$bericht = str_replace(":vinger:","<img src=\"smilies/vinger.gif\">",$bericht);
$bericht = str_replace(":lijst:","<img src=\"smilies/lijstje.gif\">",$bericht);
$bericht = str_replace(":bier:","<img src=\"smilies/bier.gif\">",$bericht);
$bericht = str_replace(":king:","<img src=\"smilies/koning.gif\">",$bericht);
$bericht = str_replace(":koffie:","<img src=\"smilies/koffie.gif\">",$bericht);
$bericht = str_replace("|:/","<img src=\"smilies/professor.gif\">",$bericht);
$bericht = str_replace(":trek:","<img src=\"smilies/naamloos.bmp\">",$bericht);
$bericht = str_replace(":gangerstar:","<img src=\"smilies/gun.gif\">",$bericht);
$bericht = str_replace(":shoot:","<img src=\"smilies/schooting.gif\">",$bericht);
return $bericht;
}
?>
Gewijzigd op 19/05/2005 21:43:00 door Hebogirl
<option>Keuze 1</opion>
<option>Keuze 2</opion>
<option>Keuze 3</opion>
</select>
En dan een javascript dat de boel afhandeld.
ja en waar vindt ik die
hier zal er wel eentje tussen staan. Je kan het evt. ook wel met php doen, nadeel is dan alleen dat de pagina steeds ververst moet worden bij het invoegen.
edit:
Met een beetje aanpassen kun je dit ook wel gebruiken.
edit:
Met een beetje aanpassen kun je dit ook wel gebruiken.
Gewijzigd op 19/05/2005 20:54:00 door Winston Smith
ik snap er niks van !!!
ja maar hoe krijg ik het werkend ik ben niet zo goed in php
document.text.text.value += " "+theicon;
document.text.text;
}
<select>
<option selected>Keuze:</option>
<option onClick="javascript:icon('[left] [/left]')">Links</option>
<option onClick="javascript:icon('[center] [/center]')">Midden</option>
<option onClick="javascript:icon('[right] [/right]')">Rechts</option>
<option onClick="javascript:icon('[justify] [/justify]')">Uitvullen</option>
</select>
bron
en dat moet ik dus toevoegen aan ubb.php en dan moet ie het doen :$
wie kan me dat aub ff snel in elkaar zetten ik snap er werkelijk waar niks meer van !