Introduciator MOD -> Extension

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Feneck91
Registered User
Posts: 115
Joined: Mon May 20, 2013 9:47 am
Name: Stéphane Château
Contact:

Introduciator MOD -> Extension

Post by Feneck91 »

I began long time ago to port my MOD Introduciator to an extension.
A part of work is done since February 2016. Now I'll try to go to the end to be able to deploy it in realease mode.

But I have a lot of hard points with this developpement. I post here and expect some peaple can help me.

First problem : I use core.posting_modify_submit_post_before event.
When the user post it's introduce, depending of extension configuration, I must be able to force the subjet to be approval state.
I try to modify $event['data']['force_approved_state'] into "public function on_submit_post($event) "but nothing is done, I think it's not possible to change datas pass to the event hook.
Is it possible ? Do I use something wrong ?

Thanks for your reply...
Last edited by JimA on Sat Jan 27, 2018 8:12 pm, edited 1 time in total.
Reason: Moved from Extensions in Development to Extensions Writers Discussion
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Introduciator MOD -> Extension

Post by 3Di »

Feneck91 wrote: Sat Jan 27, 2018 6:00 pm I must be able to force the subjet to be approval state.
I try to modify $event['data']['force_approved_state']
There is no more force_approved_state AFAIR, has been replaced in 3.1.x by
'force_visibility' => true,
(true if you want to force the topic/post's approvation, false otherwise)

You may want to have a look at the function submit_post() itself, located in includes/functions_posting.php
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
Feneck91
Registered User
Posts: 115
Joined: Mon May 20, 2013 9:47 am
Name: Stéphane Château
Contact:

Re: Introduciator MOD -> Extension

Post by Feneck91 »

Strange, I use 3.1.3 version to develop my extension, and into the source code I can see force_approved_state :

Code: Select all

			// Check the permissions for post approval.
			// Moderators must go through post approval like ordinary users.
			if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
			{
				meta_refresh(10, $redirect_url);
				$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
				$message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']);
				$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>');
				trigger_error($message);
			}
Should I use a more recent version of phpBB ? In this case my exension will not work with older versions of phpBB 3.1.x ?
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Introduciator MOD -> Extension

Post by david63 »

It seems somewhat pointless starting to develop an extension for phpBB 3.1 when it has already reached EOL
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
Feneck91
Registered User
Posts: 115
Joined: Mon May 20, 2013 9:47 am
Name: Stéphane Château
Contact:

Re: Introduciator MOD -> Extension

Post by Feneck91 »

What is the best version to start with ? If I take the last one, only latest formum up to date will be able to use my extension...
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: Introduciator MOD -> Extension

Post by GanstaZ »

Start with 3.2 branch (3.2.2 & soon it will reach 3.2.3).. Forget about older versions, their time has reached the end.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Introduciator MOD -> Extension

Post by 3Di »

Feneck91 wrote: Sun Jan 28, 2018 6:45 am Strange, I use 3.1.3 version to develop my extension, and into the source code I can see force_approved_state :
.... snip ...
Should I use a more recent version of phpBB ? In this case my exension will not work with older versions of phpBB 3.1.x ?
Oh, I am realizing - now - what you are after, indeed. :)

So I searched for the MOD you are bound to port to phpBB 3.1.x or 3.2.x
(which I suggest to start with 3.2.1 at the present time, has been already mentioned 3.1.x is EoL)

that's your MOD viewtopic.php?f=69&t=2318016
(next time, please, provide us the link, instead to make us searching for it in order to try and help you out, thx :) )
This mod force member to introduce himself into a specific forum before beeing able to post everywhere into the forum.

... snip ...
I don't want to ruin the party here but.. may I ask you why you are wasting (IMHO) your time re-inventing the wheel? :?
All of this can be achieved using the Newly Registered Users group and the native phpBB permissions.

Therefore this MOD isn't needed with the new phpBBs (I mean after Olympus).
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
Feneck91
Registered User
Posts: 115
Joined: Mon May 20, 2013 9:47 am
Name: Stéphane Château
Contact:

Re: Introduciator MOD -> Extension

Post by Feneck91 »

I'm really sorry for the missing link to my old mod, thanks to you to have put it here.
When I wrote the MOD few years ago, same remarks: you don't need to write it, all can do with permissions. But in fact not really.
Look at the screenshot into the mod description: add buttons under avatar to jump easily to an user introduce (and into the profile too).
Under a forum that contains lot of messages, how to force users to introduce themself ? All have alredy post a lot of messages, you cannot use the number of message to put user into a specific group to force introduce.
I'll try to continue porting it into extension...
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Introduciator MOD -> Extension

Post by 3Di »

Feneck91 wrote: Mon Jan 29, 2018 3:11 am But in fact not really.
That's true based on the description I above quoted.
Feneck91 wrote: Mon Jan 29, 2018 3:11 am add buttons under avatar to jump easily to an user introduce (and into the profile too).

Under a forum that contains lot of messages, how to force users to introduce themself ? All have alredy post a lot of messages, you cannot use the number of message to put user into a specific group to force introduce.
So you want also old users to be forced to introduce themselves after a lot of posts?

Then you should add a field in the user table (BOOL) like ' introduced', to be done within a migration file...
having a bool means Yes or Not, and use it for your scope, being the user object (Suser) available almost everywhere in the code, your work will be very easy... simply check if ($this->user->data['introduced'] is true or false

(or depending on the event could also be $event['rowset_data']['introduced'] when using the event core.viewtopic_post_rowset_data())

..and now you need also to add a custom permission, example 'u_can_post_with_no_introducion', always within a migration, and use it to play your game with the $auth object, this time.

like

Code: Select all

$the_permission = (bool) $this->auth->acl_get('u_can_post_with_no_introducion');
$the_user_has_introduced = (bool) $this->user->data['introduced'];

if ($the_permission && $the_user_has_introduced)
{
// do this and that
}
Just to throw some example and give to you a start.. simply written on the fly.

Useful links
- https://area51.phpbb.com/docs/dev/3.2.x ... index.html
- https://wiki.phpbb.com/Event_List

No need to modify the native permissions or the like, for the newly registered users, use the NRU group, the above is for old members.

To add, I wrote an extension which is not yet public..
viewtopic.php?f=456&t=2412451&hilit=The+receptionist
which approaches the goal under a different point of view, for new and old members as well.. and no, it doesn't mean yours is the same, absolutely. :)

So, ok.. try and try again.. and ask.
Somebody will reply, usually.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Post Reply

Return to “Extension Writers Discussion”