diff options
-rw-r--r-- | phpBB/docs/events.md | 78 | ||||
-rw-r--r-- | phpBB/memberlist.php | 39 | ||||
-rw-r--r-- | phpBB/search.php | 109 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/memberlist_view.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/search_results.html | 4 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/ucp_agreement.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewforum_body.html | 2 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewtopic_body.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/memberlist_view.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/search_results.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/ucp_agreement.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/viewforum_body.html | 2 | ||||
-rw-r--r-- | phpBB/styles/subsilver2/template/viewtopic_body.html | 2 |
13 files changed, 212 insertions, 36 deletions
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index fdf4eaeb71..18beb1c64a 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -308,6 +308,14 @@ memberlist_view_content_append * Since: 3.1.0-b2 * Purpose: Add custom content to the user profile view after the main content +memberlist_view_content_prepend +=== +* Locations: + + styles/prosilver/template/memberlist_view.html + + styles/subsilver2/template/memberlist_view.html +* Since: 3.1.0-b3 +* Purpose: Add custom content to the user profile view before the main content + memberlist_view_user_statistics_after === * Locations: @@ -563,6 +571,36 @@ quickreply_editor_message_before * Since: 3.1.0-a4 * Purpose: Add content before the quick reply textbox +search_results_post_after +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/subsilver2/template/search_results.html +* Since: 3.1.0-b3 +* Purpose: Add data after search result posts + +search_results_post_before +=== +* Locations: + + styles/prosilver/template/search_results.html + + styles/subsilver2/template/search_results.html +* Since: 3.1.0-b3 +* Purpose: Add data before search result posts + +search_results_postprofile_after +=== +* Locations: + + styles/prosilver/template/search_results.html +* Since: 3.1.0-b3 +* Purpose: Add content after the post author and stats in search results (posts view mode) + +search_results_postprofile_before +=== +* Locations: + + styles/prosilver/template/search_results.html +* Since: 3.1.0-b3 +* Purpose: Add content directly before the post author in search results (posts view mode) + simple_footer_after === * Locations: @@ -599,6 +637,22 @@ topiclist_row_append * Since: 3.1.0-a1 * Purpose: Add content into topic rows (inside the elements containing topic titles) +ucp_agreement_terms_after +=== +* Locations: + + styles/prosilver/template/ucp_agreement.html + + styles/subsilver2/template/ucp_agreement.html +* Since: 3.1.0-b3 +* Purpose: Add content after the terms of agreement text at user registration + +ucp_agreement_terms_before +=== +* Locations: + + styles/prosilver/template/ucp_agreement.html + + styles/subsilver2/template/ucp_agreement.html +* Since: 3.1.0-b3 +* Purpose: Add content before the terms of agreement text at user registration + ucp_pm_viewmessage_contact_fields_after === * Locations: @@ -723,6 +777,22 @@ ucp_friend_list_after * Since: 3.1.0-a4 * Purpose: Add optional elements after list of friends in UCP +viewforum_forum_name_append +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-b3 +* Purpose: Add content directly after the forum name link on the View forum screen + +viewforum_forum_name_prepend +=== +* Locations: + + styles/prosilver/template/viewforum_body.html + + styles/subsilver2/template/viewforum_body.html +* Since: 3.1.0-b3 +* Purpose: Add content directly before the forum name link on the View forum screen + viewtopic_print_head_append === * Locations: @@ -867,6 +937,14 @@ viewtopic_body_topic_actions_before * Since: 3.1.0-a4 * Purpose: Add data before the topic actions buttons (after the posts sorting options) +viewtopic_topic_title_append +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-b3 +* Purpose: Add content directly after the topic title link on the View topic screen + viewtopic_topic_title_prepend === * Locations: diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index f859960183..6c28f962dc 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -565,8 +565,6 @@ switch ($mode) $member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true); } - $poster_avatar = phpbb_get_user_avatar($member); - // We need to check if the modules 'zebra' ('friends' & 'foes' mode), 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links $zebra_enabled = $friends_enabled = $foes_enabled = $user_notes_enabled = $warn_user_enabled = false; @@ -591,25 +589,31 @@ switch ($mode) unset($module); } + // Custom Profile Fields + $profile_fields = array(); + if ($config['load_cpf_viewprofile']) + { + $cp = $phpbb_container->get('profilefields.manager'); + $profile_fields = $cp->grab_profile_fields_data($user_id); + $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array(); + } + /** * Modify user data before we display the profile * * @event core.memberlist_view_profile * @var array member Array with user's data - * @var bool user_notes_enabled Is the mcp user notes module - * enabled? - * @var bool warn_user_enabled Is the mcp warnings module - * enabled? - * @var bool zebra_enabled Is the ucp zebra module - * enabled? - * @var bool friends_enabled Is the ucp friends module - * enabled? - * @var bool foes_enabled Is the ucp foes module - * enabled? + * @var bool user_notes_enabled Is the mcp user notes module enabled? + * @var bool warn_user_enabled Is the mcp warnings module enabled? + * @var bool zebra_enabled Is the ucp zebra module enabled? + * @var bool friends_enabled Is the ucp friends module enabled? + * @var bool foes_enabled Is the ucp foes module enabled? * @var bool friend Is the user friend? * @var bool foe Is the user foe? + * @var array profile_fields Array with user's profile field data * @since 3.1.0-a1 * @changed 3.1.0-b2 Added friend and foe status + * @changed 3.1.0-b3 Added profile fields data */ $vars = array( 'member', @@ -620,20 +624,12 @@ switch ($mode) 'foes_enabled', 'friend', 'foe', + 'profile_fields', ); extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars))); $template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled)); - // Custom Profile Fields - $profile_fields = array(); - if ($config['load_cpf_viewprofile']) - { - $cp = $phpbb_container->get('profilefields.manager'); - $profile_fields = $cp->grab_profile_fields_data($user_id); - $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array(); - } - // If the user has m_approve permission or a_user permission, then list then display unapproved posts if ($auth->acl_getf_global('m_approve') || $auth->acl_get('a_user')) { @@ -659,7 +655,6 @@ switch ($mode) 'SIGNATURE' => $member['user_sig'], 'POSTS_IN_QUEUE'=> $member['posts_in_queue'], - 'AVATAR_IMG' => $poster_avatar, 'PM_IMG' => $user->img('icon_contact_pm', $user->lang['SEND_PRIVATE_MESSAGE']), 'EMAIL_IMG' => $user->img('icon_contact_email', $user->lang['EMAIL']), 'JABBER_IMG' => $user->img('icon_contact_jabber', $user->lang['JABBER']), diff --git a/phpBB/search.php b/phpBB/search.php index dfb53c6896..a34c0a4e5a 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -635,12 +635,66 @@ if ($keywords || $author || $author_id || $search_id || $submit) } $db->sql_freeresult($result); - $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour - FROM ' . POSTS_TABLE . ' p - LEFT JOIN ' . TOPICS_TABLE . ' t ON (p.topic_id = t.topic_id) - LEFT JOIN ' . FORUMS_TABLE . ' f ON (p.forum_id = f.forum_id) - LEFT JOIN ' . USERS_TABLE . " u ON (p.poster_id = u.user_id) - WHERE $sql_where"; + $sql_array = array( + 'SELECT' => 'p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour', + 'FROM' => array( + POSTS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(TOPICS_TABLE => 't'), + 'ON' => 'p.topic_id = t.topic_id', + ), + array( + 'FROM' => array(FORUMS_TABLE => 'f'), + 'ON' => 'p.forum_id = f.forum_id', + ), + array( + 'FROM' => array(USERS_TABLE => 'u'), + 'ON' => 'p.poster_id = u.user_id', + ), + ), + 'WHERE' => $sql_where, + 'ORDER_BY' => $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'), + ); + + /** + * Event to modify the SQL query before the posts data is retrieved + * + * @event core.search_get_posts_data + * @var array sql_array The SQL array + * @var array zebra Array of zebra data for the current user + * @var int total_match_count The total number of search matches + * @var string keywords String of the specified keywords + * @var array sort_by_sql Array of SQL sorting instructions + * @var string s_sort_dir The sort direction + * @var string s_sort_key The sort key + * @var string s_limit_days Limit the age of results + * @var array ex_fid_ary Array of excluded forum ids + * @var array author_id_ary Array of exclusive author ids + * @var string search_fields The data fields to search in + * @var int search_id The id of the search request + * @var int start The starting id of the results + * @since 3.1.0-b3 + */ + $vars = array( + 'sql_array', + 'zebra', + 'total_match_count', + 'keywords', + 'sort_by_sql', + 's_sort_dir', + 's_sort_key', + 's_limit_days', + 'ex_fid_ary', + 'author_id_ary', + 'search_fields', + 'search_id', + 'start', + ); + extract($phpbb_dispatcher->trigger_event('core.search_get_posts_data', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_array); } else { @@ -689,8 +743,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sql = "SELECT $sql_select FROM $sql_from WHERE $sql_where"; + $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); } - $sql .= ' ORDER BY ' . $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); $result = $db->sql_query($sql); $result_topic_id = 0; @@ -1002,11 +1056,46 @@ if ($keywords || $author || $author_id || $search_id || $submit) * 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 + * @var array row Array with topic data + * @var array tpl_ary Template block array with topic data + * @var string show_results Display topics or posts + * @var string topic_title Cleaned topic title + * @var int replies The number of topic replies + * @var string view_topic_url The URL to the topic + * @var string folder_img The folder image of the topic + * @var string folder_alt The alt attribute of the topic folder img + * @var int topic_type The topic type + * @var bool unread_topic Whether the topic has unread posts + * @var bool topic_unapproved Whether the topic is unapproved + * @var int posts_unapproved The number of unapproved posts + * @var bool topic_deleted Whether the topic has been deleted + * @var string u_mcp_queue The URL to the corresponding MCP queue page + * @var array zebra The zebra data of the current user + * @var array attachments All the attachments of the search results * @since 3.1.0-a1 + * @changed 3.1.0-b3 Added vars show_results, topic_title, replies, + * view_topic_url, folder_img, folder_alt, topic_type, unread_topic, + * topic_unapproved, posts_unapproved, topic_deleted, u_mcp_queue, + * zebra, attachments */ - $vars = array('row', 'tpl_ary'); + $vars = array( + 'row', + 'tpl_ary', + 'show_results', + 'topic_title', + 'replies', + 'view_topic_url', + 'folder_img', + 'folder_alt', + 'topic_type', + 'unread_topic', + 'topic_unapproved', + 'posts_unapproved', + 'topic_deleted', + 'u_mcp_queue', + 'zebra', + 'attachments', + ); extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars))); $template->assign_block_vars('searchresults', $tpl_ary); diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 3ef3f7ca07..a8b1e972fe 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -2,6 +2,8 @@ <h2 class="memberlist-title">{PAGE_TITLE}</h2> +<!-- EVENT memberlist_view_content_prepend --> + <form method="post" action="{S_PROFILE_ACTION}" id="viewprofile"> <div class="panel bg1<!-- IF S_ONLINE --> online<!-- ENDIF -->"> <div class="inner"> diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index 818b8ee642..fe0b0362ce 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -113,6 +113,7 @@ <!-- ELSE --> <!-- BEGIN searchresults --> + <!-- EVENT search_results_post_before --> <div class="search post <!-- IF searchresults.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF searchresults.S_POST_REPORTED --> reported<!-- ENDIF -->"> <div class="inner"> @@ -122,12 +123,14 @@ </div> <!-- ELSE --> <dl class="postprofile"> + <!-- EVENT search_results_postprofile_before --> <dt class="author">{L_POST_BY_AUTHOR} {searchresults.POST_AUTHOR_FULL}</dt> <dd class="search-result-date">{searchresults.POST_DATE}</dd> <dd>{L_FORUM}{L_COLON} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></dd> <dd>{L_TOPIC}{L_COLON} <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a></dd> <dd>{L_REPLIES}{L_COLON} <strong>{searchresults.TOPIC_REPLIES}</strong></dd> <dd>{L_VIEWS}{L_COLON} <strong>{searchresults.TOPIC_VIEWS}</strong></dd> + <!-- EVENT search_results_postprofile_after --> </dl> <div class="postbody"> @@ -144,6 +147,7 @@ </div> </div> + <!-- EVENT search_results_post_after --> <!-- BEGINELSE --> <div class="panel"> <div class="inner"> diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html index bc4f23cee7..943774c6ec 100644 --- a/phpBB/styles/prosilver/template/ucp_agreement.html +++ b/phpBB/styles/prosilver/template/ucp_agreement.html @@ -35,7 +35,9 @@ <div class="inner"> <div class="content"> <h2 class="sitename-title">{SITENAME} - {L_REGISTRATION}</h2> + <!-- EVENT ucp_agreement_terms_before --> <p><!-- IF S_SHOW_COPPA -->{L_COPPA_BIRTHDAY}<!-- ELSE -->{L_TERMS_OF_USE}<!-- ENDIF --></p> + <!-- EVENT ucp_agreement_terms_after --> </div> </div> </div> diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 33d309bcb8..6646f40f01 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> <!-- IF U_MCP or U_ACP --><p class="responsive-center">[ <!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP --> | <!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF --> ]</p><!-- ENDIF --> -<h2 class="forum-title"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2> +<h2 class="forum-title"><!-- EVENT viewforum_forum_name_prepend --><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2> <!-- IF FORUM_DESC or MODERATORS or U_MCP --> <div> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 039b3286fa..ed45835da6 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -1,6 +1,6 @@ <!-- INCLUDE overall_header.html --> <!-- IF U_MCP or U_ACP --><p class="responsive-center">[ <!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP --> | <!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF --> ]</p><!-- ENDIF --> -<h2 class="topic-title"><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> +<h2 class="topic-title"><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2> <!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body --> <!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF --> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index 52f40707c0..4c8014a370 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -2,6 +2,8 @@ <div id="pagecontent"> + <!-- EVENT memberlist_view_content_prepend --> + <form method="post" action="{S_PROFILE_ACTION}"> <table class="tablebg" width="100%" cellspacing="1"> diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html index 092779055d..ff34055b29 100644 --- a/phpBB/styles/subsilver2/template/search_results.html +++ b/phpBB/styles/subsilver2/template/search_results.html @@ -91,6 +91,7 @@ <!-- BEGIN searchresults --> <tr class="row2"> + <!-- EVENT search_results_post_before --> <!-- IF searchresults.S_IGNORE_POST --> <td class="gensmall" colspan="2" height="25" align="center">{searchresults.L_IGNORE_POST}</td> <!-- ELSE --> @@ -126,6 +127,7 @@ </td> </tr> <!-- ENDIF --> + <!-- EVENT search_results_post_after --> <tr> <td class="spacer" colspan="2"><img src="images/spacer.gif" height="1" alt="" /></td> </tr> diff --git a/phpBB/styles/subsilver2/template/ucp_agreement.html b/phpBB/styles/subsilver2/template/ucp_agreement.html index 3afe6e89a0..fca7eb2368 100644 --- a/phpBB/styles/subsilver2/template/ucp_agreement.html +++ b/phpBB/styles/subsilver2/template/ucp_agreement.html @@ -42,7 +42,9 @@ <td class="gen" align="center"><br />{L_COPPA_BIRTHDAY}<br /><br /><a href="{U_COPPA_NO}">{L_COPPA_NO}</a> :: <a href="{U_COPPA_YES}">{L_COPPA_YES}</a><br /><br /></td> <!-- ELSE --> <td> + <!-- EVENT ucp_agreement_terms_before --> <span class="genmed"><br />{L_TERMS_OF_USE}<br /><br /></span> + <!-- EVENT ucp_agreement_terms_after --> <div align="center"> <input class="btnlite" type="submit" id="agreed" name="agreed" value="{L_AGREE}" /><br /><br /> <input class="btnlite" type="submit" name="not_agreed" value="{L_NOT_AGREE}" /> diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html index 44e8f30ce4..a7a130a8df 100644 --- a/phpBB/styles/subsilver2/template/viewforum_body.html +++ b/phpBB/styles/subsilver2/template/viewforum_body.html @@ -103,7 +103,7 @@ <!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS --> <div id="pageheader"> - <h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2> + <h2><!-- EVENT viewforum_forum_name_prepend --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2> <!-- IF MODERATORS --> <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index 0c89084b7f..6ac4e0ea33 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -15,7 +15,7 @@ <!-- ENDIF --> <div id="pageheader"> - <h2><!-- EVENT viewtopic_topic_title_prepend --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> + <h2><!-- EVENT viewtopic_topic_title_prepend --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2> <!-- IF MODERATORS --> <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p> |