Topic: Troubles adding emoticons

I began editing parser.php and adding the new emoticons...
Here is the full emoticon code line:

$smilies = array(':)' => 'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png', '=|' => 'neutral.png', ':(' => 'sad.png', '=(' => 'sad.png', ':D' => 'big_smile.png', '=D' => 'big_smile.png', ':o' => 'yikes.png', ':O' => 'yikes.png', ';)' => 'wink.png', ':/' => 'hmm.png', ':P' => 'tongue.png', ':p' => 'tongue.png', ':lol:' => 'lol.png', ':mad:' => 'mad.png', ':rolleyes:' => 'roll.png', ':cool:' => 'cool.png' ':'(' => 'cry.gif', ':s' => 's.gif', ':$' => 'dollars.gif', ':@' => 'angry.png' '(h)' => 'hot.gif' 'o.O' => 'o.o.gif' 'O.O' => 'O.Obig.gif' ':woot:' => 'w00t.gif' ':doh:' => 'doh.gif' ':yayy:' => 'yayy.gif' ':argh:' => 'bangg.gif' ':nooo:' => 'nooo.gif' ':grrchear:' => 'cheeranyhow.gif');

At every topic I get now:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/juniorvi/public_html/forum/include/parser.php on line 23

How to make the smilies work?

2

Re: Troubles adding emoticons

after

':cool:' => 'cool.png'

missing comma

Re: Troubles adding emoticons

Heya- are you comfortable editing the database using phpMyAdmin or another tool? If so, check out:

http://punbb.informer.com/forums/topic/ … y-gallery/

It's a little neater then adding smilies by editing the code, but it's not complete.

Re: Troubles adding emoticons

I was about to say I felt stupid it was just a comma, but the problem doesn't solve

array(':)' => 'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png', '=|' => 'neutral.png', ':(' => 'sad.png', '=(' => 'sad.png', ':D' => 'big_smile.png', '=D' => 'big_smile.png', ':o' => 'yikes.png', ':O' => 'yikes.png', ';)' => 'wink.png', ':/' => 'hmm.png', ':P' => 'tongue.png', ':p' => 'tongue.png', ':lol:' => 'lol.png', ':mad:' => 'mad.png', ':rolleyes:' => 'roll.png', ':cool:' => 'cool.png', ':'(' => 'cry.gif', ':s' => 's.gif', ':$' => 'dollars.gif', ':@' => 'angry.png' '(h)' => 'hot.gif' 'o.O' => 'o.o.gif' 'O.O' => 'O.Obig.gif' ':woot:' => 'w00t.gif' ':doh:' => 'doh.gif' ':yayy:' => 'yayy.gif' ':argh:' => 'bangg.gif' ':nooo:' => 'nooo.gif' ':grrchear:' => 'cheeranyhow.gif');

Re: Troubles adding emoticons

Where you added the crying emoticon, you used an apostrophe in the emoticon replacement text. Since the strings are delimited by single quotes (apostrophes), it messed everything up.

Try this:

array(':)' => 'smile.png', '=)' => 'smile.png', ':|' => 'neutral.png', '=|' => 'neutral.png', ':(' => 'sad.png', '=(' => 'sad.png', ':D' => 'big_smile.png', '=D' => 'big_smile.png', ':o' => 'yikes.png', ':O' => 'yikes.png', ';)' => 'wink.png', ':/' => 'hmm.png', ':P' => 'tongue.png', ':p' => 'tongue.png', ':lol:' => 'lol.png', ':mad:' => 'mad.png', ':rolleyes:' => 'roll.png', ':cool:' => 'cool.png', ":'(" => 'cry.gif', ':s' => 's.gif', ':$' => 'dollars.gif', ':@' => 'angry.png' '(h)' => 'hot.gif' 'o.O' => 'o.o.gif' 'O.O' => 'O.Obig.gif' ':woot:' => 'w00t.gif' ':doh:' => 'doh.gif' ':yayy:' => 'yayy.gif' ':argh:' => 'bangg.gif' ':nooo:' => 'nooo.gif' ':grrchear:' => 'cheeranyhow.gif');

6 (edited by Ken1988 2012-01-09 09:24)

Re: Troubles adding emoticons

Thanks for all the help. After erasing some more comma's its now fixed!