Comment Timeline Reverser Wordpress Plugin | Newest 1st

I created my own Twitter kind of thing on the INFOBITS page but I needed the comments to flow backwards. I wanted first comment shown to be the latest and, obviously, Wordpress has no such option so I needed a plugin to do this. Of course I did not look for one already made. So I made my own.

This may seem a bit difficult but it's all about intercepting a filter comments_array and doing an array_reverse on the supplied argument and storing the post switch state somewhere.

How the plugin works!

On install a new column is added to the posts table and on uninstall it is removed. That column is a BOOL and is 0 or 1. If it's 0 comments flow the right way and if it's 1 comments are reversed.

Only the post's author, admin and editors can change this settings and the bottom meta box you see on the right  will only be visible to them. The meta box with the option is only visible when you edit a post/page and not the first time you add it. So don't despair if you don't see it when adding a new post.

When you uninstall everything goes back to normal and comment flow resumes its natural way.

Get this plugin

Create a new PHP file in your plugins folder and paste this code.

Zone unavailable to unregistered users. Registration is quick, painless and worth its weight in gold!

I tried to comment the code as much as I could before I started drooling so that is it. This Wordpress plugin combined with a plugin I'll share in a few days will be the bloggers' Twitter killers :) and allow you to post tiny updates in house.

It's working … for me anyways :) If you got problems lemme know.

Category: Wordpress Plugins

4 Responses

  1. +xentech3:17 — #4 says:

    Are you gonna be selling the plugin to restrict content for unregistered users like you have in this post?

    That shit would be very useful for certain ventures.

    • $@5ubliminal46:361 — #1 says:

      I’m writing a PayPerRead PayPal plugin to process payments and I’ll sell a bunch of plugins. This one too.

      PS: Almost all published code on this site of registered-users only.

  2. +xentech4:17 — #4 says:

    What are these weird ratio’s by our names?