diff --git a/docs/events.md b/docs/events.md index 69b8ceb..b3897a2 100644 --- a/docs/events.md +++ b/docs/events.md @@ -1,160 +1,87 @@ -# Available php Events +# Events -The PHP and template events keep the names they had in `nickvergessen/newspage`, -so listeners and style templates written for it keep working. +Other extensions can add code or HTML to the news page through these events, without editing NV Newspage. + +The events from the original extension keep their `nickvergessen` names, so listeners and style templates written for `nickvergessen/newspage` keep working. Events added since use `phpbbmodders_newspage`. + +## PHP events ### nickvergessen.newspage.newspage -* Locations: - + controller/main.php +* Location: `controller/main.php` * Variables: + `forum_id` - Forum ID of the category to display + `year` - Limit the news to a certain year + `month` - Limit the news to a certain month + `page` - Page to display * Since: 1.2 -* Purpose: You can use this event to load settings on the newspage +* Purpose: Runs before the news list is built. Use it to load settings or language for the news page, or to change which news is shown. ### nickvergessen.newspage.single_news -* Locations: - + controller/main.php +* Location: `controller/main.php` * Variables: + `topic_id` - Topic ID of the news to display * Since: 1.2 -* Purpose: You can use this event to load settings on a single page view of the -newspage - - -# Available Template Events - -### nickvergessen_newspage_after -* Locations: - + styles/prosilver/template/newspage_body.html -* Since: 1.2 -* Purpose: Add content after the output of the newspage - -### nickvergessen_newspage_before -* Locations: - + styles/prosilver/template/newspage_body.html -* Since: 1.2 -* Purpose: Add content before the output of the newspage - -### nickvergessen_newspage_filters_after -* Locations: - + styles/prosilver/template/newspage_body.html -* Since: 1.2 -* Purpose: Add content after the list of filters - -### nickvergessen_newspage_filters_before -* Locations: - + styles/prosilver/template/newspage_body.html -* Since: 1.2 -* Purpose: Add content before the list of filters - -### nickvergessen_newspage_title_after -* Locations: - + styles/prosilver/template/newspage_body.html -* Since: 1.2 -* Purpose: Add content after the title of the newspage -For before event use `### nickvergessen_newspage_before` - -### viewtopic_body_avatar_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_avatar_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_contact_fields_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_contact_fields_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_post_author_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_post_author_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_post_buttons_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_post_buttons_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_custom_fields_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_custom_fields_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_content_footer -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_details_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_details_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_notices_after -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html - -### viewtopic_body_postrow_post_notices_before -* Locations: - + styles/prosilver/template/viewtopic_postrow.html -* Since: 1.2 -* Purpose: Copy the respective event from phpBB's viewtopic_body.html +* Purpose: Runs before a single news item is shown. Use it to load settings or language for that page. + +## Template events + +A style or extension uses a template event by adding `styles/