{"id":5127,"date":"2004-03-05T22:34:01","date_gmt":"2004-03-06T06:34:01","guid":{"rendered":"http:\/\/www.ikillspies.com\/blog\/2004\/03\/05\/5127\/"},"modified":"2004-03-05T22:34:01","modified_gmt":"2004-03-06T06:34:01","slug":"customize-your-mt-admin-page-comments","status":"publish","type":"post","link":"http:\/\/www.ikillspies.com\/?p=5127","title":{"rendered":"Customize your MT admin page &#8211; comments"},"content":{"rendered":"<p>We had some problems with comment spam recently so we wanted to see more comments at the same time&#8230; <\/p>\n<p \/>\nWe could have just made a new plugin, or found one already written, and used it in a new index, but then we&#8217;d have to rebuild the thing every time we needed to find spam.<\/p>\n<p \/>\n  So, I went into our MT installation and changed it directly to show the last 25 comments instead of the last 5.<\/p>\n<ul>\n<p><lI> <b>MT_HOME\/tmpl\/cms<\/b> (for example <b>\/usr\/local\/apache\/cgi-bin\/mt\/tmpl\/cms<\/b> )<br \/>\nis where the templates are.<\/p>\n<p \/><\/li>\n<p><lI>  The one which we want is <b>menu.tmpl<\/b> which defines <b>COMMENT_LOOP<\/b>.<\/p>\n<p \/><\/li>\n<p><lI>They use a templating language defined by <b>Template.pm<\/b> which lives at<br \/>\n<b>MT_HOME\/extlib\/HTML<\/b> (for example <b>\/usr\/local\/apache\/cgi-bin\/mt\/extlib\/HTML<\/b> ).  This module is very well commented, type<\/p>\n<blockquote><p>perldoc Template<\/p><\/blockquote>\n<p>to read it.<\/li>\n<p><lI>now we want to change the number of times the <b>COMMENT_LOOP<\/b> iterates-<br \/>\nkind 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!<\/p>\n<p \/>\n<\/li>\n<p><lI>the library that builds this is called<br \/>\n<b>MT_HOME\/lib\/MT\/App\/CMS.pm<\/b><br \/>\n( for example<br \/>\n<b>\/usr\/local\/apache\/cgi-bin\/mt\/lib\/MT\/App\/CMS.pm<\/b> ).<\/p>\n<p \/><\/li>\n<li>the array in question is called <b>@c_data<\/b> and somewhat disturbingly has a hard coded length:\n<pre>$iter = MT::Comment->load_iter({ blog_id => $blog_id },\n        { 'sort' => 'created_on',\n          direction => 'descend',\n          limit => 5 });\n    my @c_data;<\/pre>\n<p>See that 5?  that&#8217;s our puppy!<br \/>\n<\/lI><\/p>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>We had some problems with comment spam recently so we wanted to see more comments at the same time&#8230; We could have just made a new plugin, or found one already written, and used it in a new index, but then we&#8217;d have to rebuild the thing every time we needed to find spam. So, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-5127","post","type-post","status-publish","format-standard","hentry","category-looky"],"_links":{"self":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts\/5127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5127"}],"version-history":[{"count":0,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=\/wp\/v2\/posts\/5127\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5127"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ikillspies.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}