« PHP passing a variable | Main | CRON Jobs »

Closing old comments

If you have PHP enabled and a MySQL database, you can use this closecomments php file.

Keep in mind - this puppy is going to close the comments on your entire database - meaning every single blog that's on that installation using that database.

Step 1: As always, Unzip the shit.

Open the file in a text editor and change the bold printed stuff to your own information (leave the single quotes - just change the stuff inside them):

$database = 'your_database_name';
$dbuser = 'database_user';
$dbpass = 'database_password';

Then change this field:

$closedays = 10;

Right now it says, "I'll close all comments on any entry older than 10 days". You can change that "10" to whatever number you want.

Save the file and upload it to your main directory. File permissions should probably be 755 (can't hurt, right?). Then call it by going to it.

http://www.yourdomain.com/closecomments.php

After you're done and it says it closed them, you'll have to rebuild your blog.

You can download the file here.

CLOSECOMMENTS.PHP V1.1 by Kevin Schumacher (www.geeksblog.com)

Comments (5)

ASB:

wait...this file contains your DB password...anyone can get it, see it????

ASB:

and another thing...it doesn't seem to close comments within category pages...how come?

ASB:

and one more thing...do you have to run this every now and then or is it automatic?

Any chance you'd be willing to put up a tutorial (or gimme a call--I can e-mail my phone number) to help me create another blog from MT?

Iki:

You have to run this manually.

If you don't want your information out there, upload the file, run it, then get rid of it until next time.

I'm redoing this tutorial to make it WAY more difficult but completely automated.

I'd be happy to post a tutorial showing how to create a blog. But I'm not taking phone requests. My ears hurt. :cheesy:

About

This page contains a single entry from the blog posted on October 27, 2004 10:30 AM.

The previous post in this blog was PHP passing a variable.

The next post in this blog is CRON Jobs.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.35