[2.0.6] Prune User Posts

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
21
66%
Very Good
5
16%
Good
3
9%
Fair
0
No votes
Poor
3
9%
 
Total votes: 32

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 » Wed Mar 03, 2004 1:11 am

Did you upload the template files to all the template admin directories? /templates/template_name/admin

Nautilus_Xtrem!!
Registered User
Posts: 15
Joined: Tue Mar 02, 2004 4:27 am

Post by Nautilus_Xtrem!! » Thu Mar 04, 2004 12:04 am

I downloaded your pruning mod but it's not exactly what I want or need. Maybe if I just discribe what I need then you guys can tell me if this or someother mod is what I need. I have ranks set up and some are fairly high in post count. We like to keep our forums, which are small, clean and tidy, so that means we delete old and useless posts all the time. But at the same time we don't delete whole groups of posts too often so the pruning mod seems like bringing a howitzer to a knife fight. But on the other hand if we just delete single posts post counts decrease which is what we don't want. Someone let me know what I need please.

khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax » Fri Mar 26, 2004 7:46 pm

is it possible for me to prune the replies/posts but not the actual topic in a forum?

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 » Tue Mar 30, 2004 2:07 am

khisanthax wrote: is it possible for me to prune the replies/posts but not the actual topic in a forum?

Nope, no such feature exists in this version.

Andrew Mills
Registered User
Posts: 9
Joined: Sun Jan 11, 2004 9:21 pm
Location: Dundee, Scotland
Contact:

Re: Queries

Post by Andrew Mills » Mon May 17, 2004 6:08 pm

afx114 wrote: Also, unrelated, but I think it would be wise for you to change the default selected radio button of the Date Criteria from "All Posts" !!!! The combination of "All Users" and "All Dates" is can very easily lead to accidental loss of all posts, I've come very close to doing so myself! Force the admin to specifically and manually select "All Posts" in order to avoid massive meltdown. Or perhaps a JavaScript confirmation box: "Are you sure you want to delete posts from All Users and All Dates? This will delete every single post in the DB!!!"

He has a VERY good point. If it wasn't for reading ALL the way through this topic before downloading and installing your pruning MOD, I too woul dhave accidentilly deleted EVERY SINGLE post on my forum as the Date Criteria default dot is on: All Posts 8O

You mod has helped me solve a few MAJOR pruning headaches for my site, but please try and set a deault that doesn't let Admins accidentilly remove their entire forum in your next update.

And thanks again for the MOD. I hope it does exactly what it says on the tin. :D
Andrew Mills
Founder Samus.co.uk

frankderond
Registered User
Posts: 31
Joined: Fri Apr 16, 2004 5:40 pm

Re: Queries

Post by frankderond » Thu Jun 10, 2004 7:43 am

Andrew Mills wrote:
afx114 wrote:Also, unrelated, but I think it would be wise for you to change the default selected radio button of the Date Criteria from "All Posts" !!!! The combination of "All Users" and "All Dates" is can very easily lead to accidental loss of all posts, I've come very close to doing so myself! Force the admin to specifically and manually select "All Posts" in order to avoid massive meltdown. Or perhaps a JavaScript confirmation box: "Are you sure you want to delete posts from All Users and All Dates? This will delete every single post in the DB!!!"

He has a VERY good point. If it wasn't for reading ALL the way through this topic before downloading and installing your pruning MOD, I too woul dhave accidentilly deleted EVERY SINGLE post on my forum as the Date Criteria default dot is on: All Posts 8O

You mod has helped me solve a few MAJOR pruning headaches for my site, but please try and set a deault that doesn't let Admins accidentilly remove their entire forum in your next update.

And thanks again for the MOD. I hope it does exactly what it says on the tin. :D


I would like to get an overview of all the topics that will be deleted before I confirm the pruning. Besides that it would be nice when I can save the options per forum, so that I can run the pruning of every forum (with different settings) by one click.

