Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
modifying comment content 'on the fly' using event comment.save
Hi,
do I have a chance to modify the comment content when the user presses ‘save’?
That is, unlike the “comment.form” event, whose plugins are called within a str_replace(), I don’t know how to mangle the $message within a “comment.save” callback.
I see I can create an evaluator and ask textpattern to reload the form, but can I modify the form’s message (or name, email, web, for that matter)?
Could someone show me a small code sample?
TIA
Mariano Absatz – El Baby
I don’t suffer from insanity. I enjoy every minute of it.
Offline
Re: modifying comment content 'on the fly' using event comment.save
Did you see the sample on Textbook?
It looks like nko_spamurl_blocker may be a good example as well.
Last edited by MattD (2009-11-25 19:14:10)
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: modifying comment content 'on the fly' using event comment.save
MattD wrote:
Did you see the sample on Textbook?
Yes… and a couple of other plugins (mem_akismet and rah_comment_spam)… but all of them deal with reading the content and marking the comment as spam or send it to moderation… or even giving the user a possibility to re-write the message and re-post it… what I want is to modify the comment text, and I don’t see how…
Mariano Absatz – El Baby
I don’t suffer from insanity. I enjoy every minute of it.
Offline