Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-03-09 23:50:34

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

[plugin] [ORPHAN] ajw_comment_alt

Summary

Alternates output based on even- or odd-numbered comments. Intended usage is from within default comment form. Another plugin solution (much more powerful) would also be to use zem_nth. This functionality was previously accomplished through Jon Hicks’ tricks.

Download latest version: ajw_comment_alt (v0.2)

Read the Documentation

Requires:

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

Attributes

even (optional)

Some other text to be output instead of ‘even’.

odd (optional)

Some other text to be output instead of ‘odd’.

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->preferences.

Ex. 1

<div class="<txp:ajw_comment_alt />"> 
    ...other comment form stuff...
</div>

results in >>>

<div class="odd"> 
    ...other comment form stuff...
</div>

<div class="even"> 
    ...other comment form stuff...
</div>

Ex. 2

<div class="<txp:ajw_comment_alt even="foo" odd="bar" />"> 
    ...other comment form stuff...
</div>

results in >>>

<div class="foo"> 
    ...other comment form stuff...
 </div> 
 <div class="bar"> 
    ...your txp comment tags would go here...
 </div>

Last edited by Andrew (2007-01-03 04:23:03)

Offline

#2 2005-03-24 20:05:43

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

Re: [plugin] [ORPHAN] ajw_comment_alt

Update yer versions… v0.2

Offline

#3 2005-04-01 05:57:20

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

Re: [plugin] [ORPHAN] ajw_comment_alt

updated to v0.3

Offline

#4 2005-10-16 16:57:16

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: [plugin] [ORPHAN] ajw_comment_alt

Andrew, this plugin works great!

However in 4/01, it produces <code><div><div class=“even”>…some comment…</div></div>
<div><div class=“odd”>…some comment…</div></div></code>

Is there a way to get rid of the superfluous divs?


BB6 Band My band
Gud One My blog

Offline

#5 2006-01-13 16:21:46

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

Re: [plugin] [ORPHAN] ajw_comment_alt

I’m not sure what’s causing the superflous divs in comment output They are added by Textpattern itself and unrelated to this plugin, details here.

Last edited by Andrew (2006-01-13 16:33:59)

Offline

#6 2006-07-10 03:21:18

brian.zollinhofer
Member
From: Virginia
Registered: 2006-07-10
Posts: 24
Website

Re: [plugin] [ORPHAN] ajw_comment_alt

Sorry, this is probably something simple, but I’m trying to get this implemented, but I get the following error:

tag_error <txp:ajw_comment_alt/> -> Textpattern Warning: unknown_tag

I haven’t done the one-line edit to the code, because I don’t know how to tell if I am using Textpattern 1.0RC3 rev142 thru rev179. I’m using TXP 4.0.3. Do I need to do this edit?

Thoughts? (Sorry again, I’m still quite new to all this).


Zollinhofer.com

“It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt.”
- Mark Twain

Offline

#7 2006-07-10 13:53:27

brian.zollinhofer
Member
From: Virginia
Registered: 2006-07-10
Posts: 24
Website

Re: [plugin] [ORPHAN] ajw_comment_alt

Nevermind. I’m stupid. I didn’t realize plugins had to be turned on…


Zollinhofer.com

“It is better to keep your mouth closed and let people think you are a fool than to open it and remove all doubt.”
- Mark Twain

Offline

#8 2006-08-14 19:09:41

deronsizemore
Member
From: Kentucky
Registered: 2005-11-02
Posts: 324

Re: [plugin] [ORPHAN] ajw_comment_alt

EDIT: I seem to have it working now.

Thanks

Last edited by deronsizemore (2006-08-16 12:16:20)

Offline

#9 2006-09-13 20:01:12

Thirteen
Member
Registered: 2006-01-09
Posts: 40

Re: [plugin] [ORPHAN] ajw_comment_alt

Hi,

I was wondering if it’s possible to set a different style for an admin’s comment? I’m looking to not only alternate the styles for odd/even, but to also set something else when it’s the admin posting (perhaps by setting a specific email address, etc.) – can this be done, and if so, how?

Thanks for any help you can give me!

Offline

#10 2006-09-14 02:42:10

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

Re: [plugin] [ORPHAN] ajw_comment_alt

Offline

#11 2006-09-14 07:45:05

Thirteen
Member
Registered: 2006-01-09
Posts: 40

Re: [plugin] [ORPHAN] ajw_comment_alt

Ah, exactly what I was looking for- thank you very much! I didn’t realize that plugin existed. Now I’m using three of your comment plugins. :D

Out of curiosity, why didn’t you make them as one plugin rather than split them up into 3?

Offline

#12 2006-09-14 15:12:26

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

Re: [plugin] [ORPHAN] ajw_comment_alt

Good question. Most likely because I was making them as I needed them. Also because it wasn’t really until post-RC releases that someone finally came up with the brilliant idea of wrapping multiple plugins into one :)

Offline

Board footer

Powered by FluxBB