activating a from-skeleton extension

Discussion forum for Extension Writers regarding Extension Development.
ZweiBieren
Registered User
Posts: 8
Joined: Thu Feb 15, 2024 3:47 pm

activating a from-skeleton extension

Post by ZweiBieren »

I have created extension zweibieren/emailoks using the skeleton system. Without any modification, I uploaded the files to my server. When I try to activate it, it is not listed among the extensions.

So what do I try now? How do I get the new extension to be listed?

I am trying to make an extension that overrides include/ucp/ucp_register.php. Nothing I've read gives me confidence that I can do this. Can I?

Fred Hansen
User avatar
Mike-on-Tour
Registered User
Posts: 558
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: activating a from-skeleton extension

Post by Mike-on-Tour »

Into what directory did you upload it?
And what is the content of your composer.json file? Can you post it here within a code BBCode (</>) please?
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image
User avatar
Kailey
Community Team Leader
Community Team Leader
Posts: 3996
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Snay

Re: activating a from-skeleton extension

Post by Kailey »

ZweiBieren wrote: Mon Feb 19, 2024 11:02 pm Nothing I've read gives me confidence that I can do this.
Not sure what reading you've already done, but have you had a look at the Extension Development Documentation?
Kailey Snay - Community Team Leader
Knowledge Base | Documentation | Community rules
If you have any questions about the rules/customs of this website, feel free to send me a PM.

My little corner of the world | Administrator @ phpBB Modders
ZweiBieren
Registered User
Posts: 8
Joined: Thu Feb 15, 2024 3:47 pm

Re: activating a from-skeleton extension

Post by ZweiBieren »

I uploaded to zweibieren.com/pp/ext/zweibieren/emailsok.
The composer.json file is in sub-directory _
Presumably because I did not run phing.

I'll try phing next.

I've read a lot of Extension Development Documentation, but it's not clear if elements of the includes directory can be overwritten. I'm going to suppose they can.

Thanks for your help.
User avatar
Mike-on-Tour
Registered User
Posts: 558
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: activating a from-skeleton extension

Post by Mike-on-Tour »

The composer.json file must be in the root directory of your extension (/ext/zweibieren/emaolsok/composer.json) otherwise it will not be recognizes by the ext manager.

What includes directory do you mean? One within your extension or the one in the board root? The first one is not necessary (unless it hods files used by your ext) but you should keep your hands off the second one.
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image
ZweiBieren
Registered User
Posts: 8
Joined: Thu Feb 15, 2024 3:47 pm

Re: activating a from-skeleton extension

Post by ZweiBieren »

My goal is to simplify user registration. I will have some email addresses on file and these should register as if USER_ACTIVATION_SELF. Others require administrator action, so they should be like USER_ACTIVATION_ADMIN. The way I have found to do this is to modify root/includes/ucp/ucp_register.php. What is now

Code: Select all

		else if ($config['require_activation'] == USER_ACTIVATION_SELF 
				&& $config['email_enable']) {
			$message = $user->lang['ACCOUNT_INACTIVE'];
			$email_template = 'user_welcome_inactive';
		}
will become

Code: Select all

		else if ($config['require_activation'] == USER_ACTIVATION_SELF 
				&& $config['email_enable']) {	
			if  (/*email address is in list*/) {
				/* the two lines in the if-clause above /
			}
			else {
				/* the two similar ;lines from the USER_ACTIVATION_ADMIN clause */
			}
		}
Is there a better way?
User avatar
Mike-on-Tour
Registered User
Posts: 558
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael

Re: activating a from-skeleton extension

Post by Mike-on-Tour »

Modifying core files is not recommended since you would have to do it again every time you update your phpBB software. That is the reason why extensions were introduced into phpBB, their code is independant and they are not touched by the updates of phpBB.
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image

Return to “Extension Writers Discussion”