Customizing SMF > Tips and Tricks

Limit smilies per post

(1/4) > >>

Is there way to ad some max number limit to smilies per post? Some people use smilies like corn flakes and its anoying.

Hahahah... corn flakes... oh, that's great...

Yeah, it's easy ;).  Open Sources/Subs.php... and.. find...

$message = preg_replace($smileyfromcache, $smileytocache, $message);

Replace it with:

$message = preg_replace($smileyfromcache, $smileytocache, $message, PUT MAX SMILEY NUMBER HERE!);


Wow, thanks! Ok, what happends if user passes that limit? Is there show non-image smilies instead?

Hmmm, that aint working:
$message = preg_replace($smileyfromcache, $smileytocache, $message, 4);

Hmm... it should...?

If I posted the :) smiley 5 times, with that in there, it should only parse the first four.  Please note that it will parse the first four of ANY type of smiley, so if I do :) :( I can get 8 in.  It'd take more work to make it only 4 of all kinds per post.



[0] Message Index

[#] Next page

Go to full version