Page 1 of 1


Posted: Thu Jan 03, 2013 6:50 pm
by Eni

I'd like to edit the Emoticate Event Plugin.

I want to use more emoticons than it makes sense to display on the comments form. What I would like to do is only show 10 emoticons and then a wider selection via a popup link.

Now, I know how to insert a target=blank link but I seem to not be able to figure out how to do that in the php script. This is how it looks now:

Code: Select all

if (!isset($this->smilies)) {
$ext = $this->get_config('extension', 'gif');
$this->smilies = array(

"\\*excited\\*"    => serendipity_getTemplateFile('img/emoticons/excited.'.$ext),
"\\*angry\\*"    => serendipity_getTemplateFile('img/emoticons/angry.'.$ext), 
"\\*faint\\*"    => serendipity_getTemplateFile('img/emoticons/faint.'.$ext), 
"\\*fear\\*"    => serendipity_getTemplateFile('img/emoticons/fear.'.$ext), 
"\\*happy\\*"    => serendipity_getTemplateFile('img/emoticons/happy.'.$ext), 
"\\*love\\*"    => serendipity_getTemplateFile('img/emoticons/love.'.$ext),   
"\\*sad\\*"    => serendipity_getTemplateFile('img/emoticons/sad.'.$ext), 
"\\*shock\\*"    => serendipity_getTemplateFile('img/emoticons/shock.'.$ext),       
Let's say, I want every emoticon after "happy" to not show on the comment form but be available via a popup link. What would be the best way to archive this? Editing the serendipity_event_emoticate.php seem to either not work or I try it wrong.


Re: Emoticons

Posted: Sat Jan 12, 2013 6:57 pm
by garvinhicking

Weeeeell. This is not as easy as you might think.

Ideally, I would suggest you to use CSS to completely hide the emoticate instructions/listing. Then you use jquery or edit the commentform.tpl file manually to place exactly those emoticons there you want; there you could also add your custom popup HTML code.

The benefits to this: You don't need to edit any core files, so it's update-safe. Also you can customize any listing you want.

You could of course also edit the PHP file to add restrictions, but this is really cumbersome and would require some PHP knowhow for breaking out of foreach loops with counters, etc...