scriptygoddess

12 May, 2002

PHP/MT/GM: Subscribe to Comments (Release)

Posted by: Lynda In: Scripts

Leaving this post here for archival purposes – but the latest version of the script is now in cgi format – find more info here

Current Revision: 1.2b
05/12/02

WHAT THIS DOES:
Allows visitors to subscribe to any post's comments. A "mailing list" for that post will be created the first time someone subscribes to the list and an email will be sent to that list each time a new comment is posted. A visitor can subscribe/unsubscribe WHILE leaving a comment or separately.

UPDATE 5/12: A minor problem was found in the emailtolist.php causing some strange behavior when previewing comments (adding slashes and the like) If you downloaded the previous version, download the new version and simply replace emailtolist.php with the old one. Let us know if this does not fix the problem!

Continue onward for directions and downloads (at bottom of the post)

See the readme.txt file for full directions for installing this script fresh or upgrading from the previous version.

WHAT YOU NEED:
? PHP 4.1 or later
? Moveable Type or Greymatter

ANYTHING I NEED TO KNOW?
? You do not need to change your site files to a php extension, you only need to be able to run php on your server.
? Moveable Type specific: One thing Jenn and I ran into is that the your form MUST be named "comments_form". I believe that' the default in MT, but if your says something different or nothing at all, you will need to change it. If you have the "remember me" script going, that might cause a problem. If you don't know how to change the javascript calling up the cookie for Remember Me, let us know and we'll help you out.
? Jenn ran into some weird hidden field in her form (which isn't on the default) named input type="hidden" name="post" Check your form to make sure you don't have this hidden value. If so, delete that line.
? If you are running the script for GREYMATTER you will be instructed to completely replace your Posting and Preview templates to avoid confusion. Let us know if you have problems.

KNOWN BUGS:
There are no known issues at this time. Please let us know if you experience any bugs.

TO DO LIST:
? Automatically notify users via email when they subscribe/unsubscribe.
? Global uninstall from comments and/or comment manager.
? Check directories in setup to make sure they exist and are correctly CHMODed
? Add optional form in setup to allow users to fill in the name of the fields if theirs differs from the default.
— Please let us know if there are any features you would like!

POSTING HISTORY:
Brainstorming
Project Status
Beta: Part 1
Beta: Part 2

CHANGE LOG:

10/12/03: bug fix to get script to look at mt's IP ban list first before sending out comment notifications. this fix needs to be done seperately!!! See here for details.

03/07/03: bug fix for safari browsers. Download updated.
(if you have the script installed already see this page for the fix)

05/12/02: Version 1.2b –
   Fixed minor error in emailtolist.php causing strange behavior when previewing.

05/10/02: Version 1.2 –
   Added e-mail list manager to mass unsubscribe from comments.
   Added skins instructions.

05/07/02: Version 1.1 –
   Fixed known bug, visitors resubmitting comment when hitting the back button
   Created a variable for Blog Name to be include in subject when comments are posted
   Cleaned up script, removed unneeded variables
   Added change log, and revision information

05/06/02: Version 1.0

DOWNLOADS:

CLICK HERE to download the script for Moveable Type version 1.2

CLICK HERE to download the script for Greymatter version 1.1 **

** NOTE: Greymatter will not be updated as there is no demand for it. It is still a fully functioning script and will work to allow visitors to sub/unsub from comments.

97 Responses to "PHP/MT/GM: Subscribe to Comments (Release)"

1 | Lynda

June 18th, 2002 at 3:13 pm

Avatar

Thanks for doing that, Jenn!

Since I'm no longer using the script (I'm using pMachine now which has its own version of subscribe to comments built in) I don't think I can support it or develop it anymore, sadly.

I will help with what I can, but since I'm not using it in application, I'm probably going to forget most of it.

2 | Mariann

June 18th, 2002 at 3:25 pm

Avatar

