webForumDet fria alternativet

Smileyfunktion

5 svar · 251 visningar · startad av Melea

MeleaMedlem sedan juli 20033 147 inlägg
#1

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? :OO

Tack på förhand

voigtann1Medlem sedan juni 20019 519 inlägg
#2

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?

MeleaMedlem sedan juli 20033 147 inlägg
#3

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)

aljMedlem sedan sep. 2002538 inlägg
#4

Halv fem och du har inte vaknat, kan det bero på något annat kanske? :L

jwradheMedlem sedan juni 2002711 inlägg
#5

va va det som e fel? får samma problem men hittar ingen lösning :S

PeeerMedlem sedan mars 20025 907 inlägg
#6

jwradhe skrev:

va va det som e fel? får samma problem men hittar ingen lösning :S

Finns funktionen med på sidan som du försöker anropa den ifrån?

127 ms totalt · 3 externa anrop · v20260731065814-full.0e50b1ef
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
125 ms — hämta tråd, inlägg och bilagor (db)