Textpattern plugin : ajw_if_comment_owner
09 March 2005 @ early morning | Comments (17)
Plugin Details
- Download:
- ajw_if_comment_owner
- Version:
- 0.3.1
- Forum:
- Read discussion
- Status on this site:
- Active
Please use forum for all bug reports and questions
Summary
Conditional output based on comparing the name of the commenter with either a) the real name of article author or b) with a user-specified name (or comma-separated list of names). In the future, I plan to allow for checking email and URL as well. Intended usage is from within default comment form.
Attributes
- name
name="Mr. T"name="Mr. T, Dean Allen"email="nobody@example.com"email="nobody@example.com,somebody@example.com"- web
web="example.com"web="example.com,example.net"- strict (optional)
- Setting this value to "1" will allow for more strict checking of name/email/web combinations. If strict mode is enabled, one item of each specified comment attribute must match.
- Default: 0 (false)
<else />- (optional) Anything output below this point will be output in the event of a false/negative check
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.
This tag is intended to be used as an “enclosure” tag, meaning it should enclose text that will be conditionally displayed based on the rules you set. For example:
<txp:ajw_if_comment_owner name="foo,bar">
owner
</txp:ajw_if_comment_owner>
<txp:ajw_if_comment_owner name="tom,sue">
friends
</txp:ajw_if_comment_owner>
Here are some example attribute combinations with evaluated meaning:
name="foo"
anyone named “foo”name="foo,bar" email="foo@domain.com"
(foo OR bar) OR foo@domain.comname="foo,bar" email="foo@domain.com" strict="1"
(foo OR bar) AND foo@domain.comname="foo" email="foo@domain.com" web="domain.com" strict="1"
foo AND foo@domain.com AND domain.comname="foo,bar" email="foo@domain.com" web="domain.com" strict="1"(foo OR bar) AND foo@domain.com AND domain.com
Revision History
- v0.3.1
- Fixed typo in “help” documentation
- v0.3
- Added ability to use “else” clause
- v0.2
- Allows for strict or loose checking of multiple fields
17 comments