Warning: The author of this contribution does not provide support for it anymore.

Prime Trash Bin

Portability extension for 3.1.2 ? - Prime Trash Bin

Portability extension for 3.1.2 ?

by Scoufy » Sun Feb 01, 2015 11:04 pm

Hello,
For a long time I use this handy mod. Do you have an extension into portability 3.1.2?
Sorry for my bad English, I do not speak any language (French speaking), I use a translator...
Scoufy
Registered User
Posts: 51
Joined: Wed Feb 01, 2012 5:15 pm
Contact:

Re: Portability extension for 3.1.2 ?

by primehalo » Mon Feb 02, 2015 3:09 am

I'm pretty sure it's not needed for phpBB 3.1.x. I haven't tested phpBB 3.1.x extensively yet but I'm pretty sure this feature is built in.
Ken F. Innes IV
My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
primehalo
Former Team Member
Posts: 2702
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: Portability extension for 3.1.2 ?

by Scoufy » Mon Feb 02, 2015 3:22 pm

This is likely to be built, I forgot? sorry ... :oops:

But when migrating the forum to 3.1, what will become of the old messages "hidden" in your mod? (since it is not really deleted / deleted)
Sorry for my bad English, I do not speak any language (French speaking), I use a translator...
Scoufy
Registered User
Posts: 51
Joined: Wed Feb 01, 2012 5:15 pm
Contact:

Re: Portability extension for 3.1.2 ?

by primehalo » Tue Feb 03, 2015 11:39 pm

Before upgrading to 3.1.2, I would recommend deleting all of the "hidden" messages. Use phpmyadmin to delete all posts where post_deleted_time is greater than zero.

Eventually I may write a script to convert the hidden messages into phpBB 3.1.x deleted messages, but I have no plans for that yet.
Ken F. Innes IV
My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
User avatar
primehalo
Former Team Member
Posts: 2702
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: Portability extension for 3.1.2 ?

by Ectoman » Thu Dec 03, 2015 6:58 am

Converting the Prime Trash Bin Mod from a 3.0.x board to a 3.1.x board is actually very easy. It can be accomplished with these four SQL commands that can be run in phpmyadmin or similar:

Code: Select all

UPDATE phpbb3_posts SET post_delete_time = post_deleted_time, post_delete_reason = post_deleted_reason, post_delete_user = post_deleted_user, post_visibility = 2 WHERE post_deleted_time > 0 AND post_delete_time = 0;


The above code simply copies the values from the prime trash bin columns and puts it into the new 3.1 data columns. This isn't enough to hide the post, so post visibility must be set to 2. This removes the post from view.

Code: Select all

UPDATE phpbb3_topics SET topic_delete_time = topic_deleted_time, topic_delete_reason = topic_deleted_reason, topic_delete_user = topic_deleted_user, topic_visibility = 2 WHERE topic_deleted_time > 0 AND topic_delete_time = 0;


Nearly the same exact SQL as the first one, but this works on the topics table.

Code: Select all

UPDATE phpbb3_posts pp, phpbb3_topics pt SET pp.post_delete_time = pt.topic_delete_time, pp.post_delete_reason = pt.topic_deleted_reason, pp.post_delete_user = pt.topic_deleted_user, pp.post_visibility = 2 WHERE pp.post_id = pt.topic_first_post_id AND pt.topic_deleted_time > 0 AND pp.post_delete_time = 0;


Now the 3.1 version of the Prime Trash Bin actually needs the first post to be deleted when the topic is deleted. This SQL takes the first post id and copies over the delete information, only if the post hasn't already been deleted.

Code: Select all

UPDATE phpbb3_posts pp, phpbb3_topics pt SET pp.post_delete_time = pt.topic_delete_time, post_delete_user = pt.topic_deleted_user, pp.post_visibility = 2 WHERE pp.topic_id = pt.topic_id AND pt.topic_deleted_time > 0 AND pp.post_delete_time = 0;


Finally, on the 3.1 version of the Prime Trash Bin, when a topic is deleted... ALL posts are also deleted. This SQL will mark them as deleted and remove their visibility. The reason for the deletion is not copied over, because the reason for those posts being deleted is not the same as the main post (typically).

Once those have been run, you should resync all forum posts and topics in the Admin Panel.

Hope this helps everyone.
Ectoman
Registered User
Posts: 102
Joined: Sat Dec 15, 2001 3:53 pm
Location: Denver, CO
Name: AJ Quick
Contact:

Re: Portability extension for 3.1.2 ?

by combuster » Sun May 22, 2016 9:19 pm

You should also update the phpbb_topics table's topic_posts_softdeleted field. I guess it should contain the count of soft-deleted posts in the topic. This SQL statement updates it accordingly:

Code: Select all

UPDATE phpbb_topics AS t
   INNER JOIN
       (SELECT topic_id, COUNT(1) posts_count
         FROM phpbb_posts as p
         WHERE p.post_delete_time > 0
         GROUP BY p.topic_id
       ) AS j
       USING (topic_id)
SET t.topic_posts_softdeleted = j.posts_count
combuster
Registered User
Posts: 342
Joined: Sun Oct 26, 2008 11:58 pm
Contact:

Re: Portability extension for 3.1.2 ?

by Leinad4Mind » Wed Nov 16, 2016 6:15 pm

So when moving from 3.0 to 3.1 I will not use STK to clean this MOD out. And then on 3.1 I'll need to run the sql codes on those 2 last posts? Is that it? And after it I can run STK to clean the mod away.

Another doubt... on 3.1 I couldnt find this: "allows deleted topics to be moved to a specified Trash Bin forum" or am I missing something?

Maybe I need a new extension just for that?
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Leinad4Mind
Translator
Posts: 804
Joined: Sun Jun 01, 2008 11:08 pm
Contact:

Re: Portability extension for 3.1.2 ?

by sakkiotto » Sat Dec 17, 2016 3:37 pm

up
sakkiotto
Registered User
Posts: 209
Joined: Mon Jun 13, 2005 9:45 pm

Re: Portability extension for 3.1.2 ?

by Leinad4Mind » Mon Sep 25, 2017 6:41 pm

For people that had installed SoftDeleteMOD and then moved to TrashBin and wants to upgrade, you'll need to edit phpBB3x\phpbb\db\migration\data\v310\soft_delete_mod_convert2.php

And find:

Code: Select all

$this->table_prefix . 'posts'			=> array('post_deleted', 'post_deleted_time'),
				$this->table_prefix . 'topics'			=> array('topic_deleted', 'topic_deleted_time', 'topic_deleted_reply_count'),
Replace with:

Code: Select all

$this->table_prefix . 'posts'			=> array('post_deleted'),
				$this->table_prefix . 'topics'			=> array('topic_deleted', 'topic_deleted_reply_count'),
To check if you had SoftDeleteMOD, just check if you have in posts table, "post_deleted" column and "post_deleted_time"
Want to access all my portuguese MOD and Extension translations?
Become my Patreon!
phpBB Portugal Translator and Moderator
User avatar
Leinad4Mind
Translator
Posts: 804
Joined: Sun Jun 01, 2008 11:08 pm
Contact:


cron