[MODDB] Prime Trash Bin - Keep deleted topics & posts

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Ideas Centre
influencee
Registered User
Posts: 10
Joined: Sat Sep 09, 2006 11:11 am

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by influencee »

Can anyone help I've done something stupid, by accident I clicked the divider line below "dont use the recycle bin" in acp board settings. Now the option is no longer there in board settings.
User avatar
primehalo
Former Team Member
Posts: 2995
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by primehalo »

influencee wrote:Can anyone help I've done something stupid, by accident I clicked the divider line below "dont use the recycle bin" in acp board settings. Now the option is no longer there in board settings.
Strange, the divider line isn't supposed to be selectable. To fix this, open "includes/acp/acp_board.php" and temporarily delete the line:

Code: Select all

unset($display_vars['vars']['recycle_bin_forum']);
Once the option comes back, undelete the line. I will see if I can't fix this for the next release.

UPDATE:
Okay, I think I have a fix. Open "includes/acp/acp_board.php"
Find

Code: Select all

            $recycle_bin_options .= '<option disabled="disabled" class="disabled-option">' . $user->lang['PRIME_RECYCLE_BIN_DIVIDER'] . '</option>';   
Replace with

Code: Select all

            $recycle_bin_options .= '<option value="0" disabled="disabled" class="disabled-option">' . $user->lang['PRIME_RECYCLE_BIN_DIVIDER'] . '</option>';   
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
influencee
Registered User
Posts: 10
Joined: Sat Sep 09, 2006 11:11 am

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by influencee »

Cheers it worked a treat :D
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by cotp »

primehalo wrote:
cotp wrote:Hello and thanks for this great mod :P

When I delete a post, it display who deleted the post and that a post was deleted, I would like to know if there would be a way so that only admin an moderators would see that information ?
This is an option I plan to add in a future version, but for now you should be able to accomplish this by making the following change to viewtopic_body.html

Find

Code: Select all

<div class="ignore">{postrow.L_IGNORE_POST}</div>
Replace with

Code: Select all

<!-- IF not postrow.S_DELETED or (postrow.S_DELETED and S_TOPIC_MOD) --><div class="ignore">{postrow.L_IGNORE_POST}</div><!-- ENDIF -->

Oh oh I have other news :? :oops:

There was still a line that members could see

so I solved it by adding the same code than above before

Code: Select all

<div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1
and putting the endif after

Code: Select all

<hr class="divider" />
but there is still a problem:

When I delete some posts, the number of total posts don't change nor the last poster.

So let's say I have 5 posts, my moderators deleted 2 of them, then it still says 5 posts and last poster is "donald" but when you open the topic no trace of donald :(

Hope I explained it clearly and that you will be able to help me on that one too...

Cotp
User avatar
Rotsblok
Registered User
Posts: 648
Joined: Fri Nov 11, 2005 12:47 pm
Location: Upper north of Holland
Name: Rikkert Westa

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by Rotsblok »

Primo might be a nice feature if you made the permanently deletion of topcis a permission so that you can make it that Global mods do not have the full power of deleting whole topics/posts but that only the admin it can do
Nederlandse Support site
Several dutch translations for 3.1 extensions if you need one or there is an update of an extension feel free to notify me.
User avatar
primehalo
Former Team Member
Posts: 2995
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by primehalo »

cotp wrote:When I delete some posts, the number of total posts don't change nor the last poster.

So let's say I have 5 posts, my moderators deleted 2 of them, then it still says 5 posts and last poster is "donald" but when you open the topic no trace of donald :(

Hope I explained it clearly and that you will be able to help me on that one too...

Cotp
This has been fixed in the next version. I was planning on releasing it yesterday but I just haven't had time to write up the installation instructions yet.
Rotsblok wrote:Primo might be a nice feature if you made the permanently deletion of topcis a permission so that you can make it that Global mods do not have the full power of deleting whole topics/posts but that only the admin it can do
The next version has Permanent Delete and Undelete permissions, so you can specify who gets them.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by cotp »

primehalo wrote:This has been fixed in the next version. I was planning on releasing it yesterday but I just haven't had time to write up the installation instructions yet.
Great news, take your time, you deserve it :)

Will wait for next version ;)

EDIT:
One more thing, when you click on view the post on a deleted post, you can't view who the poster was... for a moderator or admin it is a precious info...

Cotp
User avatar
primehalo
Former Team Member
Posts: 2995
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by primehalo »

cotp wrote:One more thing, when you click on view the post on a deleted post, you can't view who the poster was... for a moderator or admin it is a precious info...
Yep, I realized that too, which is why that also made it into the next release, as well as the deleted post's subject.

