PDA

View Full Version : When creating new thread, what variable holds the post text?


tweakmonkey
10-18-2006, 04:52 AM
I'm trying to fix up the "Auto-Moderation by Keywords" mod because it doesn't seem to work in VB 3.6 (at least for me). The problem is that although it works for replies to messages, it will not moderate new threads.

The plugin uses the following code:if (str_replace(explode(',', $this->registry->options['automodkeywords']), '', strtolower($this->fetch_field('pagetext'))) != strtolower($this->fetch_field('pagetext')))
{
$this->set('visible', 0);
}

This is valid and works fine in the postdata_presave hook location (where replies are created). However it does not work in the threadfpdata_presave hook location (where new threads are created).

The problem seems to be in the $this->fetch_field('pagetext') code - it seems to be invalid/blank on the threadfpdata_presave hook. Any idea what to use instead on VB 3.6.0?

Thanks in advance. I'm a newbie.

Paul M
10-18-2006, 05:45 AM
Try $this->fetch_field('pagetext', 'post') - I think it defaults to the thread fields in that class.

tweakmonkey
10-18-2006, 06:03 AM
Awesome that did it. :) Thanks.