I was trying to add a new feature to my extension that would allow users to reply to posts as another user and change some of their posts' ownership when I stumbled upon an implementation problem. I tried to find a way to accomplish this in phpBB but I couldn't find anything. I did some research and came to the following conclusion:
The
submit_post
function in includes/function_posting.php
has a $data
array parameter with poster_id
but it is not used to post as that user. This makes it pointless to wait for the core.posting_modify_submit_post_before
event as there's no way to change the poster before the post is actually published.There exists a
change_post
function under includes/mcp/mcp_post.php
that's part of the MCP's feature to change the poster of a given post. Unfortunatelly, this function is not accessible from within the post creation and edit interface because it's only included in includes/mcp/mcp_main.php
.This function would allow me to accomplish what I want by doing extra queries (not ideal but would do the trick) after the post is already published using the
core.posting_modify_submit_post_after
event.What should I do? Is it okay if I just include the file containing this function in the posting interface (from withing my extension, of course) or should I implement this functionality (copy & paste it)? Am I missing something? Is there any other way to do this? Maybe an easier way?
Thanks for your attention.