scriptygoddess

19 Apr, 2003

Comment leaders for the current month

Posted by: Lisa In: How to's

This is a variation of Girlie's Comment Leaderboard. I've seen other people who show the comment leaders for the last 30 days, but I decided I'd rather show the leaders for the current month.

Here's the code. The items bolded and underlined need to be changed to reflect your blog settings.

<? include ("/path/to/your/connection/file/connect.php");

$leaders = mysql_query("SELECT comment_email, comment_url, comment_author, COUNT(*) as comment_count FROM mt_comment WHERE (comment_blog_id=1) AND (comment_email!='you@yourdomain.com') AND MONTH(comment_created_on) = MONTH(CURDATE()) AND YEAR(comment_created_on) = YEAR(CURDATE()) GROUP BY comment_author, comment_email ORDER BY comment_count DESC LIMIT 10");

while($row = mysql_fetch_array($leaders)) {
while (list($key,$val) = each($row)) {$$key = $val;}
if (!empty($comment_url)) {
$authorlink = "<a href=\"$comment_url\">$comment_author</a>";
} elseif(!empty($comment_email)) {
$authorlink = "<a href=\"mailto:$comment_email\">$comment_author</a>";
} else {$authorlink = $comment_author;}
echo "$authorlink ($comment_count)<br />\n";
}
?>

/path/to/your/connection/file/connect.php = location of your connect.php file
1 = your blog ID
you@yourdomain.com = your email address (so that your comments aren't counted)
10 = number of leaders to show

Update: I added ", comment_email" to the "GROUP BY" section so that it will group by name and email address and not lump people who leave comments with the same name together.

15 Apr, 2003

404 Search Page…

Posted by: Jennifer In: Bookmarks

Erik created a wonderful 404 search function. It requires only PHP.

This explains what it does.

I think this one would be a useful feature to add to scripty…

[Thanks Etan for the tip!]

Update 4/25 – as you can see in the comments section here, there's some debate about this script. While I'm still leaving this post up here (because I think this script COULD be made to work better), but based on this story, I do not recommend installing it until then (or unless you're really sure you know what you're doing).

14 Apr, 2003

prevent duplicate comments

Posted by: Jennifer In: MT hacks

Here's an MT hack that will prevent double comment posts.
[saw it at Lisa's]

(You can see the comment thread in the last post, but that Javascript method of disabling the button will not work – so this is rather timely!) 😀

13 Apr, 2003

Disable button after first click

Posted by: Jennifer In: Bookmarks

Here's a neat trick using javascript to disable a button after it's been clicked once (so you avoid double posts – or in their example, double payments)

NewzCrawler came with a default feed of "javascript tip of the day" which is where I found that…

update: seems there's some problem with actually getting that to work with the MT form. If you get it to work, please post how you did it, or email me, and I'll post another update.

12 Apr, 2003

Making your site RSS friendly

Posted by: Lisa In: How to's

I was going to post this here, but it seemed less appropriate the more I wrote.

You can read the whole post on my site.

Here's a summary of what I wrote on my blog:

Now that you've gotten your RSS feed(s) set up, it's a good time to check out your site from the viewpoint of someone entering your site via an RSS reader.

1. Figure out where your RSS feed is sending your readers. Look at the <link> tag for your entries. I find that linking to the individual post is the best/easiest place to send your readers.

2. Once you know where you're readers are being sent, look over this page. Does it have links for next and previous? Can your reader get back to your front page easily?

3. Are the comments easily readable? If you link to the individual post, it's really handy to just display the comments there (I like oldest comments at the top). A link to the comments works as well, but it's more clicks for your reader.

4. Is it easy for your reader to leave you a new comment? Because that's probably why they left their cozy newsreader.

5. Now, look at that page. Should you add some of the lnks that you have on your front page to these other pages? Again, it depends. When I go to a blog from my newsreader, I don't usually hit the front page. Just the pages with posts that caught my eye.

If you have any questions, please let me know.

12 Apr, 2003

RSS 2.0 for pMachine

Posted by: Lynda In: pMachine

This is a very simple hack that will allow you to output your index.xml into RSS 2.0 instead of .91.

All you have to do is download this file and replace the rss.cp.php with the same file in your pmachine directory cp/rss.cp.php

Please note that according to Rick this hack will become obsolete in pMachine version 2.3 as that version will have MANY more options allowing you to create one or many RSS feeds.

If you just can't wait that long (like me) then this hack is for you.

I don't think RSS feeds are available with the free version of pMachine, so you might want to check that out.

12 Apr, 2003

Happy Birthday Scriptygoddess

Posted by: Jennifer In: Announcements

A year ago today I started scriptygoddess as a place to keep notes of things I learned about scripts (javascript, php, etc) and CSS and it's grown to be so much more. Thanks everyone for making this site the resource that it is.
1yrBirthdayGraphicScripty.gif

11 Apr, 2003

On This Date in History

Posted by: Christine In: pMachine

Just a week or two ago, my friend Kathy was commenting on how she can find MT plug-ins, but she's a pMachine user and she is often on the lookout for more pMachine Add-Ons. I noticed that Lynda has released a pMachine Add-Ons to display "Today in History" and I thought it would be great to share here too!

Comments Off on On This Date in History

08 Apr, 2003

WordPress – Coming Soon!

Posted by: Christine In: Bookmarks

PhotoMatt, recent guest author here at ScriptyGoddess, asked for help in naming a new blog software. (New is a relative term, because it is based on b2. Open source code is goooood.) After thinking about it, I suggested "WordPress" – and I am really excited to see that it is coming soon! PHP and MySQL goodness, plus so much more. I can't wait to test it out!

07 Apr, 2003

Passing Along Your License

Posted by: Christine In: Bookmarks

Mike of WOIFM has written a great post on how to include your copyright license information in your RSS Feed for your site. Great information, and you can read all about it here.

If you need help setting up your RSS feed to be the best on the blog block, you can read about that right here and here on ScriptyGoddess.

Comments Off on Passing Along Your License

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