You are not logged in.
Download latest version: ajw_comment_num (v0.2)
Allows for outputting current comment number.
/textpattern/publish/comment.php, as outlined in this Textpattern Forum thread (allows for plugin parsing in comments)Ideally, this is meant to be used in your default comment form. While it is possible to use this plugin with the default <ol> formatting of comments, you’ll be able to do much more fun things if you switch off numbered list formatting in admin->preferences.
<div id="comment-<txp:ajw_comment_num />">
<span class="comment-num"><txp:ajw_comment_num /></span>
...other comment form stuff...
</div>
Result:
<div id="comment-1">
<span class="comment-num">1</span>
...other comment form stuff...
</div>
Last edited by Andrew (2007-01-03 04:08:05)
Offline
I get strange numbers of comments (2,4, 6, etc.).
Need help. Thanks in advance.
Last edited by kartav (2005-03-26 05:40:50)
Offline
I have 0.2.
function ajw_comment_num($atts)
{
global $thiscomment, $ajw_commentnum, $ajw_lastcommentid;
$ajw_commentnum = (empty($ajw_commentnum)) ? 1 : $ajw_commentnum;
$ajw_lastcommentid = (empty($ajw_lastcommentid)) ? $thiscomment['discussid'] : $ajw_lastcommentid;
if ($ajw_lastcommentid!=$thiscomment['discussid'])
$ajw_commentnum++;
$ajw_lastcommentid = $thiscomment['discussid'];
return $ajw_commentnum;
}
Last edited by kartav (2005-03-24 19:41:47)
Offline
form comments
<div id="comment-<txp:ajw_comment_num />" class="<txp:ajw_comment_alt even="even" odd="odd" />">
<span class="comment-num"><txp:ajw_comment_num /></span>
<txp:message /><br />
<small>— <txp:comment_name />    <txp:comment_time />    @<txp:comment_permlink>#</txp:comment_permlink></small>@
</div>
Last edited by kartav (2005-03-24 19:43:20)
Offline
ah crap. my bad – it has to do with the fact that I used the same global variable name in both plugins. i’ll release an update to this later today. I’ll likely have to update all three of the comment plugins. Thanks for the catch.
Offline