Customizing SMF > Tips and Tricks

Limit smilies per post

(1/4) > >>

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

[Unknown]:
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!);

-[Unknown]

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

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

[Unknown]:
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.

-[Unknown]

Navigation

[0] Message Index

[#] Next page

Go to full version