scriptygoddess

21 Mar, 2003

Comment Leaders and UPDATE statements

Posted by: kristine In: MT hacks

Brenna released a new version (0.3) of the CommentLeaders plugin and so while I was up last night, I did some tweaking to make my list work a bit better. This tip would also be helpful if you are using the version from this site: Scripts: Show recent comments WITH total comments from that comment author (which is based on Comment Leader Board with PHP and MySQL).

See, when you've been blogging for as long as me, your blogging friends tend to have changing email addresses over the years and so it makes it hard to tally the top commenters! And besides, I have blogger and greymatter posts in there, and the GM posts didn't require email address, so I have a lot of empty posts.

So I did some UPDATE statements in my MySQL database to make the newest addresses apply to all posts by that author. It took a little browsing through the database to see which ones needed changing, but I think I've got most of it. I didn't bother changing any other information about the authors, just the email address for grouping correctly in the plugin output.

Here's some examples in case you'd like to do some condensing too…

I used PHPMyAdmin (available on my blogomania server) to enter my queries. You'll want to get into your MT database within PHPMyAdmin and then browse to your mt_comment database to see which of the following will work for the users you want to condense. Then when you've figured it out, look for a Run SQL query box to paste the code into. If its successful, it will report back how many lines changed in your database.

When commenter has changed email address:

UPDATE mt_comment SET comment_email = "newaddress@blog.com" WHERE comment_email = "oldaddress@blog.com"

When commenter has changed email addresses multiple times:

UPDATE mt_comment SET comment_email = "newaddress@blog.com" WHERE comment_email = "oldaddress@blog.com" OR comment_email = "olderaddress@blog.com"

When commenter has multiple email addresses, and is the only commenter with that name in your database (ie, this wouldn't work for the name Christine, since there are at least 3 Christines in my database)

UPDATE mt_comment SET comment_email = "newaddress@blog.com" WHERE comment_author = "UniqueName"

When commenter has multiple email addresses and multiple names that they've posted under:

UPDATE mt_comment SET comment_email = "newaddress@blog.com" WHERE comment_author = "Nickname" OR comment_author="Fullname"

18 Responses to "Comment Leaders and UPDATE statements"

1 | alisa

March 24th, 2003 at 5:40 pm

Avatar

at this point i'm not even sure how i found your site but i've been desperately trying to figure out how i can add comments to my personal journal without using blogger, xanga, livejournal etc… i've found random scripts but none of them seem to be exactly what i'm looking for. i hope you can help me. thanks fo much :-)

2 | Lisa, Gal of Unix

April 27th, 2003 at 8:54 pm

Avatar

Geez, PHPMyAdmin is waaay easier to use than command line stuff. 😉 Thanks for the eye opener, Ms Kristine!

3 | jane

May 5th, 2003 at 1:38 pm

Avatar

is it possible to use the comment leaders plugin without upgrading to 2.63? i am scared of upgrading.

4 | jane

May 5th, 2003 at 1:39 pm

Avatar

sorry, i am crazy. i just found it. oops!

5 | Christian

June 27th, 2003 at 12:59 am

Avatar

hello, I am using this comments leader board plugin.. i comment on my site to respond to others who've commented. The thing is I don't want my name to be listed in the board.. is there a way I can "ignore" my comments so my name won't be counted? thanks!

6 | Jake

August 22nd, 2003 at 3:58 pm

Avatar

Thank you, this is a very big help!

Keep up the great work.

7 | Mark Carey

October 24th, 2003 at 10:28 am

Avatar

I'd like to try the CommentLeaders plugin, but the download link on mt-plugins.org is broken. Can someoen email me version 0.4 (or newer, if there is a more recent version) or point me to an alternative download location? Thanks.

8 | Hessel

October 27th, 2003 at 12:25 pm

Avatar

Mark, I have the same problem. If you find any mirror, please let know.

9 | Mark Carey

October 27th, 2003 at 12:31 pm

Avatar

Hessel, I did receive the plugin via email. I can send it to you – send me an email at mark@markcarey.com.

By the way, I have installed the plugin and I am using it with my "Forum View" MT templates. I know display the number of each member's forum "posts" (comments) below their names. Here is an example.

10 | kadyellebee

March 21st, 2003 at 4:39 pm

Avatar

commenters
While I was up last night, I played with the commentleaders plugin until I got it working all happily! So

11 | Neurotic Fishbowl

March 21st, 2003 at 6:51 pm

Avatar

Correct Comment Leaders
Thanks to Kristine's simple instructions over at Scripty Goddess, I made a few queries in my PHPMyAdmin and combined e-mail

12 | As deep as a puddle after a hard rain

March 26th, 2003 at 1:35 am

Avatar

Wordy
Because I can't stop touching … the site that is. Goodness. What are you people thinking? Anyway.. I've added the Comment Leaders plugin. You can see the top fifteen commenters on the left hand sidebar. Right now it's pulling in people by name. Not t…

13 | As deep as a puddle after a hard rain

March 26th, 2003 at 1:38 am

Avatar

Wordy
Because I can't stop touching … the site that is. Goodness. What are you people thinking? Anyway.. I've added the Comment Leaders plugin. You can see the top fifteen commenters on the left hand sidebar. Right now it's pulling in people by name. Not t…

14 | Internal: Talking to Myself

June 19th, 2003 at 11:10 am

Avatar

Wowsers
Sometimes, I manage to do things I was certain I'd screw up, and I just amaze myself. I have Girlie's Comment Leader Board on my Portal page. I had a couple of girls who'd changed URLs, and one name change….

16 | Procrastination

July 18th, 2003 at 7:25 am

Avatar

Importing Comments
You might have noticed that the "Most Comments" on the sidebar have changed drastically since yesterday. That is because I was finally able to import all my Haloscan comments. Gabriel Misura has written the Perl code required to import comm…

17 | In Nancy's Book

February 3rd, 2004 at 1:12 am

Avatar

Tidy database
I spent a few hours cleaning out the comments…meaning, the comment leaders (chatty folks) should now be correct. I added…

18 | Sideblog

April 4th, 2004 at 3:43 pm

Avatar

http://www.mamawrite.com/sideblog/002255.html
Updating database when commenter changes email…

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements