-
Improvement
-
Resolution: Fixed
-
Minor
-
3.2.5
-
phpBB 3.2.5 / php 7.2.14 / Wampserver under Windows / Apache 2.4.37
Hello everybody.
I'm trying to do my best but I'm not sure about all field to fill...
The goal of this ticket is to add a new event on posting.php.
Just after the row has been fetch, to be able to bypass reply / quote test of an unapproved post.
I had develop few years ago a MOD named Introduciator that was able to let user to edit own post that was in approbation state and let moderator to reply into the topic BEFORE approval (or not) the topic.
Actually I migrate this MOD to extension, the GitHub extension is : https://github.com/Feneck91/Introduciator
It is the only one event that is missing to make the goal: publish this new extension, or I'll be force to remove one of the best feature of this extension: the ability of the user and moderator to exchange ideas to correct user's introduction before the introduction be accepted.
Code to Apply:
Search in posting.php: // Not able to reply to unapproved posts/topics
Add-Before:
$vars = array(
'post_data',
'poll',
'mode',
'topic_id',
'forum_id',
'post_author_name',
);
extract($phpbb_dispatcher->trigger_event('core.posting_modify_row_data', compact($vars)));
I send all parameters in case of other users want to code other features that need différents parameter than me.
Another way was using new parameter into the event like 'ignore_visibility_overwrite" that is test just after like :
// Not able to reply to unapproved posts/topics
// TODO: add more descriptive language key
if (!ignore_visibility_overwrite && ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && $post_data['topic_visibility'] != ITEM_APPROVED) || ($mode == 'quote' && $post_data['post_visibility'] != ITEM_APPROVED))))
Unknown macro: { trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' }
I'm not sure the event's name 'core.posting_modify_row_data' was the best, may be the core developper will choose a best one.
Best regard,
Stéphane Château