Need a little help on Flashmatazz's XML Shoutbox tut

Hey there folks,

I have a thread going on in the Flash section but it isn’t really related to Flash that much anymore. So I thought I’d ask it here since I need your advice on some xml and php oriented topics.
I was wondering if somebody could perhaps help me along with two little problems I have with the XML, PHP, Flash Shoutbox that Flashmatazz did a tutorial on.

[SIZE=2][COLOR=Navy][FONT=Verdana]http://www.kirupa.com/web/xml_guestbook.htm[/FONT][/COLOR][/SIZE]
[SIZE=1](Sorry I don’t know how to make the the link link :S)[/SIZE]

I really like the shoutbox…however, I was wondering if it is possible to censor bad language so that when someone types a bad word and submits it it looks like this for example “f**k” if you know what I mean :S
My second question is. Is it possible to use custom made smilies like on this forum? I would like to add a button that links to a small pop up where people can select a smily…just like here.

Well thanks in advance everybody. :flower:

Bad language:

use str_replace - something like this:


                       <?php                                              $xmlString                       =                        $HTTP_RAW_POST_DATA;$xmlString = str_replace($xmlString, "foo", "bar");
                         if                        (is_null($xmlString))                       {                                                  print                         "No data was sent";                                               }                        else                       {                                                  $file                         =                          fopen("guestbook.xml",                         "w+")                         or                          die("Can't                          open XML file");                          if(!fwrite($file,                         $xmlString)){                                                                            print                           "Error writing to XML-file";                                                 }                          print                         $xmlString."
";                                                  fclose($file);                                               } 
 

Where “foo” and “bar” are your bad word and replacement.

If you want to do more than one, just copy the str_replace line and put it under the other str_replace line, and change the words :slight_smile:

Thanks alot for that helpful tip.

Now all i need to tackle is the smiley part :smiley:

I guess you could also create an array of words to be censored within Flash and check against them before sending it to the PHP script.

As for the smilies: I’d have to check. I think I read that withn MX 2004 you can use IMG tags within a textfield. If that’s true then it should be possible.
I’ll look into it tomorrow.

Hey Flashmatazz, ik wist niet dat je NL’er was :lol: (translation: didn’t know you were dutch)

Relaxed man. Lot a dutchmen here :beer:

Can’t wait to here how I can fix the tagboard to show smilies :smiley: :smiley:

Thanks alot.

Hmmm, sorry man I don’t seem to be able to get it to work when loading from the XML file. :frowning:
I’ve been trying to do a string replacement but no luck thusfar.

I’m attaching the file so maybe somebody else can take a look.

btw, maybe this topic should be moved to the FMX2004 forum?

Ok well thanks for your help mate.

How do I get this topic placed over to the Flashmx forum?

a mod will have to do that.

maybe if I have some time tomorrow I’ll look into it once more 'cause I think it would be a cool feature for the guestbook.

It certainly would be a great extra for the guestbook. :slight_smile: