From f4cff08a1943d2bd7f1fc18318fa73018bcf6499 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 14:29:24 +0100 Subject: [ticket/12015] Add more parameters to core.viewtopic_get_post_data PHPBB3-12015 --- phpBB/viewtopic.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3a7e633c99..e6019c1ed6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1001,10 +1001,17 @@ $sql_ary = array( * Event to modify the SQL query before the post and poster data is retrieved * * @event core.viewtopic_get_post_data +* @var int forum_id Forum ID +* @var int topic_id Topic ID +* @var array topic_data Array with topic data +* @var array post_list Array with post_ids we are going to retrieve +* @var int sort_days Display posts of previous x days +* @var string sort_key Key the posts are sorted by +* @var string sort_dir Direction the posts are sorted by * @var array sql_ary The SQL array to get the data of posts and posters * @since 3.1-A1 */ -$vars = array('sql_ary'); +$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days', 'sort_key', 'sort_dir', 'sql_ary'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); $sql = $db->sql_build_query('SELECT', $sql_ary); -- cgit v1.2.1 From e3b70c4c08c82cbf365e9f5e8e402b1f4888cc53 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 14:30:20 +0100 Subject: [ticket/12015] Add attachments to core.viewtopic_modify_post_row PHPBB3-12015 --- phpBB/viewtopic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e6019c1ed6..c453e3c2a6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1706,11 +1706,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @event core.viewtopic_modify_post_row * @var array row Array with original post and user data * @var array cp_row Custom profile field data of the poster + * @var array attachments List of attachments * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post * @since 3.1-A1 */ - $vars = array('row', 'cp_row', 'user_poster_data', 'post_row'); + $vars = array('row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); if (isset($cp_row['row']) && sizeof($cp_row['row'])) -- cgit v1.2.1 From 1efab9ec772f0b62572d28d1c2d57fdb998c5f8f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 14:31:51 +0100 Subject: [ticket/12015] Add an event after the post has been assigned to the template PHPBB3-12015 --- phpBB/viewtopic.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index c453e3c2a6..2f9a869bc6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1747,6 +1747,20 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) } } + /** + * Event after the post data has been assigned to the template + * + * @event core.viewtopic_post_row_after + * @var array row Array with original post and user data + * @var array cp_row Custom profile field data of the poster + * @var array attachments List of attachments + * @var array user_poster_data Poster's data from user cache + * @var array post_row Template block array of the post + * @since 3.1-A2 + */ + $vars = array('row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); + extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars))); + $prev_post_id = $row['post_id']; unset($rowset[$post_list[$i]]); -- cgit v1.2.1 From c2c976fe031b2904b3acbefb73f03827c55aa441 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 16:24:25 +0100 Subject: [ticket/12015] Add post counting information to event PHPBB3-12015 --- phpBB/viewtopic.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 2f9a869bc6..36669e7383 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1008,10 +1008,11 @@ $sql_ary = array( * @var int sort_days Display posts of previous x days * @var string sort_key Key the posts are sorted by * @var string sort_dir Direction the posts are sorted by +* @var int start Pagination information * @var array sql_ary The SQL array to get the data of posts and posters * @since 3.1-A1 */ -$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days', 'sort_key', 'sort_dir', 'sql_ary'); +$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days', 'sort_key', 'sort_dir', 'start', 'sql_ary'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); $sql = $db->sql_build_query('SELECT', $sql_ary); @@ -1704,6 +1705,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * Modify the posts template block * * @event core.viewtopic_modify_post_row + * @var int start Start item of this page + * @var int i Number of the post on this page + * @var int end Number of posts on this page * @var array row Array with original post and user data * @var array cp_row Custom profile field data of the poster * @var array attachments List of attachments @@ -1711,7 +1715,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array post_row Template block array of the post * @since 3.1-A1 */ - $vars = array('row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); + $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); if (isset($cp_row['row']) && sizeof($cp_row['row'])) @@ -1751,6 +1755,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * Event after the post data has been assigned to the template * * @event core.viewtopic_post_row_after + * @var int start Start item of this page + * @var int i Number of the post on this page + * @var int end Number of posts on this page * @var array row Array with original post and user data * @var array cp_row Custom profile field data of the poster * @var array attachments List of attachments @@ -1758,7 +1765,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array post_row Template block array of the post * @since 3.1-A2 */ - $vars = array('row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); + $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars))); $prev_post_id = $row['post_id']; -- cgit v1.2.1 From ecda590b8657588b6b3719ca0d59ee824e5fc4b2 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 13 Nov 2013 17:07:30 +0100 Subject: [ticket/12015] Add @change to events that got changed PHPBB3-12015 --- phpBB/viewtopic.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 36669e7383..bfe131dbc3 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1011,6 +1011,7 @@ $sql_ary = array( * @var int start Pagination information * @var array sql_ary The SQL array to get the data of posts and posters * @since 3.1-A1 +* @change 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start */ $vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days', 'sort_key', 'sort_dir', 'start', 'sql_ary'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars))); @@ -1714,6 +1715,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post * @since 3.1-A1 + * @change 3.1.0-a2 Added vars start, i, end and attachments */ $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); @@ -1763,7 +1765,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array attachments List of attachments * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post - * @since 3.1-A2 + * @since 3.1.0-a2 */ $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars))); -- cgit v1.2.1 From e9e667762b9c8762c77f5dcfbaeca00683a3b993 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 21 Nov 2013 23:18:29 +0100 Subject: [ticket/12015] Fix english grammar PHPBB3-12015 --- phpBB/viewtopic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/viewtopic.php') diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index bfe131dbc3..2332b87e42 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1715,7 +1715,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) * @var array user_poster_data Poster's data from user cache * @var array post_row Template block array of the post * @since 3.1-A1 - * @change 3.1.0-a2 Added vars start, i, end and attachments + * @change 3.1.0-a2 Added vars start, i, end, and attachments */ $vars = array('start', 'i', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row'); extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars))); -- cgit v1.2.1