varför?:
$returnthis = str_replace(":(", "<img src='img/frown.gif'>", [b]$buffer[/b]);
$returnthis = str_replace(":)", "<img src='img/smile.gif'>", [b]$returnthis[/b]);
Du kör två olika saker på det?
5 svar · 260 visningar · startad av Melea
Hejsan!
Försöker bygga en smileyfunktion men får det inte riktigt att funka... får felmeddelandet
Call to undefined function: smiley()
Såhär ser koden ut
function smiley($buffer) {
$returnthis = str_replace(":(", "<img src='img/frown.gif'>", $buffer);
$returnthis = str_replace(":)", "<img src='img/smile.gif'>", $returnthis);
$returnthis = str_replace(";)", "<img src='img/wink.gif'>", $returnthis);
$returnthis = str_replace(":$", "<img src='img/shame.gif'>", $returnthis);
$returnthis = str_replace(":x", "<img src='img/angry.gif'>", $returnthis);
$returnthis = str_replace(":beer:", "<img src='img/beergrin.gif'>", $returnthis);
$returnthis = str_replace(":beer2:", "<img src='img/bire.gif'>", $returnthis);
$returnthis = str_replace("8)", "<img src='img/cool.gif'>", $returnthis);
$returnthis = str_replace("x(", "<img src='img/dead.gif'>", $returnthis);
$returnthis = str_replace("(6)", "<img src='img/devel.gif'>", $returnthis);
$returnthis = str_replace(":D", "<img src='img/supergrin.gif'>", $returnthis);
$returnthis = str_replace(":flirt:", "<img src='img/dead.gif'>", $returnthis);
$returnthis = str_replace(":/", "<img src='img/dead.gif'>", $returnthis);
$returnthis = str_replace(":idea:", "<img src='img/dead.gif'>", $returnthis);
$returnthis = str_replace(":DD", "<img src='img/laugh.gif'>", $returnthis);
$returnthis = str_replace(":oo", "<img src='img/look.gif'>", $returnthis);
$returnthis = str_replace(":?", "<img src='img/quest.gif'>", $returnthis);
$returnthis = str_replace(":stud:", "<img src='img/stud.gif'>", $returnthis);
$returnthis = str_replace(":P", "<img src='img/tongue.gif'>", $returnthis);
return ($returnthis);
}
while ($result = mysql_fetch_array($results)) {
print smiley(nl2br($result['forumpost']));
}
Vad är det jag har missat?
Tack på förhand
varför?:
$returnthis = str_replace(":(", "<img src='img/frown.gif'>", [b]$buffer[/b]);
$returnthis = str_replace(":)", "<img src='img/smile.gif'>", [b]$returnthis[/b]);
Du kör två olika saker på det?
Jo vi kan ta och stryka det här inlägget eftersom det är ett stort skämt! Som vanligt postar jag inlägg innan jag ens vaknat
Tack för ert tålamod!
Mvh // Melea (ute på vift)
Halv fem och du har inte vaknat, kan det bero på något annat kanske?
va va det som e fel? får samma problem men hittar ingen lösning
jwradhe skrev:
va va det som e fel? får samma problem men hittar ingen lösning
Finns funktionen med på sidan som du försöker anropa den ifrån?