term blacklist

tbartels - April 8, 2009 - 05:40
Project:Unitag
Version:5.x-1.0-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:tbartels
Status:needs work
Description

Loving Unitag, thanks for this.

I noticed in your todo comments you wanted a "ban" feature and I have been using unitag for about a week now and having to moderate 150+ term suggestions a day, many of them duplicates of something I have denied before so I thought I would take a stab at adding this feature. I only have D5 to work on right now, I probably won't have the time to make a D6 patch anytime soon, but I don't imagine it would be too hard to port.

I split "Deny & Delete" into two seperate functions. Delete does what "Deny & Delete" once did and "Deny" now flags the suggested term as denied and moves it off the "Manage Suggestions" page. I added a "deny" column to the unitag table which holds the utid of the term that matched the denial. The first time a term is encountered the deny is set equal to it's utid so if utid = deny the result is the first term that encountered this denial. I just reused the manage_suggestions_form and added an argument to unitag_suggestions_get to retrieve denials or suggestions, so the denials page should work just like the suggestions page allowing any denied terms to be recovered later if desired. I'd imagine the denails page getting pretty big and ugly pretty fast, it could probably use some pagination or a setting to allow an admin to wholly drop any denied terms.

Anyway, it's not very heavily tested so definitely needs review. I have also never done a hook_update_N() so if someone that knows the nuances of handling a table alter could check to make sure I did that right it would be greatly appreciated.

Don't forget to run update.php if you test this patch.

AttachmentSize
unitag_blacklist.patch5 KB

#1

Zen - April 9, 2009 - 16:22
Status:needs review» needs work

Thanks for the patch! I would actually prefer to see the blacklist use a separate DB table and a separate cleaner form. A mass-insert form per vocabulary would also be excellent. Pagination would also not be unwelcome :)

Cheers,
-K

 
 

Drupal is a registered trademark of Dries Buytaert.