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: 4
Joined: Tue Jan 01, 2019 6:25 pm

Programmatically Delete User/Posts

Post 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?
User avatar
AmigoJack
Registered User
Posts: 6108
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Programmatically Delete User/Posts

Post by AmigoJack »

mkingsbu wrote: Tue Jan 01, 2019 6:35 pmI 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 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." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
mkingsbu
Registered User
Posts: 4
Joined: Tue Jan 01, 2019 6:25 pm

Re: Programmatically Delete User/Posts

Post by mkingsbu »

AmigoJack wrote: Wed Jan 02, 2019 9:32 am
mkingsbu wrote: Tue Jan 01, 2019 6:35 pmI 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
Jr. Extension Validator
Posts: 11234
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Programmatically Delete User/Posts

Post 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. :?
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
mkingsbu
Registered User
Posts: 4
Joined: Tue Jan 01, 2019 6:25 pm

Re: Programmatically Delete User/Posts

Post 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!
Post Reply

Return to “phpBB Custom Coding”