Skip to content

Grouping Your WordPress Blog Comments By Type: Comments, Trackbacks And Pingbacks

First, my apologies for the extended period of time off I took from this blog. There’s no great scandal behind the break I took; my health and humor are just fine. As Technorati notes, somewhere around 95 percent of blogs haven’t been updated in three months; I just kind of fell into that groove. But I’m back on task now, and hope to post something every day again.

Part of the benefit of blogging is getting comments and other sorts of feedback. Quality feedback is a huge help to bloggers; I want to know that what I have said actually resonates — or, failing that, at least whether what I wrote actually works for most people.

I also like having clear links within my posts that interrelate various posts on a topic: Not only links to earlier postings, but especially links to later posts, that may build on a theme.

WordPress, thankfully, is built around a fairly robust commenting system. In addition to now supporting threaded comments (that is, you can see a “ladder” of comments and replies to comments), WordPress can also handle pingback and trackback links.

Out of the box, WordPress commingles comments, trackbacks and pingbacks, by order of most recent to least recent. That’s fine, but I like the idea of grouping post feedback by type: Namely, I want to give precedence to comments left specifically on the blog, with external and internal hyperlinks grouped together, after the comments.

With a little hacking of the comments.php script in your theme, you can easily break your trackback / pingback links out from your comments, and place them either before or after your comments.

Continue reading ‘Grouping Your WordPress Blog Comments By Type: Comments, Trackbacks And Pingbacks’ »

Blog Update: New Anti-Spam Plugin May Block Legitimate Comments

As this blog has gotten more popular and, as a result, started ranking well with Google, the spamming here has become incessant — to the point where faithful, reliable, old Akismet alone isn’t good enough.

Akismet has caught nearly 16,000 spam comments here in just under three years, and only accidentally labeled three comments as spam (see details, PDF). So sure, I could just purge the Akismet moderation queue every time I log in to the admin section.

But I don’t like the idea of visitors here possibly being labeled as spammers, without being told, no matter how unlikely that is to happen. And because of the way WordPress stores comments, emptying the Akismet moderation queue leaves a lot of MySQL overhead.

So I’ve decided to use WP-SpamFree to augment Akismet. And what that means to you is, if you disable JavaScript and cookies, or visit this site via a proxy server, you cannot comment here.

Continue reading ‘Blog Update: New Anti-Spam Plugin May Block Legitimate Comments’ »

MSDN Northeast Roadshow: Sept. 24 in Augusta, ME

The MSDN Roadshow returns to Augusta, ME and the Central Maine Commerce Center’s Florian Auditorium on Sept. 24, from 1 p.m. – 6 p.m. (That’s a later start than recent roadshows, because directly before it, there’s a TechNet event about Windows 7 and Remote Desktop.)

MSDN Roadshows are a chance for Microsoft evangelists — namely, Chris Bowen and Jim O’Neil — to describe new technologies, demonstrate how to program in Microsoft languages and platforms, and generally share the word about what’s new and on Microsoft’s mind at the moment.

Among the issues to be discussed at this roadshow is Windows 7. Without question, Chris and Jim know their stuff, and you’ll definitely walk away from this event with a better knowledge of Microsoft technologies — if not some of the loot they give out at every event (fully-functional copies of Windows Vista, Visual Developer 2008 Professional, Microsoft Press books and peripherals having been offered in the past as door prizes).

Florian Auditorium and the Central Maine Commerce Center are in the former SCI Systems / Digital Equipment plant off Civic Center Drive. I have a public Google Map of the location.

If Augusta or the date are not convenient for you, Chris and Jim are doing the same agenda in Manchester, NH; Rochester, NY; Troy, NY; Waltham, MA and Farmington, MA. Chris Bowen details it all on his blog.

New URL For ASP.NET Demos: dougv.net

The process of retiring / removing my Yahoo!-related handle continues. The latest step: a new URL for ASP.NET demos, which are hosted on another server.

From here on out, my ASP.NET demos will be hosted at dougv.net. This replaces the former URL, dhvrm.com.

I’ll leave dhvrm.com running for a while, but please correct your bookmarks as that domain is subject to removal at any time without further notice.

Dynamically Changing Your Child Page Titles With ASP.NET Master Pages

The primary benefit of ASP.NET master pages is the ability to apply code, themes and templates to child page content. But for some reason, Microsoft did not build in an easy way to concatenate a child page’s title to the master page title.

Consider, for example, dougv.net, my ASP.NET demo site. I want it to take the same titling method as this blog: That is, the title of the page, followed by the domain and the slogan / motto / description of the site.

In the WordPress system, that’s as simple as echoing out some constants in your template file. But there’s no specific control in ASP.NET to set a page title: At least, not a page-based control. You have to hand-code your page titles, and you do that at the child page level — in other words, whatever title you give the child page, that’s the name that shows.

So, if you want to append a slogan or other bit of static text to every page, ostensibly, you’ll need to hard-code it on every page.

Fortunately, we can use server-side code in our ASP.NET master page to append a static bit of text to every page title covered by that master page. All we need to do is capture the hand-coded title of the child page (conveniently, referenced by the Page.Title property), append the text we want to have on all URLs, and then reset the Page.Title value to be the concatenated string.

Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) Handles Me.Load
	Page.Title = Page.Title & " » dougv.net » Doug Vanderweide's ASP.NET demos"
End Sub

Continue reading ‘Dynamically Changing Your Child Page Titles With ASP.NET Master Pages’ »

Calculating The Bearing And Compass Rose Direction Between Two Latitude / Longitude Coordinates In PHP

A comment recently made to my blog post, “Getting All ZIP Codes In A Given Radius From A Known Point / ZIP Code Via PHP And MySQL“:

Does any one know how to work out the bearing from one set of coordinates to another.

For example, if the calculated bearing was 90 (degrees) the using if statements to see if a coordinate was between two parameters I could return North, North East, East and so on?

Thanks in advance.

Matt

Fortunately, the same article at Movable Type Scripts that fed the original post, also gives us formulas for calculating rhumb-line and great-circle bearings between two known points.

Rhumb Line Bearings Versus Great Circle Bearings

A rhumb line is a line of constant bearing, that crosses all meridians (longitudes) at the same angle. In other words, were we to lay down a map, with Points A and B marked on it, and draw a straight line connecting them, that’s a rhumb line.

But remember, Earth is not flat. Usually, the most efficient (i.e., the shortest) way to travel across it is an arc, especially when the distances to be traveled are long; and when we do so, the bearing of our travel isn’t constant, and we don’t start out traveling directly toward our objective.

Therefore, if we determine the great-circle bearing from Point A to Point B, we’re actually getting an initial bearing of travel toward Point B; that bearing only remains valid for some distance, until we get to some other point (usually, the next meridian), at which point we need to recalculate the bearing to Point B, based on where we are.

Distance, rhumb line vs. great circle

Continue reading ‘Calculating The Bearing And Compass Rose Direction Between Two Latitude / Longitude Coordinates In PHP’ »