Programmatically Delete User/Posts

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
mkingsbu
Registered User
Posts: 3
Joined: Tue Jan 01, 2019 6:25 pm

Programmatically Delete User/Posts

Post by mkingsbu » Tue Jan 01, 2019 6:35 pm

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?

User avatar
AmigoJack
Registered User
Posts: 5423
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Programmatically Delete User/Posts

Post by AmigoJack » 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.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

mkingsbu
Registered User
Posts: 3
Joined: Tue Jan 01, 2019 6:25 pm

Re: Programmatically Delete User/Posts

Post by mkingsbu » Wed Jan 02, 2019 2:53 pm

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

User avatar
warmweer
Registered User
Posts: 1776
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Programmatically Delete User/Posts

Post by warmweer » 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. :?
A bug is a feature that hasn't made it to the manual (yet)

mkingsbu
Registered User
Posts: 3
Joined: Tue Jan 01, 2019 6:25 pm

Re: Programmatically Delete User/Posts

Post by mkingsbu » Thu Jan 03, 2019 5:17 am

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!

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 16 guests