Tinkering with how SEB works.

Seeing as version 1.5.2 of ExpressionEngine was released yesterday, the script I use to run SEB, I went ahead and got the site upgraded last night and I’m thinking of trying out a couple of changes to the way threads are handled. One of the handful of new features they added was the ability for members to add commenters to an Ignore List, something Elwed has been dreaming of for awhile now, and I’m debating trying to implement it. The problem with this feature is that it would mean I’d need to disable template caching for the comments template (the one the site uses when you read everyone’s comments) and this means that the comment page could take longer to render. How much longer I’m not sure as I’ve not done a lot of tests and it would depend in part on how much traffic is hitting the site, but on the larger threads it could be considerable.

Now there’s a way I can help offset this and that’s by using the Pagination feature on the comments. I already use pagination on the index of SEB (the links are near the bottom of the page) and the basic result would be that the threads would be broken up into pages of X number of comments (probably 25 or 50 depending on which seems to perform better) which would keep rendering times down on the really huge threads. There’s a reason, however, that I haven’t already implemented pagination on the comment pages and that’s the list of recent comments in the sidebar and the email notifications. Currently I’m placing anchors on each comment so that the sidebar list and the notification emails can include a link straight to the comment in question, but pagination screws those links up. While it is possible in EE to construct anchors on the comments that contain the pagination info, there’s currently no way using the standard tags to construct a link to that anchor. In other words, the list of comments in the side bar and the notification emails would contain a link that would drop you into the thread at the start of all the comments rather than at that particular comment. The comment form, I believe, would show up on all the pages so it’s not like you’d have to cycle through all the comments just to post one of your own, but it does make it a bit more of a pain if you wanted to quote from the original comment though I suppose you could just cut and past from the notification email. It would also make the list of recent commenters underneath each entry on the index pretty much useless as well.

Now I think I could overcome at least the issue with the sidebar by writing a custom plugin to display recent comments that would include a calculation for pagination, but I’m no PHP wizard and it may take me awhile to whip one up. I’ve long wanted to find a solution to be able to use Pagination on the comments template even before the Ignore feature came along simply because it would speed up some of the really huge threads we have going. The other possibility I could implement would be to take advantage of the Forums Module I have installed that we don’t really use. EE can link blog entries to forum entries and then we could disable the standard commenting system altogether. That doesn’t really address the sidebar or the commenters under each entry, but I think the notification emails from the forum actually take pagination into account. The drawback to that approach is that you’d definitely have to register an account in order to comment as the forum doesn’t allow for non-registered comments. Of course some folks may not consider that a drawback.

Anyway, that’s what I’m kicking around and I’d like your feedback on it. Let me know what you think.

11 thoughts on “Tinkering with how SEB works.

  1. Les, you could always clone your standard SEB template group into a temporary one for beta testing.

    With regards to the ignore feature, you can conceivably refactor your templates and embed the parts that couldn’t be cached. With regards to the pagination, I’m game to write a plugin or whatever it takes to deal with the links. I suspect that it wouldn’t be hard, except that the number of comments per page has to be a global variable or something.

    Regarding the forum module, I have yet to toy with mine. As you are well aware of, the forum does not use EE’s standard template system. I’ve done a few templates for the wiki module and I’d guess the forum inflicts a comparable amount of pain, but it’s doable. On the other hand, I don’t know if the forum tags can be used with impunity within the normal templates – in which case you could get the best of both worlds.

    Anyway, I want the ignore feature badly enough to put a lot of effort into making it work for EE wink

  2. I’ve already got some test pages in my templates as I’ve tried to figure a lot of this out previously. grin

    There’s no need to make the number of comments a global variable in the plugin, just a standard variable you’d supply in the plugin’s tag. You’d just tell it the same number you set in the Comment Module tag for pagination and then have it pull how many comments an entry has from the database and do simple division.

    Most of the forum module tags are limited to the forum module templates it seems. Essentially users would be dropped into the forum module whenever they wanted to comment.

  3. On comment pagination: It looks like pagination injects a pagination segment into the URL, which is based on the number of items per page and missing for the initial page.

    It’s straightforward what a plugin that splits out the proper P-segment, if any, should do. What’s perhaps not so straightforward is the performance impact, but at least there shouldn’t be a problem with caching.

  4. There’s no need to make the number of comments a global variable in the plugin, just a standard variable you’d supply in the plugin’s tag.

    I know, but that’s cheating. You can even go one step further and hardcode the number where needed. The nice thing about a global variable is that if you want more or less comments per page, you change one global variable and you’re all done. The requirement of consistent changes often results in an inconsistent change wink

    Most of the forum module tags are limited to the forum module templates it seems.

    I wonder if the reverse holds, as well? That would make it really hard to seamlessly glue the forum and normal site together.

    Essentially users would be dropped into the forum module whenever they wanted to comment.

    That’s sort of bad, I suppose. Or at least, it would amount to rather significant redesign.

  5. Les, I wanted to find the archive referring the ‘blessed mother teresa’ but the archives link would only show page one – i.e. I clicked page 2, 3 and even last and it would always come back (refresh?) to page one.
    I deleted plan A and went to plan B = Fuckit.

  6. LJ, which archive were you looking at? Complete archives? Category? Search results? I just tried the Complete archives and the pagination was working.

    Barry, it’s possible and I’ll look into it. I didn’t realize the Atom feed got hosed. What feed reader are you using?

    Moloch, Muwhahahahahahahaha!

    Dave, I’m honestly of a similar opinion.

  7. Barry, I just checked the Atom feed along with the RSS 1.0 and 2.0 feeds in Google Reader and they’re all working fine. Let me know what news reader you’re using.

  8. Les: which archive?

    Sorry.  red face  It was ‘SEB’s Most Commented Threads’.
    I just tried it again and I still can’t go to another page from page one.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.