how to push post with external script

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
Swen
Registered User
Posts: 72
Joined: Sun Oct 04, 2015 5:44 pm

how to push post with external script

Post by Swen » Sun Oct 25, 2015 2:53 pm

Hi guys,

what are the requirements to push a post with an external script in to phpbb3.1?

I want to develop a script that post special messages from my system in to a special existing thread. How can i do this? What files i need for include and what must i do that e.g. Bot1 can post in thread "livepost" with id 13?

I dont want a complete script here. Only the sql query and files that i need.

Thank you!
Regards Swen

User avatar
imkingdavid
Former Team Member
Posts: 2667
Joined: Sun Jul 26, 2009 7:59 pm
Location: EST
Name: David King

Re: how to push post with external script

Post by imkingdavid » Sat Oct 31, 2015 4:27 am

Because there are multiple parts of the software that need to be updated when a post is added, there isn't just a simple query that can be run.

But I think the best way to learn what all goes on and what all you need to account for, and how to do it in the first place, would be to look at the actual code in the core. I'd start in functions_post.php. Look for the submit_post() function. You may also need to look at the context surrounding it when it is called in posting.php

Since that function likely requires certain parts of phpBB core to be included, you can't include the functions_post.php file and call that function, but you can likely extract and adapt parts of the function to do what you need.
Don't forget to smile today. :)
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Wardormeur
Registered User
Posts: 142
Joined: Sun Jan 27, 2013 9:22 am

Re: how to push post with external script

Post by Wardormeur » Wed Nov 04, 2015 8:28 am

I did it for the Wordpress bridge here if you want an example : https://github.com/Wardormeur/wpphpbbun ... c/Post.php

Swen
Registered User
Posts: 72
Joined: Sun Oct 04, 2015 5:44 pm

Re: how to push post with external script

Post by Swen » Wed Nov 04, 2015 4:34 pm

Nice, thanks Wardormeur. Will check this. Big thanks.
Regards Swen

Post Reply

Return to “Extension Writers Discussion”