Advertisement:

Author Topic: Limit smilies per post  (Read 62486 times)

Offline Brianw1212

  • Jr. Member
  • **
  • Posts: 102
Re: Limit smilies per post
« Reply #40 on: July 18, 2006, 03:44:40 AM »
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 ;)

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

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: Limit smilies per post
« Reply #41 on: July 18, 2006, 01:25:56 PM »
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

Offline Brianw1212

  • Jr. Member
  • **
  • Posts: 102
Re: Limit smilies per post
« Reply #42 on: July 18, 2006, 01:55:54 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


Offline RODEOSOLSTICE

  • Semi-Newbie
  • *
  • Posts: 44
Re: Limit smilies per post
« Reply #43 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!

Offline RODEOSOLSTICE

  • Semi-Newbie
  • *
  • Posts: 44
Re: Limit smilies per post
« Reply #44 on: January 17, 2007, 08:04:09 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??

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: Limit smilies per post
« Reply #45 on: June 14, 2007, 03:25:38 PM »
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

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Limit smilies per post
« Reply #46 on: November 17, 2008, 05:50:43 PM »
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"!

Offline Diabolo.ca

  • Newbie
  • *
  • Posts: 9
Re: Limit smilies per post
« Reply #47 on: November 18, 2008, 03:31:34 AM »
Just a few small changes needed to make it work in 2.0 beta 4. The new edits:
Code: [Select]
<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.
« Last Edit: November 18, 2008, 03:50:42 AM by Diabolo.ca »

Offline sirNemanjapro

  • Semi-Newbie
  • *
  • Posts: 76
  • Gender: Male
  • None of the above applies.
Re: Limit smilies per post
« Reply #48 on: July 14, 2010, 06:53:44 PM »
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?
« Last Edit: July 14, 2010, 06:59:04 PM by sirNemanjapro »
None of the above applies.

Offline MultiformeIngegno

  • Sophist Member
  • *****
  • Posts: 1,100
  • Gender: Male
  • Id quo maius cogitari nequit
    • RockCiclopedia
Re: Limit smilies per post
« Reply #49 on: July 15, 2010, 08:40:54 AM »
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"!

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
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