I've just released version 0.2.0, and the update instructions for this one are a little different than previous versions. A lot of the code was moved around and split into separate files for easier future maintance and updating.

To update, you'll need to uninstall the previous version, then install the new version, and finally run db_update.php (but don't run it until you've executed the SQL that the new version requires).

This sounds like more of a pain than it actually is. Removing the previous version from the PHP files is pretty simple, just search for and remove everything between (and including):

Code: Select all

//-- mod: Prime Recycle Bin -------------------------------------------------//
 . . . 
//-- end: Prime Recycle Bin -------------------------------------------------//      
You can't do that for the HTML changes, but there weren't very many of those so it should go quick.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by cotp »

primehalo wrote:
cotp wrote:Hello and thanks for this great mod :P

When I delete a post, it display who deleted the post and that a post was deleted, I would like to know if there would be a way so that only admin an moderators would see that information ?
This is an option I plan to add in a future version, but for now you should be able to accomplish this by making the following change to viewtopic_body.html

Find

Code: Select all

<div class="ignore">{postrow.L_IGNORE_POST}</div>
Replace with

Code: Select all

<!-- IF not postrow.S_DELETED or (postrow.S_DELETED and S_TOPIC_MOD) --><div class="ignore">{postrow.L_IGNORE_POST}</div><!-- ENDIF -->

Hello primehalo and thanks the follow up :)

With your new version I don't need to apply the following chages if I want moderator and admin only ?

Cotp
User avatar
primehalo
Former Team Member
Posts: 2995
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

Re: [BETA] Prime Recycle Bin (0.1.8) - Delete Threads To a Forum

Post by primehalo »

cotp wrote:
primehalo wrote:
cotp wrote:Hello and thanks for this great mod :P

When I delete a post, it display who deleted the post and that a post was deleted, I would like to know if there would be a way so that only admin an moderators would see that information ?
This is an option I plan to add in a future version, but for now you should be able to accomplish this by making the following change to viewtopic_body.html

Find

Code: Select all

<div class="ignore">{postrow.L_IGNORE_POST}</div>
Replace with

Code: Select all

<!-- IF not postrow.S_DELETED or (postrow.S_DELETED and S_TOPIC_MOD) --><div class="ignore">{postrow.L_IGNORE_POST}</div><!-- ENDIF -->

Hello primehalo and thanks the follow up :)

With your new version I don't need to apply the following chages if I want moderator and admin only ?

Cotp
You would still need to apply that change if you only want moderators and admins to see the message, as that wasn't one of the features that I added. It is still on my to-do list
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm

Re: [BETA] Prime Trash Bin (0.2.0) - Delete Threads To a Forum

Post by cotp »

OK :)

Here is what I did:

1) Total uninstall of previous version
2) Install 0.2.0
3) SQL database instructions
4) In ACP I set: Topic Deletions: Move Topic to the Trash Bin (didn't understand the difference with Move to trash bin with a Shadow and Move to trash bin without a shadow) :?
Trash Bin Forum: selected my trash bin forum
5) Went to set permissions for Global Moderators

6) Made my tests:
1) Deleted a topic and... it PERMANENTLY DELETED the post ! :shock: Can not find it anywhere it the trash bin...

What could have happened ?

Here is a link to the changes I applied, maybe it will also help users if the want to quick install (wait to see if there are not any mistakes)

And I have a question (when I will manage to make this version work) if I move a topic to the trash bin, how can I decide to permanently delete it ?

Thanks for your help and feedback...

Cotp
User avatar
primehalo
Former Team Member
Posts: 2995
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

Re: [BETA] Prime Trash Bin (0.2.0) - Delete Threads To a Forum

Post by primehalo »

cotp wrote:OK :)

Here is what I did:

1) Total uninstall of previous version
2) Install 0.2.0
3) SQL database instructions
4) In ACP I set: Topic Deletions: Move Topic to the Trash Bin (didn't understand the difference with Move to trash bin with a Shadow and Move to trash bin without a shadow) :?
Trash Bin Forum: selected my trash bin forum
5) Went to set permissions for Global Moderators

6) Made my tests:
1) Deleted a topic and... it PERMANENTLY DELETED the post ! :shock: Can not find it anywhere it the trash bin...

What could have happened ?

Here is a link to the changes I applied, maybe it will also help users if the want to quick install (wait to see if there are not any mistakes)

And I have a question (when I will manage to make this version work) if I move a topic to the trash bin, how can I decide to permanently delete it ?

Thanks for your help and feedback...

