Hallo ik krijgt elke keer een fout melding als ik me gastenboek online opent


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

<?
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("’", "&prime;", $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;
}
?>
gebruik in plaats van include 'ubb.php'; include_once 'ubb.php';

je probeert 2 x die functie aan te roepen, terwijl bij de 2e keer die functie al bestaat.
het werkt al

Reageren