Script: List-recent-comments (GM, PHP and perl)

domesticat's picture

At long last (read: I finally asked Gareth how to do this) I’ve finally managed to sit down and write a greymatter modification that generates an external file with data about recent comments. I’ve currently got it set up to generate five results, but it can be customized for as many or as few comments as your little journaling heart desires.

As usual, it made perfect sense once I finally gave up and said to Gareth, “How in the world do I do this?” He gave me five lines of explanation, and that turned out to be all I needed.You can pick up a copy of the recent-comments.zip file here. It contains a code snippet to add to gm-comments.cgi, as well as directions on how to modify the final PHP output.

Now that this is done, I can finally do what I’ve wanted to do for ages—enable comments on all posts over on geek-chick.net. Let the madness begin.

gfmorris's picture

w00T! Now, the question is, can I take the code snippet that's inserted into gm-comments for the next GM upgrade?
domesticat's picture

I'm not so certain that it's a good idea to make this a part of the standard package. The path to the data file has to be edited. Oh, I suppose you could just drop it in the cgi-bin directory and be done with it, but here's the key...the second part of the mod requires PHP to decode the data file. Thereby implying that you've gotta have PHP to run GM, which isn't the case. You just have to have PHP to run 99% of the mods that I write.
gfmorris's picture

Well, we could do some code remangling in porting the thing from a PHPish way to a Perlish version.
passer by's picture

Awsome .. thx.
Maggie's picture

Hi there, I am trying to implement this code on my daughter's site at http://brie.divamaggie.com . My question is...where I have to put $comment_logfile="/path/to/your/recent_comments.php"; would it be "/divamaggie/brie/recent_comments.php" ? as http://brie.divamaggie.com is where the main index is located. Is this file recent_comments.php the new file that must be created and CHMOD'ed to 666? I'm just not certain how to enter the path correctly in gm-comments.cgi , recent_comments_display.php and whether or not there is a blank file to be made called recent_comments.php. I would really appreciate your help in this regard.

Post new comment

User login

Recent comments

  • Anonymous 5 days 6 hours ago [view]
  • albert (spain) 3 weeks 5 days ago [view]
  • Kelly | Mens Suits 4 weeks 2 days ago [view]
  • Anonymous 5 weeks 1 hour ago [view]
  • Suzanne Nelson 5 weeks 3 days ago [view]

Search

Hello, anonymous!

If you're seeing this, you're not logged in. A lot of content here is only visible if you're logged in, and comments by anonymous users are held for moderation. Consider getting an account to save yourself some frustration?

domesticat.net

is the home of Amy Qualls-McClure since 2000. She is a Drupal / quilt geek in Huntsville, Alabama. One spouse, two cats, no kids, lots of opinions.

Public account for work and Drupal stuff: Private account for friends and personal life:

me on plurk me on drupal.org my music habits on last.fm my photos on flickr my bookmarks on del.icio.us my bookmarks on pinboard.in Amy Q. on foursquare what I'm reading

Some content is locked. Copy these links AFTER logging in for a query string giving you full feed-reader access:

Atom feed, entries RSS feed, entries RSS feed, comments