Ah, and I did that, plus checked with Dream Host's technical support. I have to renamed the files to PHP-CGI (.pcgi) in order for them to work! Now that I know this, I can globally search/replace all the .php references to .pcgi, per Dream Host's files. Hope it's okay to modify the script. Thanks.

3 | Etoile

June 24th, 2002 at 11:51 am

Avatar

Awesome, I seem to have gotten it right on the first try! (Though I don't seem to have gotten a confirmation e-mail…maybe it's still on its way.)

My only question is about using this with multiple blogs. I have two in my current installation of MT, and I'd like to use this script for both. I *think* I would need to install it separately on each, because it'll be looking at things like <$MTBlogName$> and all that…but if I can get away with not doing a second installation, that would be great. Is it possible, or should I just go ahead and do it?

(Hi, Mariann!)

4 | Etoile

June 24th, 2002 at 11:52 am

Avatar

Hmm, the e-mail from the comment I just posted came through, but the one telling me I'd subscribed (without posting) to my own still hasn't shown up.

5 | Mariann

June 24th, 2002 at 12:40 pm

Avatar

Meredith, I installed the script separately for each blog (my own and Wolfrunners) and it's worked out fairly well.

6 | Promo

June 26th, 2002 at 11:53 am

Avatar

I just added this, but my curiosity is getting the better of me.

Has anyone coded a page to read which comments have subscribers, and who they are?

Kinda like checking your referrers, it'd be fun to see which posts are popular.

7 | Lynda

June 26th, 2002 at 11:57 am

Avatar

It would be very easy to do if anyone would like to take this project over. I'm not using MT anymore which makes developing for this add-on sort of difficult.. :)

8 | Jason

August 2nd, 2002 at 10:13 am

Avatar

Awesome package! Great installation inscructions. Thanks.

9 | Donna

August 21st, 2002 at 5:21 pm

Avatar

This seems to be rocking along – thanks, Jenn and Lynda! (And I agree with Promo, I'll be curious about who's subscribing to what…)

10 | Shannon

August 29th, 2002 at 11:13 pm

Avatar

I recently added this to a blog and everything worked fine except that the comment didn't post. The test comment didn't make it past the email that was sent out. (Which went out perfectly, I might add.)
Any ideas for this php illiterate and ignorant soul?

11 | Shannon

August 29th, 2002 at 11:39 pm

Avatar

Nevermind. I figured out my problem. I had also put mt.cgi in my path to mt but I didn't catch it during the test because I subscribed without posting and then made a post.
Thanks for the script and for the chance to ask for help though. :)

12 | Merlot

September 11th, 2002 at 4:20 pm

Avatar

To the Goddesses who have worked so hard …

It's a fantastic script. I downloaded the MT version, followed the directions and everything went as planned. It works GREAT. Many many thanks!!

I do have a script error on the page as noted by IE6, but that could be from removing the remember me cookie improperly. I will have to look around and see if any one else has this error. Thanks again!

13 | David

September 15th, 2002 at 11:28 am

Avatar

You so rock!

Thank you so much for creating this wonderful script and making it available to the blogdom.

14 | alba

October 24th, 2002 at 3:07 am

Avatar

i'm a bit of a johnny come lately to this but i just installed it on my MT blog and it works great…

except that when i tested a comment submission that was lacking required filed the script processes it and my normal error page comes up.

so whomever subscribes to this post will get a mail with the incorrectly submitted comment.

how do i fix this?

15 | Hnk

November 21st, 2002 at 6:01 pm

Avatar

Warning: fopen(" /home/1512/nedr/www.nedrichards.com/public_html/hnk/scriptfiles/commentsubscribe/1282.txt", "a") – No such file or directory in /home/1512/nedr/www.nedrichards.com/public_html/hnk/scriptfiles/functions.php on line 29

Warning: fopen(" /home/1512/nedr/www.nedrichards.com/public_html/hnk/scriptfiles/commentsubscribe/subscriptions.inc", "a") – No such file or directory in /home/1512/nedr/www.nedrichards.com/public_html/hnk/scriptfiles/functions.php on line 35

