Setup trackback - Blog entry page
15 August 2009
The blog page needs to show the trackback URL, for people sending a trackback to use, and also display the current trackbacks for this page.
Near the bottom of a lot of blog entries you'll often find a comments area.
Because trackbacks are another way of interacting with the page they're usually found around the same area as the commenting area.
It should show the current trackbacks – like this code that I use:
$track_result = mysql_query($track_query);
if (mysql_num_rows($track_result) > 0)
{
while ($track = mysql_fetch_array($track_result))
{
}
}
You will probably need to change some of the query string as you may not be passing in the same variables as I have already set.
$blog['id'] needs to be the id for the blog entry so that it only shows the trackbacks for that one blog entry.
Showing the trackback URL for a particular blog entry can be done by:
$trackback_page = “trackback.php”;
$trackback_url = $site_url . $trackback_page . “?id=” . $blog['id'];
As you can see because of the $blog['id'] variable, every blog entry will have a unique trackback URL address.
http://www.peternichol.com/entry/trackback/133/
Please leave a comment using the form provided.