|
Cookbook /
HaloScanSummary: Another commenting recipe, leveraging the power of the HaloScan service.
Version: 0.1
Prerequisites:
Status: first release ... but operational!
Maintainer: EuGeNe Van den Bulke http://www.3kwa.com
Questions answered by this recipe
DescriptionWant to allow you user to comment and tracback on your site without too much trouble? Try leveraging the power of Haloscan and web services dedicated to doing just that and doing it right! It is as simple as typing NotesThis recipe lives on http://www.3kwa.com/Tutorial/HaloScan and plays well with Logbook which lives on http://www.3kwa.com/Tutorial/Logbook. Release Notesversion 0.1 has been released on the 17th of June 2007 it is running on http://www.3kwa.com in every Logbook entry.
CommentsThis tutorial is great, but it doesn't quite work with Balu's blog method due to the blog overview (list of pages) and actual (permalink) pages having different addresses. For example, on the overview page ('Blog.HomePage' for me), every comment link has that overview page as its name/id. To correct this, I first removed the
Markup(
'haloscan',
'directives',
'/\\(:haloscan (.*):\\)/e',
"Keep(haloscan('$pagename', '$1'))"
);
Could have just replaced $pagename with $1, but I like having the pagename for possible future expansion. Next, change the haloscan function to the following:
function haloscan($pagename, $name) {
global $HTMLHeaderFmt;
$HTMLHeaderFmt['haloscan'] = '<script type="text/javascript"
src="http://www.haloscan.com/load/$HaloScanUsername"> </script>';
$comment = "<a href=\"javascript:HaloScan('$name');\" target=\"_self\">
<script type=\"text/javascript\">postCount('$name');</script></a>";
$trackback = "<a href=\"javascript:HaloScanTB('$name');\" target=\"_self\">
<script type=\"text/javascript\">postCountTB('$name');</script></a>";
return $comment . " | " . $trackback;
}
Notice that adding
(:haloscan {=$Name}:) <-- for BlogOverviewTemplate
(:haloscan {*$Name}:) <-- for BlogDetailTemplate
This now appears to work perfectly. -- pjv, Thursday 4th October, 19:17 GMT See AlsoContributors |