Warning: Failed opening ' /home/1512/nedr/www.nedrichards.com/public_html/hnk/scriptfiles/processing.tmpl' for inclusion (include_path=") in /home/1512/nedr/www.nedrichards.com/public_html/hnk/scriptfiles/emailtolist.php on line 38

That cannot be good…. *looks worried*

16 | Jennifer

November 21st, 2002 at 6:13 pm

Avatar

At first glance – those kinds of errors uaully mean that either the directory doesn't exsist – or the script was supposed to be able to create it and the folder didn't have the right chmod… Can't really guess what the problem is without more info…

17 | alba

December 10th, 2002 at 8:40 pm

Avatar

hi lynda,

i've just added subscribe to comments but it seems to be messing with my 'remember me' function.

could you look at http://www.ericalba.org and also and let me know how i can fix it?

18 | alba

December 10th, 2002 at 8:51 pm

Avatar

my last post biffed, also look at http://www.ericalba.org/photo/archives/002164.php#002164
and check out the code and see if i did something wrong.

the subscribe works, the 'remember me' don't.

19 | Jennifer

December 11th, 2002 at 4:19 pm

Avatar

Alba, a possible reason why your remember me doesn't work anymore is because of the way you're calling up and placing the remember info… the code you have is:

document.forms[0].email.value = getCookie("mtcmtmail");
document.forms[0].author.value = getCookie("mtcmtauth");
document.forms[0].url.value = getCookie("mtcmthome");
if (getCookie("mtcmtauth")) {
document.forms[0].bakecookie[0].checked = true;
}else {
document.forms[0].bakecookie[1].checked = true;
}

you see that "forms[0]" part? You've added another form to your page so forms[0] means it's going to look for the first form in your page (which is actually your "photo archives" select box. (So this is actually completely unrelated to the subscribe thingy)

In any case, if you explicity state which form you're referring to in that remember me code, it should work… so instead of:

document.forms[0].email…etc.

make them all say:

document.comments_form.email…etc…

or

document.comments_form.author…..

("comments_form" is what you have named your comments form… you can see it in the <form> tag itself … name="comments_form") Make sure you leave the "." where they're supposed to be… just change the text

Probably more information than you asked for, but maybe it helped explain what was going on… :)

(email me if you still need help)

20 | Jennifer

December 11th, 2002 at 4:22 pm

Avatar

Make sure you leave the "." where they're supposed to be… just change the text

That was referring to the javascript code… NOT what was in the form tag… just wanted to clarify…

21 | alba

December 11th, 2002 at 8:38 pm

Avatar

jennifer, that fixed the photolog blog, i'm still having a bit of a prob with the ericalba.org blog.

more information than i asked for is great, how else ami gonna understand this stuff.

it's a great script, btw.

22 | alba

December 11th, 2002 at 8:40 pm

Avatar

update: the ericalba.org blog comment form only remembers the url (but not the name and email) so i'm 33.3% if the way there. still trying to work it out.

23 | alba

December 11th, 2002 at 11:24 pm

Avatar

All Fixed! Thanks!

24 | AJ

January 26th, 2003 at 4:34 pm

Avatar

Hey girls!
This is a great script! I am now implementing it on my new site I am designing, but it doens't work completely:
Commenting goes pretty well, but I never receive any e-mails with posts. I have posted comments from arno@sindono.com as well as test@sindono.com (which doesn't actually exist). These are stored in a proper 1.txt file, but I don't receive any mails…

how to fix this? I don't know where to look, because I don't see any error messages.

25 | faiz

January 29th, 2003 at 3:37 pm

Avatar

Good mooring nice site

26 | Brian McGroarty

February 14th, 2003 at 3:34 pm

Avatar

Hey hey – thanks! This is exactly what I need. I'll look at it this weekend. :-)

27 | Jake

February 15th, 2003 at 2:38 pm

Avatar

Great Mod! Keep it up! Anything more coming out for greymatter ?? !!!

28 | filou

February 24th, 2003 at 7:16 pm

Avatar

I've edited the html (by putting in the default as subscribe) so that whenever someone comments they are automatically subscribed to the entry

Is there any problems with this? As far as I can tell noone is getting multiple emails when commenting (and being subscribed once more) to something they have commented previously.

It seems to kinda work, but for some reason I cannot get to the webpage where the subscribe/unsubscribe can be done via the email address. However I am unsure whether this is related to the "edit" or not. When the email address is entered and the button pressed, it just reloads the page.

Another problem is emails are being sent inconsistently with some people's emails not triggering the script to send the email and as far as I can tell there is nothing extraordinary about those emails and they are receiving emails of other "commentors"

anyone else done this, or experiencing these symptoms?

29 | Casey

March 2nd, 2003 at 8:26 pm

Avatar

I set up this script but when I hit "post" I get returned to my home page in the popup window and I'm not subscribed. Anybody know what could cause this?

The error page is: http://www.caseyscasa.com/photos then click on comments

30 | Jennifer

March 2nd, 2003 at 9:25 pm

Avatar

Perhaps you have some kind of htaccess set up to redirect anyone going into either your "mt" folder or the "comments" folder (where you apparently have all the script files) to your home page?

(Please note that if you set the htaccess on that "mt" folder – it applies those rules to all SUBDIRECTORIES too)

31 | Casey

March 2nd, 2003 at 10:38 pm

Avatar

No, I checked and I don't have any htaccess files in any folders. Can you think of anything else it might be?

32 | Jennifer

March 2nd, 2003 at 10:58 pm

Avatar

The only other thing I can think of is it might be a path issue… check your settings for the script…

33 | B Wooster

March 21st, 2003 at 2:27 pm

Avatar

Feature request: would be great if there was a configurable way to add a fixed list of email address that will get email every time a comment is made on a MT blog.

For example, we have four authors who work on one blog, and it is very low frequency usage (so we don't want to visit the web page everyday :-)), and it would be great if all of us got an email everytime someone posted a comment (or a new entry for that matter, but that is not what your script does, so I'll still looking for ways to do that.)

34 | teller

April 13th, 2003 at 6:49 am

Avatar

Hei,

After little bit of confusion, reading posts here and poking around the files I seem to have got it to work.

Thanks for the nice script ladies :)

35 | bhw

May 2nd, 2003 at 12:29 am

Avatar

I'm attempting to install this script, and I've been able to configure the comments-config.php configuration file.

When I go to edit my comment listing template in MT, though, I don't see the exact line of code after action= that the instructions tell me to replace.

The instructions say to find this in the form tag:
action="<$MTCGIPath$>mt-comments.cgi"

But what I see is this: action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie.checked) rememberMe(this)">

