Page 1 of 1

Programmatically Delete User/Posts

Posted: Tue Jan 01, 2019 6:35 pm
by mkingsbu
I'm running phpBB 3.2.5 on PHP 7.0.33-1. I wrote some scripts utilizing the user_add() and submit_post() functionality.

I'm looking for something similar that will allow me to ban members as well as delete posts programmatically. I don't see these functions documented, do they exist and if so where might I find them? Similarly, if not, is there a way to do this programmatically without wrecking my database?

Re: Programmatically Delete User/Posts

Posted: Wed Jan 02, 2019 9:32 am
by AmigoJack
mkingsbu wrote:
Tue Jan 01, 2019 6:35 pm
I don't see these functions documented, do they exist and if so where might I find them?
In the same file as user_add() - if you don't know where this one resides to begin with then open /includes/functions_user.php. In there you'll also find user_ban(), along with comments explaining each parameter.

In another file, /includes/functions_admin.php, you'll find delete_posts() as well as delete_topics(). To get a first impression on how they work I suggest searching all PHP files for their name(s) to see how they're invoked, and if you then still have questions go ask them.

Re: Programmatically Delete User/Posts

Posted: Wed Jan 02, 2019 2:53 pm
by mkingsbu
AmigoJack wrote:
Wed Jan 02, 2019 9:32 am
mkingsbu wrote:
Tue Jan 01, 2019 6:35 pm
I don't see these functions documented, do they exist and if so where might I find them?
In the same file as user_add() - if you don't know where this one resides to begin with then open /includes/functions_user.php. In there you'll also find user_ban(), along with comments explaining each parameter.

In another file, /includes/functions_admin.php, you'll find delete_posts() as well as delete_topics(). To get a first impression on how they work I suggest searching all PHP files for their name(s) to see how they're invoked, and if you then still have questions go ask them.
Perfect! I'll check out where they're utilized elsewhere and do that. I transferred an old forum, which I had scraped, into phpBB by making similar PHP files that I was able to invoke with Python :lol: I should probably take an hour to go through the syntax and learn how to do basic scripting with it. Been resisting since I can use Python for just about anything. But seeing as I'm administering a forum built in PHP... well, makes sense that I should know the basics.

Thanks for the help!
-Matt

Re: Programmatically Delete User/Posts

Posted: Wed Jan 02, 2019 5:11 pm
by warmweer
mkingsbu wrote:
Wed Jan 02, 2019 2:53 pm
... I should probably take an hour to go through the syntax and learn how to do basic scripting with it.
I wish an hour were all it needs. :?

Re: Programmatically Delete User/Posts

Posted: Thu Jan 03, 2019 5:17 am
by mkingsbu
warmweer wrote:
Wed Jan 02, 2019 5:11 pm
mkingsbu wrote:
Wed Jan 02, 2019 2:53 pm
... I should probably take an hour to go through the syntax and learn how to do basic scripting with it.
I wish an hour were all it needs. :?
Haha, fair enough! I do know Bash, Perl, Python, and R so hopefully that counts for something with helping me learn!