Cotp
I'll look over those changes when I get a chance, but first off let me ask, did the deletion confirmation page have the area for you to enter a reason for deletion? Because if it does then it should not permanently delete, and if it doesn't then it will permanently delete. It's supposed to be an easy way to tell if you're going to be deleting something permanently or not.

Move Topic to Trash Bin will move the topic to the Trash Bin, and provide an option on the delete confirmation page for you to leave a shadow link behind. Move to Trash Bin with a shadow will automatically leave a shadow topic behind, and Move to Trash Bin without a shadow will move it to the trash bin but will not leave a shadow link behind (or allow you the option of leaving one behind).

Deleting a topic in the Trash Bin will permanently delete it.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm

Re: [BETA] Prime Trash Bin (0.2.0) - Delete Threads To a Forum

Post by cotp »

primehalo wrote:Move Topic to Trash Bin will move the topic to the Trash Bin, and provide an option on the delete confirmation page for you to leave a shadow link behind
It is the setting I chose but indeed it didn't ask me the reason so I guess this is why it permanentely deleted it, maybe by comparing the files I sent you you will be able to tell me what was wrong, I will look in the meanwhile if I found my mistake...

Don't you think a zip file like the one I made would be cool when you install a mod ?

Since I use a compare file program (Beyond Compare), it is very easy to install/uninstall mods this way :)

Cotp
User avatar
primehalo
Former Team Member
Posts: 2995
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA

Re: [BETA] Prime Trash Bin (0.2.0) - Delete Threads To a Forum

Post by primehalo »

cotp wrote:
primehalo wrote:Move Topic to Trash Bin will move the topic to the Trash Bin, and provide an option on the delete confirmation page for you to leave a shadow link behind
It is the setting I chose but indeed it didn't ask me the reason so I guess this is why it permanentely deleted it, maybe by comparing the files I sent you you will be able to tell me what was wrong, I will look in the meanwhile if I found my mistake...

Don't you think a zip file like the one I made would be cool when you install a mod ?

Since I use a compare file program (Beyond Compare), it is very easy to install/uninstall mods this way :)

Cotp
I didn't look through all the files, just the ones for deleting a topic. and those look correct. When you selected Move Topic to Trash Bin, did you verify that the setting was saved? If you try to select that option without selecting a Trash Bin forum first, the option won't change. If you did verify that you have a Trash Bin selected and you have set one of the Move Topic to Trash Bin options, then we'll need to do a little debugging.

The function that displays the fake-delete confirmation page is mcp_stifle_topic() and is located in the "includes/prime_trash_bin_2.php" file. Inside that function you should see "return(false);" occur twice. If the function reaches either of these two points during execution, the function exists and you see the default delete confirmation page (the one that deletes permanently).

This is the first occurrence. Add a trigger_error() to see if this is where the function is exiting. Go to your board and try to delete a thread. If this message comes up then we found the spot. If the delete confirmation page comes up then it must be the next return statement.

Code: Select all

        if (!stifle_topics_enabled())
        {
trigger_error("Permanent delete is turned on!");
            return(false);
        }
  
Including pre-modded files might be an idea worth considering, though it make a bit more work for me.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!
cotp
Registered User
Posts: 445
Joined: Wed Sep 14, 2005 7:34 pm

Re: [BETA] Prime Trash Bin (0.2.0) - Delete Threads To a Forum

Post by cotp »

primehalo wrote:When you selected Move Topic to Trash Bin, did you verify that the setting was saved? If you try to select that option without selecting a Trash Bin forum first, the option won't change. If you did verify that you have a Trash Bin selected and you have set one of the Move Topic to Trash Bin options, then we'll need to do a little debugging.
Yes I did I had chose Move to Trash Bin in my forum named Trash (went there to verify, I changed the settings a few times to check if it was saving ok, yes it does)
The function that displays the fake-delete confirmation page is mcp_stifle_topic() and is located in the "includes/prime_trash_bin_2.php" file. Inside that function you should see "return(false);" occur twice. If the function reaches either of these two points during execution, the function exists and you see the default delete confirmation page (the one that deletes permanently).

This is the first occurrence. Add a trigger_error() to see if this is where the function is exiting.
Did just that :)

Go to your board and try to delete a thread. If this message comes up then we found the spot. If the delete confirmation page comes up then it must be the next return statement.
It didn't return the statement and it did permanently delete the topic !!! :|
Including pre-modded files might be an idea worth considering, though it make a bit more work for me.
Maybe you could get someone like me or a member to do the work for you :) since it will benefit everyone after that, I found it mych easier to install things this way, but maybe it's just me :)

Cotp

Return to “[3.0.x] MODs in Development”