So before I screw up my comment template by guessing, which is how I usually spend my late evenings, I thought I'd check with you to make sure that I should replace that entire set of stuff after the action= with what the setup file recommends, basically a pointer to emailtolist.php.

Thanks!

36 | bhw

May 2nd, 2003 at 2:07 am

Avatar

Okay, I think I have the script working properly on my site, so please ignore my last comment.

But now I have a different question. I realized that in the subject line of the messages being sent out to subscribers displays the name of my site. I'd rather it didn't do that because the word "bitch" is in it, and I don't want people who use a work e-mail address to get profanity filtered or something.

Is there a way to configure the subject line in all messages that go out so that the name of my site doesn't appear there? I'm assuming the script is taking the site name from the MT configuration file — is that correct? I want to leave it there so that the name is correct when I ping weblogs, etc.

Thanks!

37 | Teller

July 2nd, 2003 at 11:01 am

Avatar

Just one thought – it would be really nice if in the readme.txt there was also "how to uninstall". I'll probably figure it out but that would surely save some of those nerves of mine :)

Cheers!

38 | gabe

September 18th, 2003 at 10:02 pm

Avatar

Hmmm. Why is it always me? …

This looks fantastic, and I'm really excited to get it working, but when I run setup.php, I just get this error:

"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request."

Looking in the error_log, I see:

"[Thu Sep 18 18:39:19 2003] [error] (8)Exec format error: exec of /web/live/xxxxxx.com/cgi-bin/mt/comment_sub/setup.php failed
[Thu Sep 18 18:39:19 2003] [error] [client xx.xx.xx.129] Premature end of script headers: /web/live/xxxxxx.com/cgi-bin/mt/comment_sub/setup.php"

IPs and url removed to avoid 31ee7 h4x0r attacks against my incompetence 😉

The files are all uploaded in ascii mode, they are all unix format, not dos. Permissions are set per the readme I created the commentsubscribe directory and chmodded 777 (I tried it in both cgi-bin and htdocs, just in case).

I downloaded version 1.2 from this site, and haven't touched the code in any way.

Any suggestions would be so appreciated that you wouldn't hardly believe it.

-Gabe

39 | Gabe

September 23rd, 2003 at 1:58 pm

Avatar

Problem solved – a tear down and reupload fixed it. Must've been pilot error 😉

40 | Jon

September 27th, 2003 at 1:38 pm

Avatar

I installed this script and it seems to work fine, except in cases where preview is used. I searched through this comment thread and saw a few references, but I didn't see a resolution. Here's what I'm getting when posting after a preview:

No entry_id

Any idea for why I am getting this? The only thing I did different in my installation was to not add the form section to allow folks to subscribe without posting a comment.

41 | Kevin

October 30th, 2003 at 7:12 pm

Avatar

Any word if this works with MT-Blacklist?

42 | Jennifer

October 30th, 2003 at 9:41 pm

Avatar

It SORT OF works. The comment won't be posted on the site if it's been blacklisted – but the people who have subscribed to your comments will get the notification (so they'll sort of get spammed).

43 | Jianshuo Wang

November 5th, 2003 at 11:59 pm

Avatar

So I have to modify the comment page code in my MT. Will the comment still goes to the MT comment database?

44 | Jennifer

November 6th, 2003 at 8:18 am

Avatar

Yes, it will still go into the MT database – however be aware that right now we're running into some problems with this script/hack and MT-Blacklist – and preventing comment spam.

Essentially this is what can happen: a comment spammer attempts to leave a spam-type comment – MT-Blacklist will stop it and prevent it from being posted to the site (providing it meets one of the blacklist criteria) but not before it gets sent to your subscription list. So while they don't get their spam on your site – your subscription list still gets the spam in the email.

So, if comment spam is not a problem for you – then you shouldn't need to worry. If it IS – then you might want to take that into consideration…

45 | Jianshuo Wang

November 6th, 2003 at 11:15 am

Avatar

Jennifer, thanks very much for your response. I didn't expected yet and also, it is a very good demostration of the neccessarity of your wonderful code since I may miss your comment if I didn't subscribe to the notification.

I have setup the code on my site. However, it seems I met the common problem that a lot of website owner met: The SMTP authentication problem. I only have SMTP server that requires authentication. (I am using the virtual hosting and don't control the mail configuration). So the PHP script does not work on my site. It is a big headache. I was really shocked that I didn't find any useful guide after searching on the web for about two hours.

Do you happen to know if there is any way to work with the SMTP AUTH in PHP? Thanks.

Again, the scripts you created are very useful and well written. I like the design of the setup.php too – the color looks nice.

46 | Oneida

November 10th, 2003 at 8:43 pm

Avatar

Wow, a highly functional MT mod that just slide in there like melted butter! :) You've definitely set the standard for classy mods and mod installation instructions!

Thank you, thank you, thank you!
Oneida

47 | Guyman

December 9th, 2004 at 8:52 am

Avatar

I must say that email addresses are to be displayed here cause i believe we are above scammers by faith we can move mountain.

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