Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be good if the Mollom module provided it's own little block that showed it's statistics and could help improve the visibility of the Mollom service. The Mollom stats module does a lot of this, but it adds its own token replacement. I think it would be good to add a basic
Mollom block and only if the user has token installed (which is a good chunk of sites), be able to edit the text of the block.
Comment | File | Size | Author |
---|---|---|---|
#8 | localhost_1244598094991.png | 53.71 KB | Dave Reid |
#8 | 423918-block.patch | 7.14 KB | Dave Reid |
#4 | comment-count-block.png | 4.6 KB | Anonymous (not verified) |
Comments
Comment #1
Garrett Albright CreditAttribution: Garrett Albright commentedHi. Creator of Mollom Stats here.
No objections from my direction. Feel free to steal the code outright if so inclined. It would be nice to see the list of modules I'm maintaining actually shrink for once…
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedSince Mollom is free for up to 100 posts per day, it would be nice to have a block for admins where they can easily monitor how many posts Mollom has processed and how much credit is left. Right now I'm querying the database for the number of posts in the last 24 hrs and displaying the result in a custom block for admins. Needless to say, our number might not be exactly the same as your in-house statistics and we might get into trouble in the 90+ zone.
Comment #3
Dries CreditAttribution: Dries commentedThe Mollom graph should provide you these statistics ... ?
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedRight now it's June 3rd 3:50 p.m. CET. On the sites that I manage the last dot on the Mollom graph is June 2nd.
Moreover, it's a little hard to monitor a site by having to go to the Mollom page and hover over the graph with the mouse. I need the number printed in really BIG letters for the admins so they can't miss it. See the enclosed image. (I guess we'd better stop fooling around and finally take out a paid subscription... :)
Comment #5
Garrett Albright CreditAttribution: Garrett Albright commentedEdith, this is really off the topic of this issue, but…
There are calls in the API to get the number of accepted and rejected posts for "yesterday" and "today," so coding a block to do what you're asking should be fairly simple. There's a few things I'm not sure of, though - if a post is rejected initially but the user then successfully fills out the captcha, does that count as both an accepted and a rejected post, or just an accepted one? Does it count as two points against your 100-point limit, or just one? Also, by whose time zone are "yesterday" and "today" calculated? - so there's no solid indication as to what the numbers really mean… but numbers are there. If you have a programmer, have them look at the API guide and perhaps also peek at MolStats' code for inspiration. If you don't have a programmer, perhaps consider contacting the brilliant yet humble creator of MolStats by email and perhaps a deal can be worked out.
…Though if you're going to pay anything, it would probably be best to just pay for a premium Mollom account…
Comment #6
Dries CreditAttribution: Dries commentedMollom uses 'sessions'. As a result, if a post is rejected initially but the user then successfully fills out the captcha, that counts as 1 accepted and 0 rejected.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedErm, yes. The two blocks would serve completely different purposes. Created a new issue for my feature request: #482252: Add a block for Mollom Free users to show available remaining legitimate posts
Comment #8
Dave ReidHere's my first (rough) attempt at a basic stats block. It'll take a little bit of polish with some of the internal functions, but it works. Also attaching a screenshot of the block.
Comment #9
Garrett Albright CreditAttribution: Garrett Albright commentedThe patch seems to include some other stuff in it. I also notice that it makes seven queries against Mollom's servers up to every five minutes, whereas mine made two every 24 hours… I think you ought at least to make it so it only makes the queries if a stats block is visible. As it is, every Drupal Mollom installation in the world is going to be making those queries whether they're showing the block or not.
Comment #10
Dave ReidThere's not anything extra besides some extra trailing spaces that my IDE auto-corrected. Everything else is essential to the patch.
That is a good point about fetching stats every 5 minutes (to be fair, I did admit it's rough at this point!). :) Maybe it should be a configurable interval with sane limits. I also have taken a re-look over the Molstats code and don't see how the stats are not fetched during cron if the block is not enabled. Not sure how that cron workflow would go exactly.
Comment #11
Garrett Albright CreditAttribution: Garrett Albright commentedWell, I didn't say MolStats did that. In theory, if someone's not using MolStats, they just disable the whole darn module, or not install it in the first place. But that's not an option if you're adding this feature to the Mollom module as a whole.
Perhaps instead of checking to see if the block is in use, it would be easier just to have a check box on the Mollom config page which, when checked, enables the stat fetching as well as makes the block appear on the block listing page.
Comment #12
Dries CreditAttribution: Dries commentedSome feedback:
1. Instead of calling
+ if (_mollom_verify_key(FALSE)) {
, I'd just check whether Mollom keys have been configured. It is not practical to wrap every outbound call to Mollom in a _mollom_verify_key. That wouldn't scale. This would also allow us to remove the$show_message = TRUE
parameter from _mollom_verify_key().2. I wouldn't make the refresh interval configurable. Let's just pick a sane default; e.g. every 2 hours?
3.
last @total_days.
should belast @total_days days
?4. Instead of showing
+ $block = '<p>' . t('Error contacting Mollom servers for statistics.') . '</p>';
, I'd simply hide the block?5. It seems like we're retrieving more statistics than we're using.
Comment #13
Dries CreditAttribution: Dries commentedComment #14
Dave ReidI cleaned up the coding fixes separately and also committed the statistics-fetching API in #536144: Add a mollom_get_statistics() to fetch API statistics which will fetch at a no more frequently that 60 minutes. Seems pretty reasonable considering some site admins may want to keep tabs on the number of ham messages on a free subscription.
Comment #15
dag- CreditAttribution: dag- commentedI'd vote for having Mollom stats block in Mollom as well. I have been using Mollom Stats (molstats) now for a long time and it's a clever way of promoting Mollom as well as shows the advantages of Mollom.
I looked at the screenshot and I would prefer not having a button in the block, or at least make it optional. I personally prefer to keep my blog free from too much 'distractions'. A link to Mollom (like in molstats) I would prefer most.
Nevertheless, thanks for making my life easier :-)
Comment #16
fizk CreditAttribution: fizk commentedWhat is the current status of this issue?