News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Limit smilies per post

Started by Owdy, September 27, 2004, 11:56:40 AM

Previous topic - Next topic

Brianw1212

Quote from: Owdy on July 16, 2006, 11:12:21 PM
Quote from: Brianw1212 on July 16, 2006, 07:57:59 PM
Hi guys, installed this mod and it works great.. my only question is how do i change the number of smileys allowed in a post? The default is set at 3, but I want to change it to 4 if possible.

Thanks
First post ;)
Quote from: Owdy on September 27, 2004, 11:56:40 AM

You can set that limit number in this $smileyLimit = 3;


Owdy, I'm going to direct this to you because it's your mod. I don't know if you read my previous post or not, but I was wondering if there was a way to limit the smileys per post and not have the ones in a quote to count towards the limit amount. For example, if the limit is 3, and i quote someone who has used 2 in his post, i can only use 1 because he already used 2 and i'm quoting him.. Is there any way to get around that?

Thanks

Owdy

That i dont know. My php isint that good ;D
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Brianw1212

Quote from: Owdy on July 18, 2006, 01:25:56 PM
That i dont know. My php isint that good ;D

I'm attempted to play around with it myself and see if i could figure it out.. although i can guarantee your php is better than my php   :D


RODEOSOLSTICE

smileyLimit.zip

This is a great mod, and I definatly need it. It works on my V1.1, but not on V1.1.1

Any way to get it working for V1.1.1

and, newbie question. What is RC2 and RC3??

thanks!

RODEOSOLSTICE

Quote from: RODEOSOLSTICE on January 17, 2007, 12:52:44 PM
smileyLimit.zip

This is a great mod, and I definatly need it. It works on my V1.1, but not on V1.1.1

Any way to get it working for V1.1.1

and, newbie question. What is RC2 and RC3??

thanks!

Please forgive me, I found the solution here:
http://www.simplemachines.org/community/index.php?topic=107685.msg898559#msg898559

I'd still like to know what RC1 etc means??

Owdy

Code updated for SMF 1.1.2. Please read first post.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

MultiformeIngegno

Hi, I dredge this old topic to ask you how can I limit the number of smilies per post in SMF 2.0b4.. please help me! :)

'bye! ;)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Diabolo.ca

#47
Just a few small changes needed to make it work in 2.0 beta 4. The new edits:

<edit file>
Sources/Post.php
</edit file>

<search for>
    $_POST['message'] = $smcFunc['htmlspecialchars']($_POST['message'], ENT_QUOTES);
</search for>

<add after>
      if (isset($_POST['message']))
{
$smileyLimit = 3;

$prev = substr_count(strtolower($_POST['message']), '[img');
$tempmsg = parse_bbc($_POST['message'], true);
if (substr_count($tempmsg, '<img') > ($prev + $smileyLimit))
$post_errors[] = 'smiley_limit';
}
</add after>

<edit file>
Themes/default/languages/Modifications.english.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['error_smiley_limit'] = 'You can only have 3 smileys per post. Remove some smileys and try again.';
</add before>


But here's the kicker that had me puzzled at first. Read the comments at the beginning of index.english.php:
Quote/* Important note about language files in SMF 2.0 upwards:
   1) All language entries in SMF 2.0 are cached. All edits should therefore be made through the admin menu. If you do
      edit a language file manually you will not see the changes in SMF until the cache refreshes. To manually refresh
      the cache go to Admin => Maintenance => Clean Cache.

In other words, with 2.0, until you delete the old cache files you won't see the warning you added, although the posts with more than 3 smileys will still be rejected.

I assume similar updates could be made to the official mod as well to update for 2.0.

sirNemanjapro

#48
Is this working for SMF 1.1.11 or is there option in the board?

I have just checked, 1.1.11 doesn't have an limit number of smileys per post.


So, question is. Can I use this code that is updated for my installation?
None of the above applies.

MultiformeIngegno

Does this still work with RC3? I repeat that IMO this feature should be available by default...
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Advertisement: