Board disabled, maintenance mode

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Bryx
Registered User
Posts: 18
Joined: Mon Oct 30, 2017 7:14 am
Contact:

Board disabled, maintenance mode

Post by Bryx » Sun Jan 07, 2018 5:51 pm

Hello,

I a problem with my extension phpBB 3.2.
I can't get a maintenance page

Example:
- If the forum is not in maintenance, it is forumatix_enable.html
- If the forum is in maintenance, it is forumatix_disable.html

What I want to do is that when I have no maintenance mode, the default page is displayed and when the Forum maintenance is active it displays the maintenance page of my extension.

Extension file :
bryx.zip
bryx_forumatix
(88.11 KiB) Downloaded 6 times
Thank you for support.
Bryx
Thank you, Bryx
- bryx.fr

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20852
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Board disabled, maintenance mode

Post by RMcGirr83 » Sun Jan 07, 2018 7:05 pm

What is "maintenance"?
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Bryx
Registered User
Posts: 18
Joined: Mon Oct 30, 2017 7:14 am
Contact:

Re: Board disabled, maintenance mode

Post by Bryx » Sun Jan 07, 2018 7:11 pm

It is a French vocabulary, it is to say that the forum is unavailable.
Thank you, Bryx
- bryx.fr

User avatar
Bryx
Registered User
Posts: 18
Joined: Mon Oct 30, 2017 7:14 am
Contact:

Re: Board disabled, maintenance mode

Post by Bryx » Mon Jan 08, 2018 9:55 pm

A idea ?
Thank you, Bryx
- bryx.fr

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20852
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Board disabled, maintenance mode

Post by RMcGirr83 » Mon Jan 08, 2018 10:04 pm

Maybe can be done within the core.page_header_after or possibly the core.user_setup event.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Bryx
Registered User
Posts: 18
Joined: Mon Oct 30, 2017 7:14 am
Contact:

Re: Board disabled, maintenance mode

Post by Bryx » Tue Jan 09, 2018 6:53 pm

Thank you for informations and help.

I found this code

Code: Select all

// Is board disabled and user not an admin or moderator?
		if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
		{
			if ($this->data['is_bot'])
			{
				send_status_line(503, 'Service Unavailable');
			}

			$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
			trigger_error($message);
		}
How suited to my extension, in reality I'm not an expert in PHP just a small beginner who tries to learn.
Thank you, Bryx
- bryx.fr

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 20852
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Board disabled, maintenance mode

Post by RMcGirr83 » Tue Jan 09, 2018 7:36 pm

You fire it (trigger_error) within your code using the event.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Bryx
Registered User
Posts: 18
Joined: Mon Oct 30, 2017 7:14 am
Contact:

Re: Board disabled, maintenance mode

Post by Bryx » Tue Jan 09, 2018 8:57 pm

Here is the code used to create the event

Code: Select all

	/**
	 * Mode board disabled
	 */
	public function add_page_header_disabled()
	{
		if ($config['board_disable'] && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
		{
			$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
			trigger_error($message);
		}
	}
This seems to you correct, if so how to fit my custom template that found in the extension knowing that it does not help the head or the base foot of the forum.

Thank you for your time =)
Thank you, Bryx
- bryx.fr

User avatar
posey
Registered User
Posts: 706
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Board disabled, maintenance mode

Post by posey » Tue Jan 09, 2018 10:04 pm

It's really hard to understand what you want and to explain it to you without writing the entire extension for you.

You can't just 'write your own event'. You have to hook into one of the PHP Core Events and use that in your event/listener.php.
Here you can find all available phpBB Event locations.
I would suggest looking through the phpBB’s extension development tutorial and documentation.
And perhaps look at some already existing (and validated) extensions, such as: Hope this helps,
''I'm pretty sure there's a lot more to life than being really, really, ridiculously good looking. And I plan on finding out what that is.''

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests