Archive for April, 2003

ASP 101

Wednesday, April 30th, 2003

I’m currently in training this week for ASP (and finally we’re done with “review” - very long story). While little of this is useful for blogs, I still wanted to document what I’m learning. Here are my notes from class:
(this is a VERY VERY long post.)
(more…)

Posts and comments feed

Sunday, April 27th, 2003

This is not Jennifer’s feed. This feed was put together by Brad, .NET Guy.

This feed contains your 10 most recent posts as well as your 20 most recent comments. The difference between this and Jennifer’s feed is that if someone comes by and comments on a post that’s not one of your 10 most recent, your readers will still get to see the comment.

Please read more on my site. I have 2 variations of this feed available there for download.

Trackback ping fix

Sunday, April 27th, 2003

Samuel and I were talking the other night. We both use the SimpleComments plugin (combines Comments & Trackbacks in the same area).

We’d both noticed that pings don’t show up immediately unless you re-save the entry, so Samuel wrote a patch for it. The patch is written for MT 2.63 and is very easy to install (see his post for instructions).

Password Protection

Tuesday, April 22nd, 2003

VERY basic password protection script. It’s based off ONE username/password set. Pages that are protected by the password maintain a “session cookie” with the encrypted username and password.

Here’s the download
(Requires the use of PHP on all pages that will be password protected)

Testing on this script has been minimal. (Hey, its free!)

Comment leaders for the current month

Saturday, April 19th, 2003

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.

404 Search Page…

Tuesday, April 15th, 2003

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).

prevent duplicate comments

Monday, April 14th, 2003

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!) :D

Disable button after first click

Sunday, April 13th, 2003

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.

Making your site RSS friendly

Saturday, April 12th, 2003

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.

RSS 2.0 for pMachine

Saturday, April 12th, 2003

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.