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

Mike Frith

thanks the code works great... thanks guys

dtm.exe

I find this to be useful, especially for the users on my forum ;).

-Dan The Man

Mike Frith

yeah definatly... nice and simple to do as well... didnt take too long

Reinno

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.

JayBachatero

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

Jay T

Not working. Here is my section of the post.php code.

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']);

Owdy

#26
WFM

heres mine in that area:

// 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!
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

Jay T

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?


CeZa


geezmo

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.

geezmo


Owdy

Quote from: geezmo on May 07, 2006, 04:47:56 PM
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

GetRank


PrizeLive.com

Installed smoothly and modified to allow 5 smilies.... Thanks!!
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Brianw1212

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

PrizeLive.com

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

In Modifications.english.php

Find:

$txt['error_smiley_limit'] = 'Max 3 smiles please. Remove smilies and try again.

Replace With:

$txt['error_smiley_limit'] = 'Max 4 smiles please. Remove smilies and try again.

In Post.php

Find:

$smileyLimit = 3;

Replace With:

$smileyLimit = 4;

That should do it for you...  ;D
Get Paid Instantly via PayPal (or other options) at PrizeLive.com!

Brianw1212

Quote from: SurfExcelerator.com on July 16, 2006, 08:02:57 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

In Modifications.english.php

Find:

$txt['error_smiley_limit'] = 'Max 3 smiles please. Remove smilies and try again.

Replace With:

$txt['error_smiley_limit'] = 'Max 4 smiles please. Remove smilies and try again.

In Post.php

Find:

$smileyLimit = 3;

Replace With:

$smileyLimit = 4;

That should do it for you...  ;D

Great!

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


Brianw1212

#38
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

Owdy

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;

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: