Closed (fixed)
Project:
Spam
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
15 Oct 2007 at 11:51 UTC
Updated:
12 Nov 2007 at 22:42 UTC
I have an add-on module that allows the admin to manage the tokens for the Spam module. Should I contribute it as a completely separate module or have it included as part of the base distribution?
Comments
Comment #1
jeremy commentedI finally extracted your zip and installed it locally.
General feedback, without actually looking at the code:
If you continue working on this, please just attach the files uncompressed. It is a tiny module and won't hurt anything. If it's a zip, well, you saw how quickly I respond to them.
Comment #2
nancydruThese comments are why I sent it to you.
1) It's in order by the token name on my site. Maybe I changed that after I sent it to you.
2) I'll see if I can do this.
3) I can remove the "mark as" from the edit screen. Should it remain on the add screen? I have used this to pro-actively add tokens before they were encountered.
4) I will change it to a comment line. I like to see it. But it will default to the time a token is added in the add logic.
5) Okay.
Comment #3
jeremy commentedIt's worth the effort, as it makes the module much more usable. Sifting through 50,000+ tokens is basically impossible otherwise, no matter how they are ordered.
It should be auto-calculated. If you want a token to be marked as spam, set the probability to 80 or greater. If you want the token to be marked as not spam, set it to a probability less than 80. Your _submit action should then check the probability and set the "mark as" field automatically. The "mark as" field is only in that table as a search optimization, nothing more.
Sure, providing the information is certainly useful. You can also provide the "mark as" field as information too, perhaps along with an explanation. "This token has a probability of 85, so its occurrence in submitted content makes it more likely to be automatically marked as spam" or something like that.
Comment #4
jeremy commentedSorry, bad information.
The spam_tokens table has the following columns: tid, token, spam, notspam, probability, last.
The spam field is the number of times this token has shown up in spam content. The notspam field is the number of times this token has show up in not-spam content. The probability is then calculated from these two fields. ie, if spam=5 and notspam=0, then probability = 99 (there is no 100). if spam=5 and notspam=5, then probability = 50.
Your code is incorrect as it specifies that a token can't have a value in both spam and notspam -- but obviously not only can it but in real world usages it will more often than not.
Comment #5
nancydruOkay, disregard what I just sent you...
Comment #6
nancydruhttp://drupal.org/project/spam_tokens
Comment #7
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.