Recent Topics

1 Feb 10, 2009 15:33    

There is a hook called DisplayCommentFormFieldset. As one might guess, it allows a plugin to add a fieldset when the comment form is displayed. That's a good thing.

There is a hook called AdminDisplayCommentFormFieldset. One might guess it allows a plugin to add a fieldset when the comment form is displayed in the admin area, but that is simply not true. That hook is engaged when someone is editing an existing comment. So maybe that hook should be called "AdminEditCommentFormFieldset", but really that hook should be moved.

There is no hook that allows a plugin to add a formfield when the comment form is displayed in the admin area. There should be. If it was up to me I'd re-use good old "DisplayCommentFormFieldset" from the public side in the private side. Specifically, I would make /inc/items/vies/_item_list_full.view.php around line 354 (in v2.4.6) look like this:

$Form->textarea( 'p', '', 12, T_('Comment text'),
									T_('Allowed XHTML tags').': '.htmlspecialchars(str_replace( '><',', ', $comment_allowed_tags)), 40, 'bComment' );

$Plugins->trigger_event( 'DisplayCommentFormFieldset', array( 'Form' => & $Form, 'Item' => & $Item ) );

if(substr($comments_use_autobr,0,4) == 'opt-')

Unless there is a strong reason why a hook can't be re-used in the code. In that case I would put AdminDisplayCommentFormFieldset in the file above and rename the hook for editing a comment in such a way that the hook name implied that it applied to editing an existing comment.

I can hack it but I don't need it. The thing is that TuringTest (and I'm sure captcha and anything else that provides a pass/fail field to a public-side comment) fails when adding a comment from the back office because that's how it goes. There is no way to add the field that will be tested, but the comment will be submitted to /htsrv/comment_post.php which will check to see if the pass/fail field was properly filled in.

... Hey I think I just thought of a way to hack TuringTest beyond this extremely old bug! Wow! Just goes to show ya: every now and then a blind hog can root up an acorn ;)

PS: no I haven't figured out how to use the PHP button. What I figured out is that when I use the CODE button and preview my nonsense it doesn't look cool so I should edit the code bits into php bits

2 Feb 10, 2009 16:26

Can't wait until you notice that editing a comment makes the xhtml checker use the post settings ;)

¥

3 Feb 10, 2009 17:03

Really? Wow I edited a few comments but never bumped into anything that made me wonder what the heck was going on.

4 Feb 10, 2009 17:04

Try <a> or any other tag that's not (normally) allowed in comments ;)

¥

6 Feb 10, 2009 17:37

We play with them in different ways ;) ... same end result though :D

¥


Form is loading...