Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » $thiscomment

#1 2005-03-09 04:48:12

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

$thiscomment

Looks like $thisarticle’s got a bug – unless of course it’s just a temporary placeholder for future development…?

Trouble is that the contents of $thisarticle, when accessed via plugin or comment form, always contain the last value of the $darr array. I think this is because (correct me if I’m wrong) the contents of the comment form are never <code>parse()</code>‘d, so the PHP isn’t executed until after the entire page has rendered. Would it be possible to parse comment form contents? Would this open up security gaps? (did I mean to say eval?)

It almost seems that it will have to change to a page template sort of parsing of comment content. But I haven’t come up w/ a solution.

Last edited by Andrew (2005-03-09 05:21:33)

Offline

#2 2005-03-09 05:52:20

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

Re: $thiscomment

ok, this seems to do the trick (and will allow for all other plugins to be executed as well) although I’m not sure of it’s security implications. basically just add the line in bold to comments.php ~line122:

<blockquote>
… <pre>$temp = preg_replace(‘/<(txp:comment_permlink)>(.*)<\/\\1>/U’, ‘<a href=”’.$dlink.’”>$2</a>’,$temp);</pre>
<strong><code>$temp = parse($temp);</code></strong><br>
<code>$out[] = ($comments_are_ol) </code><br>
…</blockquote>

Last edited by Andrew (2005-03-09 05:54:20)

Offline

#3 2005-03-09 22:08:17

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

Re: $thiscomment

thanks zem

Last edited by Andrew (2005-03-09 23:14:35)

Offline

#4 2005-03-19 21:23:05

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

Re: $thiscomment

There is an unintended and minor (but annoying) side effect from this. If one wants to post a code example to a comment involving a txp plugin, it is always stripped completely. There simply is no way to post sample plugin code in comments, which makes it hard to hold a discussion in the comments of a thread about plugins.

Offline

#5 2005-03-24 18:53:51

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

Re: $thiscomment

Do anybody have ajw_comment_num (v0.2)?
Site http://compooter.org/ is not responding!…

Offline

#6 2005-03-24 19:00:24

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

Re: $thiscomment

textdrive is temporarily down – give em a minute

Offline

#7 2006-02-21 12:32:14

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: $thiscomment

Could you help me please with this plugin.

I want to use with together with the <txp:ajw_comment_alt /> plugin.

My code is:

<txp:ajw_if_comment_owner name=“Name”>
<li class=“owner <txp:ajw_comment_alt />”>
</txp:if_comment_owner>

<else />

<li class=”<txp:ajw_comment_alt />”>
</txp:if_comment_owner>

Do you have any idea why it doesn’t work?

Offline

#8 2006-02-27 01:23:27

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

Re: $thiscomment

<blockquote>

neomatrix wrote:

<txp:ajw_if_comment_owner name="Name">
<li class="owner <txp:ajw_comment_alt />">
</txp:if_comment_owner>

<else />

<li class="<txp:ajw_comment_alt />">
</txp:if_comment_owner>

Do you have any idea why it doesn’t work?

</blockquote>

Yes, it looks like there are two problems. First, you’re closing the ajw_if_comment_owner plugin tag twice. Second, you’re using the wrong syntax (</txp:ajw_if_comment_owner> vs. </txp:if_comment_owner>) Try like this:

<txp:ajw_if_comment_owner name="foo,bar"> 
YES! 
<else /> 
NO! 
</txp:if_comment_owner>

Does that help?

Last edited by Andrew (2006-02-27 01:24:59)

Offline

#9 2006-02-27 01:26:29

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

Re: $thiscomment

It looks like the plugin help documentation has an error in it; I’ll update the plugin.

Offline

#10 2006-02-27 01:28:26

neomatrix
Member
From: Sofia, Bulgaria
Registered: 2005-08-21
Posts: 23

Re: $thiscomment

Yes it helped. I should be more careful. Thank you for the support.

Offline

#11 2006-03-31 12:38:14

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: $thiscomment

Is this plugin still working for 4.0.3? and if so, is it still necessary to add this one code line Andrew recomments above ?

Offline

#12 2006-03-31 15:59:32

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

Re: $thiscomment

Confused…

Offline

  1. Index
  2. » Archives
  3. » $thiscomment

Board footer

Powered by FluxBB