rendered paste body<?php/** ** @package events* @version $Id: trigger_new_post.php,v 1.20 2005/12/25 00:09:26 davidmj Exp $* @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License **//*** Returns which info this trigger can provide to the action*/function evt_new_post_provides(){ return EVT_DATA_USER | EVT_DATA_FORUM | EVT_DATA_TOPIC | EVT_DATA_POST | EVT_DATA_ATTACHMENT | EVT_DATA_POLL_TOPIC;}/*** Checks additional options for the condition and executes the event if they are matched*/function evt_new_post_execute(&$options, &$action, &$info){ global $events, $user; $requires = call_action_func($action['name'], 'requires'); if ((isset($options['f_ids'][$info[EVT_DATA_FORUM]['forum_id']])) && (($options['reply'] && $info['mode'] == 'reply') || ($options['topic'] && $info['mode'] == 'post')) && ((($requires & EVT_DATA_POLL_TOPIC) == 0) || $info[EVT_DATA_POLL_TOPIC]) && ((($requires & EVT_DATA_ATTACHMENT) == 0) || $info[EVT_DATA_ATTACHMENT])) { switch ($options['user']) { case 2: if ($info['mode'] == 'reply') { $info[EVT_DATA_USER] = array('user_id' => $info['topic_poster']); } else { $info[EVT_DATA_USER] = &$user->data; } return true; case 3: if ($info['mode'] == 'reply') { $info[EVT_DATA_USER] = array('user_id' => $info['topic_last_poster_id']); return true; } break; default: $info[EVT_DATA_USER] = &$user->data; return true; } } return false;}?>