Customize your MT admin page – comments

We had some problems with comment spam recently so we wanted to see more comments at the same time…

We could have just made a new plugin, or found one already written, and used it in a new index, but then we’d have to rebuild the thing every time we needed to find spam.

So, I went into our MT installation and changed it directly to show the last 25 comments instead of the last 5.

  • MT_HOME/tmpl/cms (for example /usr/local/apache/cgi-bin/mt/tmpl/cms )
    is where the templates are.

  • The one which we want is menu.tmpl which defines COMMENT_LOOP.

  • They use a templating language defined by which lives at
    MT_HOME/extlib/HTML (for example /usr/local/apache/cgi-bin/mt/extlib/HTML ). This module is very well commented, type

    perldoc Template

    to read it.

  • now we want to change the number of times the COMMENT_LOOP iterates-
    kind of a pain in the ass, since it iterates over an array, and so it will be the length of the array and not defined in our template at all!

  • the library that builds this is called
    ( for example
    /usr/local/apache/cgi-bin/mt/lib/MT/App/ ).

  • the array in question is called @c_data and somewhat disturbingly has a hard coded length:
    $iter = MT::Comment->load_iter({ blog_id => $blog_id },
            { 'sort' => 'created_on',
              direction => 'descend',
              limit => 5 });
        my @c_data;

    See that 5? that’s our puppy!

Urban Iditarod

MAX: basically drunken dog sled racing but the dogs are costumed people and the
sled is a shopping cart. looks like 35 teams participated last year.
insane. if anyone wants to chase them through town from SOMA to Fort Mason,
stopping at all the mandatory pitstops (read: bars), I’ll be there and we
can be fanboys together.

Web link of note: Urban Iditarod