diff options
Diffstat (limited to 'phpBB/docs')
-rw-r--r-- | phpBB/docs/coding-guidelines.html | 52 | ||||
-rw-r--r-- | phpBB/docs/events.md | 132 | ||||
-rw-r--r-- | phpBB/docs/sphinx.sample.conf | 90 |
3 files changed, 244 insertions, 30 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index eb569d12d5..14c2281323 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -72,6 +72,7 @@ <ol style="list-style-type: lower-roman;"> <li><a href="#templates">General Templating</a></li> <li><a href="#stylestree">Styles Tree</a></li> + <li><a href="#template-events">Template Events</a></li> </ol></li> <li><a href="#charsets">Character Sets and Encodings</a></li> <li><a href="#translation">Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</a> @@ -1678,6 +1679,57 @@ version = 3.1.0 parent = prosilver </pre></div> + <a name="template-events"></a><h3>4.iii. Template Events</h3> + <p>Template events must follow this format: <code><!-- EVENT event_name --></code></p> + <p>Using the above example, files named <code>event_name.html</code> located within extensions will be injected into the location of the event.</p> + + <h4>Template event naming guidelines:</h4> + <ul> + <li>An event name must be all lowercase, with each word separated by an underscore.</li> + <li>An event name must briefly describe the location and purpose of the event.</li> + <li>An event name must end with one of the following suffixes:</li> + <ul> + <li><code>_prepend</code> - This event adds an item to the beginning of a block of related items, or adds to the beginning of individual items in a block.</li> + <li><code>_append</code> - This event adds an item to the end of a block of related items, or adds to the end of individual items in a block.</li> + <li><code>_before</code> - This event adds content directly before the specified block</li> + <li><code>_after</code> - This event adds content directly after the specified block</li> + </ul> + </ul> + + <h4>Template event documentation</h4> + <p>Events must be documented in <code>phpBB/docs/events.md</code> in alphabetical order based on the event name. The format is as follows:</p> + + <ul><li>An event found in only one template file: + <div class="codebox"><pre>event_name +=== +* Location: styles/<style_name>/template/filename.html +* Purpose: A brief description of what this event should be used for. +This may span multiple lines. +</pre></div></li> + <li>An event found in multiple template files: + <div class="codebox"><pre>event_name +=== +* Locations: + + first/file/path.html + + second/file/path.html +* Purpose: Same as above. +</pre></div> + <li>An event that is found multiple times in a file should have the number of instances in parenthesis next to the filename. + <div class="codebox"><pre>event_name +=== +* Locations: + + first/file/path.html (2) + + second/file/path.html +* Purpose: Same as above. +</pre></div></li> + <li>An actual example event documentation: + <div class="codebox"><pre>forumlist_body_last_post_title_prepend +==== +* Locations: + + styles/prosilver/template/forumlist_body.html + + styles/subsilver2/template/forumlist_body.html +* Purpose: Add content before the post title of the latest post in a forum on the forum list.</pre></div></ul><br /> + </div> <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md new file mode 100644 index 0000000000..f0b3b81822 --- /dev/null +++ b/phpBB/docs/events.md @@ -0,0 +1,132 @@ +acp_forums_normal_settings_append +=== +* Location: adm/style/acp_forums.html +* Purpose: Add settings to forums + +acp_main_actions_append +=== +* Location: adm/style/acp_main.html +* Purpose: Add actions to the ACP main page below the cache purge action + +acp_main_notice_after +=== +* Location: adm/style/acp_main.html +* Purpose: Add notices or other blocks in the ACP below other configuration notices + +acp_overall_footer_after +=== +* Location: adm/style/overall_footer.html +* Purpose: Add content below the footer in the ACP + +acp_overall_header_head_append +=== +* Location: adm/style/overall_header.html +* Add assets within the `<head>` tags in the ACP + +acp_simple_footer_after +=== +* Location: adm/style/simple_footer.html +* Purpose: Add content below the simple footer in the ACP + +acp_simple_header_head_append +=== +* Location: adm/style/overall_header.html +* Add assets within the `<head>` tags in the simple header of the ACP + +acp_users_overview_options_append +=== +* Location: adm/style/acp_users.html +* Purpose: Add options and settings on user overview page + +forumlist_body_last_post_title_prepend +==== +* Locations: + + styles/prosilver/template/forumlist_body.html + + styles/subsilver2/template/forumlist_body.html +* Purpose: Add content before the post title of the latest post in a forum on the forum list. + +index_body_stat_blocks_before +=== +* Locations: + + styles/prosilver/template/index_body.html + + styles/subsilver2/template/index_body.html +* Purpose: Add new statistic blocks above the Who Is Online and Board Statistics blocks + +overall_footer_after +=== +* Locations: + + styles/prosilver/template/overall_footer.html + + styles/subsilver2/template/overall_footer.html +* Purpose: Add content at the end of the file, directly prior to the `</body>` tag + +overall_footer_breadcrumb_append +=== +* Location: styles/prosilver/template/overall_footer.html +* Purpose: Add links to the list of breadcrumbs in the footer + +overall_footer_copyright_append +=== +* Locations: + + styles/prosilver/template/overall_footer.html + + styles/subsilver2/template/overall_footer.html +* Purpose: Add content after the copyright line (no new line by default), before the ACP link + +overall_footer_copyright_prepend +=== +* Locations: + + styles/prosilver/template/overall_footer.html + + styles/subsilver2/template/overall_footer.html +* Purpose: Add content before the copyright line + +overall_header_breadcrumb_append +=== +* Locations: + + styles/prosilver/template/overall_header.html + + styles/subsilver2/template/breadcrumbs.html +* Purpose: Add links to the list of breadcrumbs in the header + +overall_header_head_append +=== +* Locations: + + styles/prosilver/template/overall_header.html + + styles/subsilver2/template/overall_header.html +* Purpose: Add asset calls directly before the `</head>` tag + +overall_header_navigation_append +=== +* Location: styles/prosilver/template/overall_header.html +* Purpose: Add links after the navigation links in the header + +overall_header_navigation_prepend +=== +* Location: styles/prosilver/template/overall_header.html +* Purpose: Add links before the navigation links in the header + +posting_editor_options_prepend +=== +* Locations: + + styles/prosilver/template/posting_editor.html + + styles/prosilver/template/posting_body.html +* Purpose: Add posting options on the posting screen + +simple_footer_after +=== +* Location: styles/prosilver/template/simple_footer.html +* Purpose: Add content directly prior to the `</body>` tag of the simple footer + +ucp_pm_viewmessage_print_head_append +=== +* Location: styles/prosilver/template/ucp_pm_viewmessage_print.html +* Purpose: Add asset calls directly before the `</head>` tag of the Print PM screen + +viewtopic_print_head_append +=== +* Location: styles/prosilver/template/viewtopic_print.html +* Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen + +viewtopic_topic_title_prepend +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Purpose: Add content directly before the topic title link on the View topic screen diff --git a/phpBB/docs/sphinx.sample.conf b/phpBB/docs/sphinx.sample.conf index aa0e8d905d..fcaba6dcf3 100644 --- a/phpBB/docs/sphinx.sample.conf +++ b/phpBB/docs/sphinx.sample.conf @@ -10,21 +10,36 @@ source source_phpbb_{SPHINX_ID}_main sql_query_pre = UPDATE phpbb_sphinx SET max_doc_id = MAX(post_id) WHERE counter_id = 1 sql_query_range = SELECT MIN(post_id), MAX(post_id) FROM phpbb_posts sql_range_step = 5000 - sql_query = SELECT
\ - p.post_id AS id,
\ - p.forum_id,
\ - p.topic_id,
\ - p.poster_id,
\ - CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
\ - p.post_time,
\ - p.post_subject,
\ - p.post_subject as title,
\ - p.post_text as data,
\ - t.topic_last_post_time,
\ - 0 as deleted
\ - FROM phpbb_posts p, phpbb_topics t
\ - WHERE
\ - p.topic_id = t.topic_id
\ + sql_query = SELECT +\ + p.post_id AS id, +\ + p.forum_id, +\ + p.topic_id, +\ + p.poster_id, +\ + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, +\ + p.post_time, +\ + p.post_subject, +\ + p.post_subject as title, +\ + p.post_text as data, +\ + t.topic_last_post_time, +\ + 0 as deleted +\ + FROM phpbb_posts p, phpbb_topics t +\ + WHERE +\ + p.topic_id = t.topic_id +\ AND p.post_id >= $start AND p.post_id <= $end sql_query_post = sql_query_post_index = UPDATE phpbb_sphinx SET max_doc_id = $maxid WHERE counter_id = 1 @@ -42,21 +57,36 @@ source source_phpbb_{SPHINX_ID}_delta : source_phpbb_{SPHINX_ID}_main { sql_query_range = sql_range_step = - sql_query = SELECT
\ - p.post_id AS id,
\ - p.forum_id,
\ - p.topic_id,
\ - p.poster_id,
\ - CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post,
\ - p.post_time,
\ - p.post_subject,
\ - p.post_subject as title,
\ - p.post_text as data,
\ - t.topic_last_post_time,
\ - 0 as deleted
\ - FROM phpbb_posts p, phpbb_topics t
\ - WHERE
\ - p.topic_id = t.topic_id
\ + sql_query = SELECT +\ + p.post_id AS id, +\ + p.forum_id, +\ + p.topic_id, +\ + p.poster_id, +\ + CASE WHEN p.post_id = t.topic_first_post_id THEN 1 ELSE 0 END as topic_first_post, +\ + p.post_time, +\ + p.post_subject, +\ + p.post_subject as title, +\ + p.post_text as data, +\ + t.topic_last_post_time, +\ + 0 as deleted +\ + FROM phpbb_posts p, phpbb_topics t +\ + WHERE +\ + p.topic_id = t.topic_id +\ AND p.post_id >= ( SELECT max_doc_id FROM phpbb_sphinx WHERE counter_id=1 ) sql_query_pre = } |