Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Emoticons For bbPress?


_ck_
Participant

@_ck_

I’ve now made a smilie plugin here:

https://bbpress.org/plugins/topic/bb-smilies

By the way, WordPress’s default smilie detection code and therefore the code converted here in the earlier post are very flawed when it comes to whitespace issues.

I created a patch awhile back that made it work 99% of the time regardless of spaces before, after or at the end/beginning of a sentence.

add this function:

function prepSmilies($string) {return "/(s|^)".quotemeta(trim($string))."(s|$)/";}

then add this near the start of function convert_smilies:

$prep_search = array_map('prepSmilies', $wp_smiliessearch);

then change the $contenst=str_replace line near the end of function covert_smilies:

$content = preg_replace($prep_search, $wp_smiliesreplace, $content);

Now if only it was this easy to tweak wp/bb’s search function to be so much more intelligent.

Skip to toolbar