Maybe, I ask to much?

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Re: Queries

Post by R45 » Thu Jun 10, 2004 7:03 pm

frankderond wrote:
Andrew Mills wrote:
afx114 wrote:Also, unrelated, but I think it would be wise for you to change the default selected radio button of the Date Criteria from "All Posts" !!!! The combination of "All Users" and "All Dates" is can very easily lead to accidental loss of all posts, I've come very close to doing so myself! Force the admin to specifically and manually select "All Posts" in order to avoid massive meltdown. Or perhaps a JavaScript confirmation box: "Are you sure you want to delete posts from All Users and All Dates? This will delete every single post in the DB!!!"

He has a VERY good point. If it wasn't for reading ALL the way through this topic before downloading and installing your pruning MOD, I too woul dhave accidentilly deleted EVERY SINGLE post on my forum as the Date Criteria default dot is on: All Posts 8O

You mod has helped me solve a few MAJOR pruning headaches for my site, but please try and set a deault that doesn't let Admins accidentilly remove their entire forum in your next update.

And thanks again for the MOD. I hope it does exactly what it says on the tin. :D


I would like to get an overview of all the topics that will be deleted before I confirm the pruning. Besides that it would be nice when I can save the options per forum, so that I can run the pruning of every forum (with different settings) by one click.

Maybe, I ask to much?

It's a very good idea, however I've had little time of late to work on anything phpBB related unfortunately. I will keep this idea in mind.

Emanuele
Registered User
Posts: 9
Joined: Wed Jun 02, 2004 10:29 pm
Location: Italy

Post by Emanuele » Sun Jul 11, 2004 11:04 am

khisanthax wrote: is it possible for me to prune the replies/posts but not the actual topic in a forum?


Hi, I needed this feature, because I use topics as categories and need to autoprune only replies, based on time.
So I modified the default prune() function to prune only outdated posts, leaving the first post of every topic.

Here is my modified prune() function (in includes/prune.php):

Code: Select all

function prune($forum_id, $prune_date, $prune_all = false)
{
	global $db, $lang;

	//
	// Recupera tutti i post_id dei primi messaggi di ciascuna discussione
	// (che dovranno essere esclusi dal prune)
	//
	$sql = "SELECT topic_first_post_id
		FROM " . TOPICS_TABLE . "
		WHERE forum_id = $forum_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain lists of topics to prune', '', __LINE__, __FILE__, $sql);
	}

	$exclude_posts = '';
	while( $row = $db->sql_fetchrow($result) )
	{
		$exclude_posts .= ( ( $exclude_posts != '' ) ? ', ' : '' ) . $row['topic_first_post_id'];
	}
	$db->sql_freeresult($result);
		
	if( $exclude_posts != '' )
	{
		$sql = "SELECT post_id
			FROM " . POSTS_TABLE . " 
			WHERE forum_id = $forum_id " .
	 			(($prune_date != '')? "AND post_time < $prune_date" : "" ) . "
				AND post_id NOT IN ($exclude_posts)";
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not obtain list of posts to prune', '', __LINE__, __FILE__, $sql);
		}

		$sql_post = '';
		while ( $row = $db->sql_fetchrow($result) )
		{
			$sql_post .= ( ( $sql_post != '' ) ? ', ' : '' ) . $row['post_id'];
		}
		$db->sql_freeresult($result);

		if ( $sql_post != '' )
		{
			$pruned_topics = 0;

			$sql = "DELETE FROM " . POSTS_TABLE . " 
				WHERE post_id IN ($sql_post)";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete post_text during prune', '', __LINE__, __FILE__, $sql);
			}

			$pruned_posts = $db->sql_affectedrows();

			$sql = "DELETE FROM " . POSTS_TEXT_TABLE . " 
				WHERE post_id IN ($sql_post)";
			if ( !$db->sql_query($sql) )
			{
				message_die(GENERAL_ERROR, 'Could not delete post during prune', '', __LINE__, __FILE__, $sql);
			}

			remove_search_post($sql_post);
