fout ubb scriptje
Fatal error: Cannot redeclare process() (previously declared in /home/kolk001/domains/i2web.nl/public_html/inc/ubb.php:2) in /home/kolk001/domains/i2web.nl/public_html/inc/ubb.php on line 2
dit is het ubb scriptje
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
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
<?
function process($tekst, $mode, $imgdir)
{
// UBB Parser modes :
// b : BB-Code
// h : Htmlspecialchars
// q : Quote etc
// r : Nieuwe Regels
// s : Smileys
$blocks = array();
$blocks["boldblock"] = "<b>\\1</b>";
$blocks["italicblock"] = "<i>\\1</i>";
$blocks["urlblock2"] = "<a href='\\1'>\\2</a>";
$blocks["urlblock"] = "<a href='\\1'>\\1</a>";
$blocks["googleblock"] = "<a href='http://www.google.nl/search?q=\\1'>Google : \\1</a>";
$blocks["imgblock"] = "<img src='\\1' alt='\\1' />";
$blocks["offtopicblock"] = "<span class='offtopic'><b>Offtopic :</b><br />\\1</span>";
$blocks["codeblock"] = "<table style='border: solid 1px #000000; width: 100%; overflow: auto;'><tr><th scope='row'>Code</th></tr><tr><td>\\1</td></tr></table>";
$blocks["quoteblock"] = "<table style='border: solid 1px #000000; width: 100%; overflow: auto;'><tr><th scope='row'>Quote : \\1</th></tr><tr><td>\\2</td></tr></table>";
$smileys = array();
$smileys[] = ":) - smile.gif";
$smileys[] = ":( - sad.gif";
$smileys[] = ":@ - mad.gif";
$smileys[] = ":D - biggrin.gif";
$smileys[] = ":7 - dry.gif";
$smileys[] = ":'( - cry.gif";
$smileys[] = ";) - wink.gif";
$smileys[] = ":P - tongue.gif";
$smileys[] = ":$ - blush.gif";
$smileys[] = ":') - emo.gif";
$bbcode = array();
$bbcode[] = "b - boldblock - /b";
$bbcode[] = "i - italicblock - /i";
$bbcode[] = "google - googleblock - /google";
$bbcode[] = "img - imgblock - /img";
$bbcode[] = "url=-w1- - urlblock2 - /url";
$bbcode[] = "url - urlblock - /url";
$quotecode = array();
$quotecode[] = "code - codeblock - /code";
$quotecode[] = "quote=-w1- - quoteblock - /quote";
$quotecode[] = "off - offtopicblock - /off";
$quotecode[] = "offtopic - offtopicblock - /offtopic";
$mode = explode("-",$mode);
if(in_array("h", $mode)) {
$tekst = htmlspecialchars($tekst);
$tekst = str_replace("’", "′", $tekst);
$tekst = str_replace("“", "\"", $tekst);
$tekst = str_replace("”", "\"", $tekst);
}
if(in_array("r", $mode)) {
$tekst = nl2br($tekst);
}
if(in_array("b", $mode)) {
for($i=0;$i < count($bbcode);$i++) {
$temp = explode(" - ", $bbcode[$i]);
if(eregi("-w1-", $temp[0])) {
$temp2 = str_replace("-w1-", "(.*?)", $temp[0]);
$tekst = preg_replace("/\[".$temp2."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
else
{
$tekst = preg_replace("/\[".$temp[0]."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
}
}
if(in_array("q", $mode)) {
for($i=0;$i < count($quotecode);$i++) {
$temp = explode(" - ", $quotecode[$i]);
if(eregi("-w1-", $temp[0])) {
$temp2 = str_replace("-w1-", "(.*?)", $temp[0]);
$tekst = preg_replace("/\[".$temp2."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
else
{
$tekst = preg_replace("/\[".$temp[0]."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
}
}
if(in_array("s", $mode)) {
for($i=0;$i < count($smileys);$i++) {
$temp = explode(" - ",$smileys[$i]);
$tekst = str_replace($temp[0],"<img src='".$imgdir."smileys/".$temp[1]."' alt='smiley' />", $tekst);
}
}
return $tekst;
}
?>
function process($tekst, $mode, $imgdir)
{
// UBB Parser modes :
// b : BB-Code
// h : Htmlspecialchars
// q : Quote etc
// r : Nieuwe Regels
// s : Smileys
$blocks = array();
$blocks["boldblock"] = "<b>\\1</b>";
$blocks["italicblock"] = "<i>\\1</i>";
$blocks["urlblock2"] = "<a href='\\1'>\\2</a>";
$blocks["urlblock"] = "<a href='\\1'>\\1</a>";
$blocks["googleblock"] = "<a href='http://www.google.nl/search?q=\\1'>Google : \\1</a>";
$blocks["imgblock"] = "<img src='\\1' alt='\\1' />";
$blocks["offtopicblock"] = "<span class='offtopic'><b>Offtopic :</b><br />\\1</span>";
$blocks["codeblock"] = "<table style='border: solid 1px #000000; width: 100%; overflow: auto;'><tr><th scope='row'>Code</th></tr><tr><td>\\1</td></tr></table>";
$blocks["quoteblock"] = "<table style='border: solid 1px #000000; width: 100%; overflow: auto;'><tr><th scope='row'>Quote : \\1</th></tr><tr><td>\\2</td></tr></table>";
$smileys = array();
$smileys[] = ":) - smile.gif";
$smileys[] = ":( - sad.gif";
$smileys[] = ":@ - mad.gif";
$smileys[] = ":D - biggrin.gif";
$smileys[] = ":7 - dry.gif";
$smileys[] = ":'( - cry.gif";
$smileys[] = ";) - wink.gif";
$smileys[] = ":P - tongue.gif";
$smileys[] = ":$ - blush.gif";
$smileys[] = ":') - emo.gif";
$bbcode = array();
$bbcode[] = "b - boldblock - /b";
$bbcode[] = "i - italicblock - /i";
$bbcode[] = "google - googleblock - /google";
$bbcode[] = "img - imgblock - /img";
$bbcode[] = "url=-w1- - urlblock2 - /url";
$bbcode[] = "url - urlblock - /url";
$quotecode = array();
$quotecode[] = "code - codeblock - /code";
$quotecode[] = "quote=-w1- - quoteblock - /quote";
$quotecode[] = "off - offtopicblock - /off";
$quotecode[] = "offtopic - offtopicblock - /offtopic";
$mode = explode("-",$mode);
if(in_array("h", $mode)) {
$tekst = htmlspecialchars($tekst);
$tekst = str_replace("’", "′", $tekst);
$tekst = str_replace("“", "\"", $tekst);
$tekst = str_replace("”", "\"", $tekst);
}
if(in_array("r", $mode)) {
$tekst = nl2br($tekst);
}
if(in_array("b", $mode)) {
for($i=0;$i < count($bbcode);$i++) {
$temp = explode(" - ", $bbcode[$i]);
if(eregi("-w1-", $temp[0])) {
$temp2 = str_replace("-w1-", "(.*?)", $temp[0]);
$tekst = preg_replace("/\[".$temp2."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
else
{
$tekst = preg_replace("/\[".$temp[0]."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
}
}
if(in_array("q", $mode)) {
for($i=0;$i < count($quotecode);$i++) {
$temp = explode(" - ", $quotecode[$i]);
if(eregi("-w1-", $temp[0])) {
$temp2 = str_replace("-w1-", "(.*?)", $temp[0]);
$tekst = preg_replace("/\[".$temp2."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
else
{
$tekst = preg_replace("/\[".$temp[0]."\](.*?)\[\\".$temp[2]."\]/", $blocks[$temp[1]], $tekst);
}
}
}
if(in_array("s", $mode)) {
for($i=0;$i < count($smileys);$i++) {
$temp = explode(" - ",$smileys[$i]);
$tekst = str_replace($temp[0],"<img src='".$imgdir."smileys/".$temp[1]."' alt='smiley' />", $tekst);
}
}
return $tekst;
}
?>
je probeert 2 x die functie aan te roepen, terwijl bij de 2e keer die functie al bestaat.
het werkt al