Last night I closed another BETA and declared “Custom Search Flood Controls” to be a release candidate. I also submitted it to the MOD Team for approval. The hardest part? Deciding which category to put it in.
First, a brief (for me) background on what it does. In 2.0.20 the phpBB Group introduced the concept of Search Flood Control. We already had posting flood control, which keeps people (or posting “bots”) from posting over and over again with very little delay. You may have noticed that “posting” flood control also impacts edits. The reason is simple… someone can put just as much load on the server by posting a very large post and then immediately editing and saving it over and over again as they would by posting. So it makes sense.
What did not make sense to me was the inclusion of a new flood control option for search without more options. For example, a search for unanswered posts really doesn’t impact a server very much, it simply looks for topics that have no replies. That search only hits one table, and while it could be run over and over (and over and over) it really doesn’t have the impact on your server that an extensive keyword search would have.
Here’s the simple query for doing an “unanswered” search:
$sql = “SELECT topic_id
FROM ” . TOPICS_TABLE . ”
WHERE topic_replies = 0
AND topic_moved_id = 0″;
It’s gets a bit more complex if you have forum authorization rules, in fact, it gets more complex than it needs to be since the forum_id is already on the topics table. But I digress. If you search for keywords then we first have to process the “stopwords” and the “synonyms” text files, which means disk I/O. We have to determine if we’re searching the topic title and message, or just the message. Or with a MOD, just the title.
The point is, some searches are worse in terms of server load than others. One of my favorite searches is the “New posts since last visit” as I find it’s a great way to catch up on what I’ve missed. I will click the search, pick a topic, read it – sometimes quite quickly – and then return to search again. Often times I will get denied because of the rapid return.
Or another example, searching for MODs at phpBB.com. I frequently see topics in phpBB Discussion that are really MOD Requests. If I have time, I like to do a MOD Search and post some options in the topic as I move it to MOD Requests. But finding the right set of keywords can be difficult, even if I know what I’m looking for. So I search, get no (or too many) results, and go back to search again.
Only to be told I have to wait.
But again I digress.
The point of this MOD is to provide the board owner / administrator with an additional level of control and flexibility as to how they want to manage the various searches performed on their board. There are keyword searches (heavy load) and author searches (not so heavy). There are “ego searches” (find my posts) and the aforementioned search for unanswered topics. This MOD will let you set different flood control limits for each and every one of them.
Of course if you turn the search flood control off, then all of these limits are ignored as well.
Finally, and here’s the part that I put in just for myself, you can include exemptions for various user levels. So I can set it up so that board administrators or moderators are automatically excluding from any search flood controls. You could even set this up so that guests have limits while registered users do not. That could be a nice perk to advertise as a way to entice some of your lurkers into registering on your board. Options are nice to have, and this MOD definitely provides a nice tweak (in my !($humble) opinion ) for a board.
But back to the original question: which category should I select when considering this MOD? I ended up submitting it for inclusion in the “Security” category. The main reason is that since the search flood control was introduced as a security measure (most likely, in my opinion, because they wanted that option as part of phpbb.com) and since this MOD enhanced that feature, it would make sense to submit it to that category.
This is the second MOD I have submitted this week, and the third that I currently have in the MOD Queue for review. I have a few more that I will try to get resolved before or during the holidays.
I like this MOD, hope you will too.
The current code can be viewed here.