[ticket/11749] Move event after all template data has been defined

PHPBB3-11749
This commit is contained in:
Matt Friedman 2013-07-29 00:05:31 -07:00
parent 8e636e4572
commit 9902f1c751

View file

@ -1001,18 +1001,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
); );
} }
/** $tpl_ary = array_merge($tpl_ary, array(
* Modify the topic data before it is assigned to the template
*
* @event core.search_modify_tpl_ary
* @var array row Array with topic data
* @var array tpl_ary Template block array with topic data
* @since 3.1-A1
*/
$vars = array('row', 'tpl_ary');
extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
$template->assign_block_vars('searchresults', array_merge($tpl_ary, array(
'FORUM_ID' => $forum_id, 'FORUM_ID' => $forum_id,
'TOPIC_ID' => $result_topic_id, 'TOPIC_ID' => $result_topic_id,
'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false, 'POST_ID' => ($show_results == 'posts') ? $row['post_id'] : false,
@ -1024,9 +1013,22 @@ if ($keywords || $author || $author_id || $search_id || $submit)
'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_TOPIC' => $view_topic_url,
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '') 'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '',
)); ));
/**
* Modify the topic data before it is assigned to the template
*
* @event core.search_modify_tpl_ary
* @var array row Array with topic data
* @var array tpl_ary Template block array with topic data
* @since 3.1-A1
*/
$vars = array('row', 'tpl_ary');
extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
$template->assign_block_vars('searchresults', $tpl_ary);
if ($show_results == 'topics') if ($show_results == 'topics')
{ {
phpbb_generate_template_pagination($template, $view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true); phpbb_generate_template_pagination($template, $view_topic_url, 'searchresults.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);