//-- mod : attach mod ------------------------------------------------------------------------------
//-- add
			prune_attachments($sql_post);
//-- end mod : attach mod --------------------------------------------------------------------------

			return array ('topics' => $pruned_topics, 'posts' => $pruned_posts);
		}
	}

	return array('topics' => 0, 'posts' => 0);
}
NOTE: I have installed the Attachment MOD, if you haven't it, simply remove the //-- mod : attach mod lines

nik0l
Registered User
Posts: 3
Joined: Fri Jul 16, 2004 8:49 pm

Post by nik0l » Sat Jul 17, 2004 9:56 pm

R45
Dear R45, I have installed your MOD. It has beatiful options. But i want to prune all posts of specified user. I selected options, wrote his member name and click to submit button. MOD reported me that all posts has been succesfully pruned. But I can see all his posts on forum. I mean no post was deleted. Can you help me in this case ?

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 » Sun Jul 18, 2004 2:01 pm

nik0l wrote: R45
Dear R45, I have installed your MOD. It has beatiful options. But i want to prune all posts of specified user. I selected options, wrote his member name and click to submit button. MOD reported me that all posts has been succesfully pruned. But I can see all his posts on forum. I mean no post was deleted. Can you help me in this case ?

Which options did you select?

nik0l
Registered User
Posts: 3
Joined: Fri Jul 16, 2004 8:49 pm

Post by nik0l » Sun Jul 18, 2004 9:25 pm

Just Simple options, i selected 3 forums, typed his member name, selected option "All Messages". And Select Pruning Options, like Yes or No.
The number of his posts is 186. That's All.

R45
Registered User
Posts: 2830
Joined: Tue Nov 27, 2001 10:42 pm

Post by R45 » Fri Jul 23, 2004 6:43 pm

nik0l wrote: Just Simple options, i selected 3 forums, typed his member name, selected option "All Messages". And Select Pruning Options, like Yes or No.
The number of his posts is 186. That's All.

I'm not aware of any bugs in this MOD at present. Which specific pruning options did you set (yes/no section)?

webiser
Registered User
Posts: 33
Joined: Wed Feb 05, 2003 9:04 am
Location: France
Contact:

Post by webiser » Mon Sep 20, 2004 7:38 am

nice mod :)

can you explain a method to add a message on index showing "Prune is active on this forum"

thx :)

yewknee
Registered User
Posts: 1
Joined: Tue Sep 21, 2004 6:46 pm

Username contains problematic character

Post by yewknee » Tue Sep 21, 2004 6:55 pm

I've done a bit of reading on the phpBB forums in search of someone else having this problem and have not seen it mentioned so I'm hoping that someone who understands how this MOD works can help me out.

So far, the user prune mod has worked exactly as I've needed it. However, I am trying to prune a large group of messages from a user with a username such as "RockN'Roll", which would seem to be no big deal at first, but that single apostrophe is pretty much halting the script before it can even run. I can search the user database for the user and it shows up fine but when I run the User Prune script it says that the user does not exist. I can only assume that the apostrophe is terminating the search function prematurely.

I realize that the function is adding slashes and trimming the username value from HTTP_POST_VARS but I'm still hitting a roadblock here.

Any suggestions on how to circumvent this?


Michael

User avatar
jjjjan
Registered User
Posts: 2
Joined: Wed Sep 22, 2004 9:43 am
Location: .eu
Contact:

feature request ;-)

Post by jjjjan » Wed Sep 22, 2004 10:32 am

Hi folks,

it's great, thanks! - but i would like to use another feature like

delete all threads
+ from user X
+ with no reply
++ within 24 hours after posting

to get rid of allmost empty threads. Anybody having an idea how to do that or which mod i need?

Thanks to all the developers - phpBB is great :-)
Greetings
jjjjan @ Schwedenforum

Post Reply

Return to “[2.0.x] MOD Database Cleanup”