News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Word Count Limits

Started by ethankcvds, September 08, 2009, 11:53:09 PM

Previous topic - Next topic

Kimmie

this is a great mod (I used the 1.X version when I had that and I am glad to see there is a 2.0 version out :) ).

Is there any way I can change the message that people see so that it tells them what the actual "minimum" is instead of just saying "There are not enough words in this post. ". Already have people pming me asking and its rather annoying..lol. In addition, someone sees that, it may deter them from posting all together because they wont want to have to sit there and play with it just to see how many words they have to have before they can post it.

I would also like to personalise that message a little more.


Thanks :)

ethankcvds

Quote from: Kimmie on November 06, 2009, 08:25:07 PM
this is a great mod (I used the 1.X version when I had that and I am glad to see there is a 2.0 version out :) ).

Is there any way I can change the message that people see so that it tells them what the actual "minimum" is instead of just saying "There are not enough words in this post. ". Already have people pming me asking and its rather annoying..lol. In addition, someone sees that, it may deter them from posting all together because they wont want to have to sit there and play with it just to see how many words they have to have before they can post it.

I would also like to personalise that message a little more.


Thanks :)

If all you're boards have the same Minimum number of words you'll want to edit
Errors.language.php

$txt['error_post_too_few_words'] = 'There are not enough words in this post.';
No Pm's for support please!

Kimmie

Quote from: ethankcvds on November 06, 2009, 10:08:54 PM
Quote from: Kimmie on November 06, 2009, 08:25:07 PM
this is a great mod (I used the 1.X version when I had that and I am glad to see there is a 2.0 version out :) ).

Is there any way I can change the message that people see so that it tells them what the actual "minimum" is instead of just saying "There are not enough words in this post. ". Already have people pming me asking and its rather annoying..lol. In addition, someone sees that, it may deter them from posting all together because they wont want to have to sit there and play with it just to see how many words they have to have before they can post it.

I would also like to personalise that message a little more.


Thanks :)

If all you're boards have the same Minimum number of words you'll want to edit
Errors.language.php

$txt['error_post_too_few_words'] = 'There are not enough words in this post.';

Errors.LANGUAGE.php?

I see an Errors.English.Php in the Defaults themes languages folder and an Errors.php in the sources directory and an Errors.template.php in the default themes main directory but cant seem to find that file. Its not listed when I parse the mod either. Where is that file at?

Arantor

There are multiple files of Errors, one per language. If you use English as your forum's language, the file would be Errors.english.php. Similarly if it were, say, French, it would be Errors.french.php.

In this case the edit would be to Errors.english.php.

Kimmie

Quote from: Arantor on November 13, 2009, 04:04:31 PM
There are multiple files of Errors, one per language. If you use English as your forum's language, the file would be Errors.english.php. Similarly if it were, say, French, it would be Errors.french.php.

In this case the edit would be to Errors.english.php.

so then what they "meant" to say was

Quoteyou'll want to edit Errors.language.php, where "language" is the language you use on your site

8) lol. Yeah, I finally figured out which file it was after I edited them all and looked for that specific text.

Arantor

Pretty much. Unfortunately it's one of the more typical short-hand forms, though the preferred version is Errors.{language}.php as it makes it more visible that something different is in the middle part.

Kimmie

is it a bug with the mod, that words have to be atleast 3 "characters" long or was that intentional? :)

If its a bug, can we get a fix? If it was intentional, is there a way to change it?


Example: My limit is set to 3 words minimum and NO maximum count. I made a post earlier tonight that said "Great Post WJ!!!" and it told me that it wasnt enough words. As soon as I typed out her screenname (willjess) it let me post it.

Arantor

When I originally wrote it, yes it was intentional.

What would you change it to?

Kimmie

Quote from: Arantor on November 24, 2009, 01:44:53 AM
When I originally wrote it, yes it was intentional.

What would you change it to?


well I would actually turn it off as there will be times when one of those 3 words may be the word "I" or "a" (one character words) or the word ""or", or "as", or "if" (or in my example, mine was that persons initials), etc etc, because right now it doesnt matter how many you set the word count limit to, those words are never included in the count because they are not enough characters. Its a real hassle for folks specially when alot dont understand how the limit feature works.. and I dont have time to sit there and explain it to everyone that complains.. (and believe me when I tell you "alot" complain...lol.


The mod overall is a good mod because it allows you to control spam. Just needs a bit "tweaked" is all :)

Arantor

Unfortunately it isn't as simple as that. In computing terms you have to be able to define some kind of rule that it can work to.

It would be possible to have words of 3 letters or more, plus allowing things like I or a plus or/as/if/of/to, but before any such thing can happen it would have to be defined more rigidly what the rules for counting a 'word' as are.

ttuu

i have this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
file: Post.php
line: 1662

the line 1662 for this fike is:

" , __FILE__, __LINE__);

Arantor

Can we have a few lines before it too please?

ttuu

1653-1676 lines:

if (isset($_POST['calendar']) && !isset($_REQUEST['deleteevent']) && $func['htmltrim']($_POST['evtitle']) === '')
$post_errors[] = 'no_event';
// You are not!
if (isset($_POST['message']) && strtolower($_POST['message']) == 'i am the administrator.' && !$user_info['is_admin'])
fatal_error('Knave! Masquerader! Charlatan!', false);

// Now, let's check the post for being too short/tall
$query = db_query("
SELECT min_words, max_words FROM {$db_prefix}boards WHERE ID_BOARD = {$board_info['id']}
", __FILE__, __LINE__);

if(mysql_num_rows($query) == 1) {
list($min_words, $max_words) = mysql_fetch_row($query);
if($min_words > 0 || $max_words > 0) {
$count = wordcount( $func['htmltrim'](strip_tags(parse_bbc($_POST['message'], false))) ); // convert everything to HTML then scrap it to get only content
if($min_words != 0 && $count < $min_words) {
$post_errors[] = 'post_too_few_words';
} elseif($max_words != 0 && $count > $max_words) {
$post_errors[] = 'post_too_many_words';
}
}
}

mysql_free_result($query);




Arantor

Huh.

What were you doing at the time of getting that error?

ttuu

i sendit message with attachment.

Arantor

Hmm.

Do you use any of the pretty URLs type mods?

ttuu


ethankcvds

#37
Go into phpmyadmin and make sure the tables exist. If they do. Do you have any other mods installed? If so can you post them?
No Pm's for support please!

Kimmie

Quote from: Arantor on November 26, 2009, 12:58:05 PM
Unfortunately it isn't as simple as that. In computing terms you have to be able to define some kind of rule that it can work to.

It would be possible to have words of 3 letters or more, plus allowing things like I or a plus or/as/if/of/to, but before any such thing can happen it would have to be defined more rigidly what the rules for counting a 'word' as are.


guessin that means I will have to live with it right?  lol

Arantor

No, that means if you can figure out very specifically what you want, we can try and come up with rules.

What 1 and 2 letter words should be considered as allowed?

Advertisement: