Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-03-09 23:44:29

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

[plugin] [ORPHAN] ajw_comment_num

Download latest version: ajw_comment_num (v0.2)

Read Documentation

Summary

Allows for outputting current comment number.

Requires:

  • 1.0RC3 (rev180 or greater)
  • If you are using Textpattern 1.0RC3 rev142 thru rev179, you will need to perform a one-line edit of /textpattern/publish/comment.php, as outlined in this Textpattern Forum thread (allows for plugin parsing in comments)

Examples

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-&gt;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

#2 2005-03-10 09:54:01

druzli
Member
From: Denmark / Iceland
Registered: 2004-06-28
Posts: 60
Website

Re: [plugin] [ORPHAN] ajw_comment_num

Neat.

Thanks


regards,

Agust

Offline

#3 2005-03-15 08:20:21

osei
Plugin Author
From: Stockholm, Sweden
Registered: 2004-07-01
Posts: 178
Website

Re: [plugin] [ORPHAN] ajw_comment_num

This plugin is also very handy in the search_result form, thanks


Johan Nilsson

Offline

#4 2005-03-23 17:53:51

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_comment_num

Bug fix update for counting bug when using multiple tags in one comment form. Latest version is now 0.2.

Offline

#5 2005-03-24 19:00:29

kartav
Member
From: Moscow, Russia
Registered: 2005-03-07
Posts: 18

Re: [plugin] [ORPHAN] ajw_comment_num

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

#6 2005-03-24 19:05:02

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_comment_num

kartav, please update to version 0.2 – that is likely due to the increment bug in v0.1

Offline

#7 2005-03-24 19:06:16

kartav
Member
From: Moscow, Russia
Registered: 2005-03-07
Posts: 18

Re: [plugin] [ORPHAN] ajw_comment_num

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

#8 2005-03-24 19:21:26

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_comment_num

hmm (no need to post the plugin code) – what is your usage?

Offline

#9 2005-03-24 19:25:33

kartav
Member
From: Moscow, Russia
Registered: 2005-03-07
Posts: 18

Re: [plugin] [ORPHAN] ajw_comment_num

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>&#8212; <txp:comment_name /> &#160;&#160; <txp:comment_time /> &#160;&#160; <txp:comment_permlink>#</txp:comment_permlink></small>
</div>

Last edited by kartav (2005-03-24 19:43:20)

Offline

#10 2005-03-24 19:45:35

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_comment_num

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

#11 2005-03-24 19:47:39

kartav
Member
From: Moscow, Russia
Registered: 2005-03-07
Posts: 18

Re: [plugin] [ORPHAN] ajw_comment_num

OK

Glad to reveal small bugs.
Wait for new releases.

Offline

#12 2005-03-24 20:07:05

Andrew
Plugin Author
Registered: 2004-02-23
Posts: 730

Re: [plugin] [ORPHAN] ajw_comment_num

silly really. yarrrrr. so how’s about i make this even more roundabout for ya? since it’s really a side-effect of a bug with ajw_comment_alt, I’ve updated that plugin instead. ;-)

Offline

Board footer

Powered by FluxBB