Advertisement:

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

Offline Mike Frith

  • Semi-Newbie
  • *
  • Posts: 54
  • Gender: Male
  • Look! Meat!
    • Bam-TV
Re: Limit smilies per post
« Reply #20 on: June 15, 2005, 12:26:31 PM »
thanks the code works great... thanks guys

Offline dtm.exe

  • SMF Hero
  • ******
  • Posts: 5,465
Re: Limit smilies per post
« Reply #21 on: June 15, 2005, 01:03:18 PM »
I find this to be useful, especially for the users on my forum ;).

-Dan The Man

Offline Mike Frith

  • Semi-Newbie
  • *
  • Posts: 54
  • Gender: Male
  • Look! Meat!
    • Bam-TV
Re: Limit smilies per post
« Reply #22 on: June 15, 2005, 01:36:35 PM »
yeah definatly... nice and simple to do as well... didnt take too long

Reinno

  • Guest
Re: Limit smilies per post
« Reply #23 on: December 12, 2005, 07:41:01 PM »
I know this topic is kinda old so sorry for posting but with the next SMF release soon to come and blah blah...  :P

Ok, what I wanted to suggest was whether it would be possible to implement this great feature into SMF before the 1.1 Final release? Just thought I wanted to add my two cents here. This is a great mod.

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: Limit smilies per post
« Reply #24 on: December 12, 2005, 07:47:46 PM »
At this moment all feature additions have been stopped and its bug checking/code cleaning time.  Maybe it will make it to 1.2/2.0.

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Limit smilies per post
« Reply #25 on: April 20, 2006, 09:42:12 PM »
Not working. Here is my section of the post.php code.

Code: [Select]
elseif (!empty($modSettings['max_messageLength']) && strlen($_POST['message']) > $modSettings['max_messageLength'])
{
$post_errors[] = 'long_message';
if (isset($_POST['message']))
{
$smileyLimit = 3;

$prev = substr_count($_POST['message'], '[img') + substr_count($_POST['message'], '[IMG');
$tempmsg = doUBBC($_POST['message'], true);
if (substr_count($tempmsg, '<img') > ($prev + $smileyLimit))
$post_errors[] = 'smiley_limit';
}
unset($_POST['message']);

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 #26 on: April 22, 2006, 10:08:57 AM »
WFM

heres mine in that area:

Code: [Select]
// Check the subject and message.
if (!isset($_POST['subject']) || htmltrim__recursive($_POST['subject']) == '')
$post_errors[] = 'no_subject';
if (!isset($_POST['message']) || htmltrim__recursive($_POST['message']) == '')
$post_errors[] = 'no_message';
elseif (!empty($modSettings['max_messageLength']) && $func['strlen']($_POST['message']) > $modSettings['max_messageLength'])
$post_errors[] = 'long_message';

 if (isset($_POST['message']))
 {
 $smileyLimit = 3;

 $prev = substr_count($_POST['message'], '[img') + substr_count($_POST['message'], '[IMG');
 $tempmsg = doUBBC($_POST['message'], true);
 if (substr_count($tempmsg, '<img') > ($prev + $smileyLimit))
 $post_errors[] = 'smiley_limit';
 }
if (isset($_POST['calendar']) && !isset($_REQUEST['deleteevent']) && htmltrim__recursive($_POST['evtitle']) == '')
$post_errors[] = 'no_event';
// You are not!
« Last Edit: April 22, 2006, 10:11:38 AM by 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

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Limit smilies per post
« Reply #27 on: April 24, 2006, 08:26:56 AM »
Not sure but it doesnt work. I tried your code too, as it is a little different.

I really need this. Can you help me figure it out?

Offline Jay T

  • Jr. Member
  • **
  • Posts: 143
Re: Limit smilies per post
« Reply #28 on: April 28, 2006, 08:17:37 AM »
No one?

Offline CeZa

  • Full Member
  • ***
  • Posts: 648
  • Gender: Male
  • ?!..
Re: Limit smilies per post
« Reply #29 on: April 29, 2006, 01:16:39 PM »
ok thanks unknown! ;)

Offline geezmo

  • Full Member
  • ***
  • Posts: 441
Re: Limit smilies per post
« Reply #30 on: May 06, 2006, 07:09:26 AM »
Ok now I'm confused here. Can somebody summarize which templates needed to be edited, which codes need to be replaced, and what codes should be added if I want to apply this to 1.1 RC2. The posts here are rather confusing so I hope somebody here can update this mod. Thanks.

Offline geezmo

  • Full Member
  • ***
  • Posts: 441
Re: Limit smilies per post
« Reply #31 on: May 07, 2006, 04:47:56 PM »
anyone?

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 #32 on: May 08, 2006, 11:56:29 AM »
anyone?

Run this via package manager. Works with SMF 1.1 RC2 with english language. Enjoy.
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 GetRank

  • Semi-Newbie
  • *
  • Posts: 26
    • Webmaster Tools and Seo Tools
Re: Limit smilies per post
« Reply #33 on: June 16, 2006, 12:48:09 PM »
Thanks.. works great

Offline PrizeLive.com

  • Full Member
  • ***
  • Posts: 683
    • PrizeLive.com
Re: Limit smilies per post
« Reply #34 on: July 09, 2006, 07:07:42 PM »
Installed smoothly and modified to allow 5 smilies.... Thanks!!
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Offline Brianw1212

  • Jr. Member
  • **
  • Posts: 102
Re: Limit smilies per post
« Reply #35 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

Offline PrizeLive.com

  • Full Member
  • ***
  • Posts: 683
    • PrizeLive.com
Re: Limit smilies per post
« Reply #36 on: July 16, 2006, 08:02:57 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

In Modifications.english.php

Find:

Code: [Select]
$txt['error_smiley_limit'] = 'Max 3 smiles please. Remove smilies and try again.
Replace With:

Code: [Select]
$txt['error_smiley_limit'] = 'Max 4 smiles please. Remove smilies and try again.
In Post.php

Find:

Code: [Select]
$smileyLimit = 3;
Replace With:

Code: [Select]
$smileyLimit = 4;
That should do it for you...  ;D
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Offline Brianw1212

  • Jr. Member
  • **
  • Posts: 102
Re: Limit smilies per post
« Reply #37 on: July 16, 2006, 08:13:37 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

In Modifications.english.php

Find:

Code: [Select]
$txt['error_smiley_limit'] = 'Max 3 smiles please. Remove smilies and try again.
Replace With:

Code: [Select]
$txt['error_smiley_limit'] = 'Max 4 smiles please. Remove smilies and try again.
In Post.php

Find:

Code: [Select]
$smileyLimit = 3;
Replace With:

Code: [Select]
$smileyLimit = 4;
That should do it for you...  ;D

Great!

I'll try it tonight..  thanks alot   :)


Offline Brianw1212

  • Jr. Member
  • **
  • Posts: 102
Re: Limit smilies per post
« Reply #38 on: July 16, 2006, 08:54:42 PM »
Just one more quick question...

Is there a way to limit the smileys in an actual post and have it not count the ones that are included in a quote?

For example, since installing the smiley mod, alot of my members have been complaining that when they quote someone who has used 3 smileys in their post, they're not allowed to use any because the limit per post is 3.. so they're having to go back and edit out the smileys in the quote in order to post some smileys of their own...

I'm curious if there is a fix for this..  thanks
« Last Edit: July 16, 2006, 08:56:15 PM by Brianw1212 »

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 #39 on: July 16, 2006, 11:12:21 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 ;)

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

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