HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Issues with 2.0.18

ShmizzleShmizzle New
edited November 2011 in Feedback
Hi, I just updated to 2.0.18 and the latest version of this addon and am experiencing some issues with it. Here's my EmoticonMatch array:

$EmoticonMatch = array("[:0]" => "gasp.gif",);

It works sometimes, but if there's no space on both sides of the [:0], the emoticon isn't replaced with an image. So if you have something like:

Hey![:0]

or

h[:0]

It doesn't work.

Also, if there's a greater than / less than sign in the post prior to the emoticon, things get all screwey and the plugin appears to insert broken HTML. For example, if you make a post like this:

> [:0]

or...

blah blah blah > blah blah blah blah blah [:0]

Then broken HTML is inserted, unfortunately.

Would love to see both these things fixed, it's the only thing preventing me from upgrading to 2.0.18 on my main forum!

Best Answers

  • Options
    ShadowdareShadowdare r_j MVP
    edited July 2013 Answer ✓

    @imijj, open plugins/Emoticons/class.emoticons.plugin.php and go to line 321 or somewhere around there. There should be a line that looks like this:

    return ' <img class="emoticon" src="'.$this->GetResource("images/$Img", FALSE, FALSE).'" alt="'.$EmoticonMasked.'" /> ';
    

    Change that to this:

    return ' <img class="emoticon" src="' . DS . Gdn_Url::WebRoot() . DS . $this->GetResource("images/$Img", FALSE, FALSE) . '" alt="' . $EmoticonMasked . '" /> ';
    

    Add Pages to Vanilla with the Basic Pages app

  • Options
    ShadowdareShadowdare r_j MVP
    edited July 2013 Answer ✓

    @imijj: The other way I posted will output the relative path to the forum dispatcher if you have the forum in a subdirectory. Put TRUE in Gdn_Url::WebRoot() to include the domain.

    return ' <img class="emoticon" src="' . Gdn_Url::WebRoot(TRUE) . DS . $this->GetResource("images/$Img", FALSE, FALSE) . '" alt="' . $EmoticonMasked . '" /> ';
    

    Add Pages to Vanilla with the Basic Pages app

Answers

  • Options
    @Tim @Todd @Lincoln has anything changed in 2.0.18 that might be causing the latter problem? FWIW my custom/old version of this plugin (which doesn't suffer from the first problem I mentioned) hooks into:

    DiscussionController_BeforeCommentBody_Handler
    PostController_BeforeCommentBody_Handler
    PostController_BeforeDiscussionRender_Handler
    PostController_BeforeCommentRender_Handler
    PostController_BeforeDiscussionPreview_Handler

    And in each of those callbacks a function is called which just does a str_replace on the text, replacing the emoticon code with img src HTML code. Again, works perfectly fine in 2.0.17 but for some reason it doesn't in 2.0.18.
  • Options
    oliverraduneroliverraduner Contributing to Vanilla since 2010 Switzerland ✭✭
    @Shmizzle I acknowledge issue #1 with the plugin, however for issue #2 I cannot reproduce it, even with 2.0.18.
  • Options
    Thanks for the response. I wonder why that might be. You're using the same EmoticonMatch array I listed above, correct? FWIW when testing, I disabled all plugins except for this Emoticons plugin, including Htmlawed.
  • Options

    demo ? please/

  • Options
    imijjimijj New
    edited July 2013

    I recently installed this plugin and I'm having a problem. The emoticons seem to be calling the desired image, but from the wrong path. The plugin is pointing to "myforum.com/discussion/5/plugins/Emoticons/images/laugh.gif"
    instead of
    "myforum.com/plugins/Emoticons/images/laugh.gif"

    Any ideas?

  • Options
    ShadowdareShadowdare r_j MVP
    edited July 2013 Answer ✓

    @imijj, open plugins/Emoticons/class.emoticons.plugin.php and go to line 321 or somewhere around there. There should be a line that looks like this:

    return ' <img class="emoticon" src="'.$this->GetResource("images/$Img", FALSE, FALSE).'" alt="'.$EmoticonMasked.'" /> ';
    

    Change that to this:

    return ' <img class="emoticon" src="' . DS . Gdn_Url::WebRoot() . DS . $this->GetResource("images/$Img", FALSE, FALSE) . '" alt="' . $EmoticonMasked . '" /> ';
    

    Add Pages to Vanilla with the Basic Pages app

  • Options

    @Shadowdare said:
    imijj, open plugins/Emoticons/class.emoticons.plugin.php and go to line 321 or somewhere around there. There should be a line that looks like this:

    return ' <img class="emoticon" src="'.$this->GetResource("images/$Img", FALSE, FALSE).'" alt="'.$EmoticonMasked.'" /> ';
    

    Change that to this:

    return ' <img class="emoticon" src="' . DS . Gdn_Url::WebRoot() . DS . $this->GetResource("images/$Img", FALSE, FALSE) . '" alt="' . $EmoticonMasked . '" /> ';
    

    Did that and now its trying to call an image from this path: http://plugins/Emoticons/images/laugh.gif

  • Options
    ShadowdareShadowdare r_j MVP
    edited July 2013 Answer ✓

    @imijj: The other way I posted will output the relative path to the forum dispatcher if you have the forum in a subdirectory. Put TRUE in Gdn_Url::WebRoot() to include the domain.

    return ' <img class="emoticon" src="' . Gdn_Url::WebRoot(TRUE) . DS . $this->GetResource("images/$Img", FALSE, FALSE) . '" alt="' . $EmoticonMasked . '" /> ';
    

    Add Pages to Vanilla with the Basic Pages app

  • Options

    @Shadowdare said:
    imijj: The other way I posted will output the relative path to the forum dispatcher if you have the forum in a subdirectory. Put TRUE in Gdn_Url::WebRoot() to include the domain.

    return ' <img class="emoticon" src="' . Gdn_Url::WebRoot(TRUE) . DS . $this->GetResource("images/$Img", FALSE, FALSE) . '" alt="' . $EmoticonMasked . '" /> ';
    

    Thanks a lot!

Sign In or Register to comment.