[ABD] Template Events Locations (for extension developers)

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

[ABD] Template Events Locations (for extension developers)

Post by martti »

Development of this extension will continue here under a new name: Show phpBB Events

This is a developers tool. It is only to be installed locally and not on a live site.

Extension Name: Template Events Locations

Author: martti

Extension Description: This extension for extension developers shows all the core template event locations in the board. Also the core PHP events that get triggered are shown in order in a table at the bottom of the page. Both the template events medals and PHP events are linked to their location in the phpBB repository in Github so their context can be easily reviewed when you click on them. You can toggle between showing/hiding the events with a button in the upper left corner.

Extension Version: 1.5.1

Requirements: phpBB 3.2.x, PHP 7.x

Extension Download: https://github.com/marttiphpbb/phpbb-ex ... master.zip
The files are to be put in ext/marttiphpbb/templateevents

Github repository: https://github.com/marttiphpbb/phpbb-ext-templateevents

Languages: en, fr

Templates: all (but only tested in prosilver)

Screenshots:

Image

With a button at the upper left corner you can toggle between showing/not showing the events:
(The template events with grey labels are in the HTML head and the black labels in the HTML body)

Image


Image


At the bottom the triggered core PHP events are shown in order and the times they were triggered:

Image


The core template and PHP events are also shown for the ACP pages:

Image

If you hold the mouse pointer on a template event label, you see the phpBB version it was introduced and the file where it resides:

Image


Clicking on the template event label or the filename of the PHP event brings you to the line in the phpBB code:

Image
Last edited by martti on Wed May 02, 2018 9:22 am, edited 30 times in total.
User avatar
Volksdevil
Registered User
Posts: 2415
Joined: Sun Oct 03, 2010 2:03 pm
Location: Lancashire, UK
Name: Neil

Re: [BETA] Template Events Locations (for developers)

Post by Volksdevil »

Wow. I'm not an ext dev, but I can see how this will be really useful for devs! Great work!
My phpBB Extensions
Finally found great Website Hosting from :arrow: KUALO!
Do NOT use 123-reg.co.uk - Incapable of running phpBB!
:ugeek: TekNeil - Streamer on Twitch | My Volkswagen Corrado G60
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: [BETA] Template Events Locations (for developers)

Post by david63 »

Quite a good idea - but only for a development board.

I do, however, have a couple of questions:

1. How will this interact with other extensions that may use template events?
2. As these are effectively hard coded will you be updating this extension whenever a new event is added?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [BETA] Template Events Locations (for developers)

Post by martti »

david63 wrote:Quite a good idea - but only for a development board.

I do, however, have a couple of questions:

1. How will this interact with other extensions that may use template events?
2. As these are effectively hard coded will you be updating this extension whenever a new event is added?
1. There is no interference with other extensions. Multiple extensions can be subscribed to the same events. The location indicators of this extension will appear right before or after anything that is inserted by other extensions. (The order is not fixed by nature.)
2. For the moment being, this is hard coded. I don't think there is an other solution now. I will update whenever a new version of phpBB with new events comes out.

Edit: 2 -> luckily I got some help from Oyabun1
Last edited by martti on Wed Apr 29, 2015 6:33 am, edited 3 times in total.
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [BETA] Template Events Locations (for developers)

Post by spaceace »

this is very useful. thanks :D
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [BETA] Template Events Locations (for developers)

Post by martti »

Version 1.0.0-rc1 now also shows the ACP Template Events.

Image
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [BETA] Template Events Locations (for developers)

Post by spaceace »

martti wrote:Version 1.0.0-rc1 now also shows the ACP Template Events.

Image
now that makes this extension awesome :D
User avatar
spaceace
Registered User
Posts: 1999
Joined: Wed Jan 30, 2008 8:50 pm

Re: [RC] Template Events Locations (for developers)

Post by spaceace »

when trying to view the template events in the ACP while in User administration viewing a user, clicking on the show button to view template events, it refreshes the page and drops back to the username input field. any way to set the show template events to just a global on so every time you go to another page it is already turned on?

like a switch in the ACP to just turn it on or off instead of the switch in the header of the page
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Template Events Locations (for developers)

Post by martti »

spaceace wrote:when trying to view the template events in the ACP while in User administration viewing a user, clicking on the show button to view template events, it refreshes the page and drops back to the username input field. any way to set the show template events to just a global on so every time you go to another page it is already turned on?

like a switch in the ACP to just turn it on or off instead of the switch in the header of the page
To my view the phpBB core is wrong here and not the extension.
This is one of the places the phpBB core uses a HTTP POST where it should be using HTTP GET.
You don't see the user represented in the url of the ACP User Administration. If you copy paste the url into another tab of your browser, you won't get the user adminstration of the certain user, but the username input field.
Clearly, phpBB should be using here a HTTP GET because no data gets processed; the ACP User Administration is simply a representation of a resource (the certain user).
About HTTP POST vs GET:
http://blog.teamtreehouse.com/the-defin ... et-vs-post

Another example where phpBB uses HTTP POST where it should be HTTP GET are these selectors at the bottom of viewforum:
Image
any way to set the show template events to just a global on so every time you go to another page it is already turned on?
So, this is already the case (when the showing of template events is turned on, query parameter&value templateevents=1 gets passed over each time in the url).
The unexpected behaviour you encounter has to do with the fact phpBB core that doesn't link each page (a resource) to an url. As long this doesn't get fixed in core I suggest to live with it.
CentaurAtlas
Registered User
Posts: 50
Joined: Sun Dec 02, 2007 5:39 pm

Re: [RC] Template Events Locations (for developers)

Post by CentaurAtlas »

This looks very useful. Thank you for sharing it - the long text list in the dev guide is okay, but a picture is worth a thousand words!
RogueSoft
Registered User
Posts: 1
Joined: Wed Mar 04, 2015 7:38 pm
Name: Mark Godfrey

Re: [RC] Template Events Locations (for developers)

Post by RogueSoft »

Hey Martti, I noticed a text error in the overall_footer_copyright_prepend.html file...

overall_footer_page_body_after should be changed to overall_footer_copyright_prepend.

Great extension. Love the work you have put in on this development tool.
User avatar
tamarin
Registered User
Posts: 120
Joined: Tue Feb 03, 2015 9:02 pm
Location: Germany
Name: Ed

Re: [RC] Template Events Locations (for developers)

Post by tamarin »

Hi.
The German [de] and Russian [ru] translations are ready.
I sent them to the extension author.
Thanks for the extension.
User avatar
B€RN@RD
Registered User
Posts: 91
Joined: Mon Dec 30, 2002 10:25 am
Location: chateauvieux / france

Re: [RC] Template Events Locations (for developers)

Post by B€RN@RD »

hello,
any new release ?

regards
User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: [RC] Template Events Locations (for developers)

Post by Oyabun1 »

Just sent a pull request to add the new events in 3.1.3 and 3.1.4.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests
User avatar
martti
Registered User
Posts: 914
Joined: Thu Jul 31, 2014 8:23 am
Location: Belgium

Re: [RC] Template Events Locations (for developers)

Post by martti »

Oyabun1 wrote:Just sent a pull request to add the new events in 3.1.3 and 3.1.4.
Merged! Thank you!

Return to “Abandoned Extensions”