Extending Auto Groups extention

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Extending Auto Groups extention

Post by Kami-sama » Mon Jul 02, 2018 8:11 pm

Hey guys!

So I am currently working on adding extra conditions for "Auto Groups" extension.
Following creators "tutorial": https://www.phpbb.com/customise/db/exte ... s/faq/1781

May main concern is:
- how to take data from custom fields table?
(or maybe better is to add my own variable to user table?)

Has anyone had experience on extending this extension?

User avatar
david63
Jr. Extension Validator
Posts: 14763
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extending Auto Groups extention

Post by david63 » Mon Jul 02, 2018 8:16 pm

Take a look at the latest version of my Privacy Policy extension where I have added Auto Groups. I found the tutorial very easy to follow and adapt to my requirements.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Re: Extending Auto Groups extention

Post by Kami-sama » Mon Jul 02, 2018 8:26 pm

david63 wrote:
Mon Jul 02, 2018 8:16 pm
Take a look at the latest version of my Privacy Policy extension where I have added Auto Groups. I found the tutorial very easy to follow and adapt to my requirements.
Thank you for the suggestion! I Will look into it.

I am very new with phpBB and first time attempting such things, therefor I feel I am missing something here. Looks too easy. And doing things with tables, I am cautious of using trial and error method.

For example I am still not sure about:
- do you must create your own extension for this?
- or could you just add extra condition to "Auto Groups"?
- where in the code your selected data is checked to ACP value?
- where to initialise this to make it efficiant
.....

User avatar
david63
Jr. Extension Validator
Posts: 14763
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extending Auto Groups extention

Post by david63 » Mon Jul 02, 2018 8:32 pm

Kami-sama wrote:
Mon Jul 02, 2018 8:26 pm
do you must create your own extension for this?
Yes
Kami-sama wrote:
Mon Jul 02, 2018 8:26 pm
or could you just add extra condition to "Auto Groups"?
No
Kami-sama wrote:
Mon Jul 02, 2018 8:26 pm
where in the code your selected data is checked to ACP value?
Without seeing your code or know what you are trying to do it is impossible to say
Kami-sama wrote:
Mon Jul 02, 2018 8:26 pm
where to initialise this to make it efficiant
Check my extension
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Re: Extending Auto Groups extention

Post by Kami-sama » Mon Jul 02, 2018 8:42 pm

Thank you for the answers!

Checking your extension topic, the very recent message is:
"hi Mick, without autogroups, privacy policy seem working fine. Have a good day"

So is it really working well with AutoGroups?

User avatar
david63
Jr. Extension Validator
Posts: 14763
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extending Auto Groups extention

Post by david63 » Mon Jul 02, 2018 8:53 pm

Kami-sama wrote:
Mon Jul 02, 2018 8:42 pm
So is it really working well with AutoGroups?
Yes - there was a minor bur in an earlier version.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Re: Extending Auto Groups extention

Post by Kami-sama » Mon Jul 02, 2018 8:55 pm

david63 wrote:
Mon Jul 02, 2018 8:53 pm
Kami-sama wrote:
Mon Jul 02, 2018 8:42 pm
So is it really working well with AutoGroups?
Yes - there was a minor bur in an earlier version.
Oh, I see. Can you link me the latest version?
(just in case I was looking up the wrong one)

User avatar
david63
Jr. Extension Validator
Posts: 14763
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extending Auto Groups extention

Post by david63 » Mon Jul 02, 2018 8:57 pm

Kami-sama wrote:
Mon Jul 02, 2018 8:55 pm
Can you link me the latest version?
https://github.com/david63/david63-priv ... ve/3.2.zip
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Re: Extending Auto Groups extention

Post by Kami-sama » Tue Jul 03, 2018 6:28 pm

david63 wrote:
Mon Jul 02, 2018 8:57 pm
Kami-sama wrote:
Mon Jul 02, 2018 8:55 pm
Can you link me the latest version?
https://github.com/david63/david63-priv ... ve/3.2.zip
Thank you for the link.

Followup question - how does this extend auto groups? Do you simply use Auto Groups functionality with your extension OR you add your condition to Auto Groups itself? I am confused in this part.

Created a basic extension for this. But not sure where to go from there.
Main idea - extension applies number value to custom user table element.
Then Auto Groups would auto add user to specific group depending on the element value.

User avatar
david63
Jr. Extension Validator
Posts: 14763
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extending Auto Groups extention

Post by david63 » Tue Jul 03, 2018 8:12 pm

Effectively your extension is "extending" Auto Groups so you add a condition in your extension and then when you run Auto Groups it appears as part of Auto Groups - if that makes sense.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Re: Extending Auto Groups extention

Post by Kami-sama » Tue Jul 03, 2018 8:19 pm

david63 wrote:
Tue Jul 03, 2018 8:12 pm
Effectively your extension is "extending" Auto Groups so you add a condition in your extension and then when you run Auto Groups it appears as part of Auto Groups - if that makes sense.
Yes, completely. That's what I was expecting.

Alright, then where do you actually specify your condition?
Have I missed that part in the tutorial?

User avatar
david63
Jr. Extension Validator
Posts: 14763
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Extending Auto Groups extention

Post by david63 » Tue Jul 03, 2018 8:56 pm

Kami-sama wrote:
Tue Jul 03, 2018 8:19 pm
where do you actually specify your condition?
It is in the conditions/type/[filename]
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
Kami-sama
Registered User
Posts: 104
Joined: Sat May 26, 2018 3:07 pm

Re: Extending Auto Groups extention

Post by Kami-sama » Tue Jul 03, 2018 9:00 pm

I get that, but in the code it only says:

Code: Select all

// The user data this condition needs to check
	$condition_data = array(
		$this->get_condition_field(),
		// additional fields can be added here
	);
Where do you actually initialise condition_data / get_condition_field?
Your example ext has similar code to membership condition, but I don't see distinct differences, that would answer my question.


Nevermind, I think I found it. Wow, what a pain this was :D
I was right, I was missing something, lol.

WOW, this is actually working! Wow. Thank you a lot.
The last question I would have is, does it automatically recync for you?

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests