@@ -114,6 +114,20 @@ function main($id, $mode)
114114 $ db ->sql_freeresult ($ result );
115115 }
116116
117+ /**
118+ * Modify UCP front topic data before it is processed.
119+ *
120+ * @event core.ucp_main_front_modify_topic_data
121+ * @var array topic_list Topic IDs displayed on the UCP front page
122+ * @var array rowset Topic rows keyed by topic ID
123+ * @since 3.3.20-RC1
124+ */
125+ $ vars = array (
126+ 'topic_list ' ,
127+ 'rowset ' ,
128+ );
129+ extract ($ phpbb_dispatcher ->trigger_event ('core.ucp_main_front_modify_topic_data ' , compact ($ vars )));
130+
117131 $ topic_forum_list = array ();
118132 foreach ($ rowset as $ t_id => $ row )
119133 {
@@ -902,14 +916,36 @@ function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
902916 $ sql = $ db ->sql_build_query ('SELECT ' , $ sql_array );
903917 $ result = $ db ->sql_query_limit ($ sql , $ config ['topics_per_page ' ], $ start );
904918
905- $ topic_list = $ topic_forum_list = $ global_announce_list = $ rowset = array ();
919+ $ topic_list = $ rowset = array ();
906920 while ($ row = $ db ->sql_fetchrow ($ result ))
907921 {
908922 $ topic_id = (isset ($ row ['b_topic_id ' ])) ? $ row ['b_topic_id ' ] : $ row ['topic_id ' ];
909923
910924 $ topic_list [] = $ topic_id ;
911925 $ rowset [$ topic_id ] = $ row ;
926+ }
927+ $ db ->sql_freeresult ($ result );
928+
929+ /**
930+ * Modify subscribed/bookmarked topic data before it is processed.
931+ *
932+ * @event core.ucp_main_topiclist_modify_topic_data
933+ * @var string mode Topic-list mode ('subscribed' or 'bookmarks')
934+ * @var array topic_list Topic IDs displayed on the current page
935+ * @var array rowset Topic rows keyed by topic ID
936+ * @since 3.3.20-RC1
937+ */
938+ $ vars = array (
939+ 'mode ' ,
940+ 'topic_list ' ,
941+ 'rowset ' ,
942+ );
943+ extract ($ phpbb_dispatcher ->trigger_event ('core.ucp_main_topiclist_modify_topic_data ' , compact ($ vars )));
912944
945+ $ topic_forum_list = $ global_announce_list = array ();
946+ foreach ($ topic_list as $ topic_id )
947+ {
948+ $ row = $ rowset [$ topic_id ];
913949 $ topic_forum_list [$ row ['forum_id ' ]]['forum_mark_time ' ] = ($ config ['load_db_lastread ' ]) ? $ row ['forum_mark_time ' ] : 0 ;
914950 $ topic_forum_list [$ row ['forum_id ' ]]['topics ' ][] = $ topic_id ;
915951
@@ -918,7 +954,6 @@ function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
918954 $ global_announce_list [] = $ topic_id ;
919955 }
920956 }
921- $ db ->sql_freeresult ($ result );
922957
923958 $ topic_tracking_info = array ();
924959 if ($ config ['load_db_lastread ' ])
0 commit comments