Smileys berichtenbalk?

Pagina: 1
Acties:
  • 82 views sinds 30-01-2008

  • Rax
  • Registratie: Januari 2003
  • Laatst online: 17-08 02:57

Rax

Webdevver

Topicstarter
Hallo allemaal,

Ik heb sinds kort een berichtenbalk met smileys, probleem: de smilys werken net: in plaats van een smiley komt er te staan: <img src=http://www.all4mobile.net/balkie/... Dit komt dus door het "anti-html" van php.
Hier is het script van de balk:
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
 <html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?
$bericht = str_replace(":@","[img]http://www.all4mobile.net/balkie/smiley/angry.gif[/img]",$bericht); 
$bericht = str_replace(":D","[img]http://www.all4mobile.net/balkie/smiley/bigsmile.gif[/img]",$bericht); 
$bericht = str_replace(":s","[img]http://www.all4mobile.net/balkie/smiley/confused.gif[/img]",$bericht); 
$bericht = str_replace(";(","[img]http://www.all4mobile.net/balkie/smiley/cry.gif[/img]",$bericht); 
$bericht = str_replace(":)","[img]http://www.all4mobile.net/balkie/smiley/happy.gif[/img]",$bericht); 
$bericht = str_replace(":(","[img]http://www.all4mobile.net/balkie/smiley/sad.gif[/img]",$bericht); 
$bericht = str_replace(":|","[img]http://www.all4mobile.net/balkie/smiley/shock.gif[/img]",$bericht); 
$bericht = str_replace(":p","[img]http://www.all4mobile.net/balkie/smiley/tongue.gif[/img]",$bericht); 
$bericht = str_replace(";)","[img]http://www.all4mobile.net/balkie/smiley/wink.gif[/img]",$bericht); 
?>
<?
//Anti-HTML 
$naam = htmlspecialchars($naam); 
$url = htmlspecialchars($url); 
$bericht = htmlspecialchars($bericht); 

$schijding = "  : : :  ";   
$data = "data.inc";   
$file = fopen($data, "a+");   
fputs($file, '<?php echo "$schijding <a href=$url target=_blank>$naam</a>: $bericht" ?>');   
fclose($file);   
echo "Je bericht is succesvol toegevoegt!! 
<a href=index.php>Go-back</a>";   
?>
</body>
</html>


Weet iemand toevallig hoe ik dus de afbeelding sources zo kan schrijven in php dat de smiley worden weergeven in plaats van de tekst...?

  • whoami
  • Registratie: December 2000
  • Laatst online: 23:02
Tekst controleren, als er een 'text-smiley' in voorkomt, die smiley verwijderen en vervangen door een afbeelding.

https://fgheysels.github.io/


  • Ericston
  • Registratie: Maart 2001
  • Laatst online: 05-08 18:36
Eerst "anti-html" en dan pas smilies replacen?

  • eamelink
  • Registratie: Juni 2001
  • Niet online

eamelink

Droptikkels

whoami, als je het nou eens leest ;) :P

Je moet die smiley code _onder_ de htmlspecialchars() zetten, dan werkt het :)

  • whoami
  • Registratie: December 2000
  • Laatst online: 23:02
eamelink schreef op 30 March 2003 @ 22:20:
whoami, als je het nou eens leest ;) :P

Je moet die smiley code _onder_ de htmlspecialchars() zetten, dan werkt het :)


:+
Euh.
Ik ben een beetje lui vandaag. 8)7

https://fgheysels.github.io/


  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

Zoek en nadenkwerk

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz

Pagina: 1

Dit topic is gesloten.