Log in

View Full Version : Recycle Bin Hack v0.1b *UNSUPPORTED*


FlyingDutchman
09-11-2002, 10:00 PM
IMPORTANT: I HAVE REMOVED THE INSTALL SCRIPT FOR NOW, BECAUSE I AM UPDATING THIS HACK WITH LOTS OF NEW ADDITIONS, PLEASE CHECK BACK IN AROUND A WEEK FOR NEW UPDATES

What does this hack do: This hack will move all threads users 'delete' to a forum, so it will act like a Recycle Bin.

Requested By:
1: https://vborg.vbsupport.ru/showthread.php?s=&threadid=36107
2: https://vborg.vbsupport.ru/showthread.php?s=&threadid=40989
3: https://vborg.vbsupport.ru/showthread.php?s=&threadid=37264

Features: -Only first post in thread will be recycled, 'normal' posts will still be fully deleted
-Anyone with delete permissions can delete/recycle a post
-Total deletion of a whole thread can only be performed by a admin (not sure about mod :()
-Recycle Bin forum can just be disabled for new posts, so it really acts like a sort of archive

Installation: -Make a new forum and write down the forumid
-Add a new replacement variable '{recycleforumid}' and set it to your recycle bin's forum id.
-Use my install-file to do the modifications needed
You may need to edit your editpost template so that it doesn't say 'if this post is the first post of the thread, the whole thread will be deleted...' anymore - NOT REQUIRED for the working of this hack.

Notes: I've made this hack for vb 2.2.6, but it should work on 2.2.x too...
Can somebody please test it for vb 2.2.7 for me and tell me if it works? thanks.

Future additions-list:
-total new access mask (i.e. 'canrecycle') for more security
-restore function to restore files to their original location
-admin cp feature (restore, delete, 'restored by:' feature possibly)

NuclioN
09-12-2002, 02:53 PM
This works if you edit the post and delete it. But when you use de admin options in the showthreads it won't. Can you make that work as well?

FlyingDutchman
09-12-2002, 04:13 PM
if you are a admin, you could also just move the thread to the recycle bin forum, right?
anyway, i'll do this tonight or so when i have more time...

Neo
09-12-2002, 04:34 PM
You know there is a much simpler way of doing this. You dont even need to add a new template for it and or all the code. :)

FlyingDutchman
09-12-2002, 04:37 PM
how would you wanna do that then?

i don't see any other way atm to make it so that you fully delete a post (that is not the first post of a thread) and delete/recycle the whole thread if it is the first post

Neo
09-12-2002, 04:40 PM
You are basically moving the thread correct?

FlyingDutchman
09-12-2002, 04:46 PM
yup, but i didn't find the code for domove usefull, it's a lot, so i ripped something out, as a new 'function'...
then you also are not able to show the recycled redirection template...

anywayz, if you choose to leave out the new stuff in postings.php you'd still need 2 editpost templates and you'll need to edit editpost.php...
not much more work to add code for redirection, right? ;)

Neo
09-12-2002, 04:50 PM
Well if you take a look in admin/functions.php and look for the function called deletethread() you can add just a small amount of code to it and it will work. All you need it make add one query and a if statement.

FlyingDutchman
09-12-2002, 04:55 PM
hmm, yeah :)
you beat me, lol ;)
anyway, I'd still see thesame editpost template right?

well, maybe my hack is just stupid :) but hey, it's my first :D

Neo
09-12-2002, 05:03 PM
No no your hack is well coded :) I am just helping joo out. Once thing I notice with people is that the less code the more they like it oO;;;;

As for the template if you stay the same, but you could add a admin option to have it turned on your off and then use the deletethread function like this


deletethread($threadid,$use_recycle_bin,$bin_forum id,$foruminfo[countposts]);


then
$use_recycle_bin = 1 // this means it active 0 means its not
$bin_forumid = XX // whatever forumid you want this to move to


I believe once you edit the admin/functions.php that would be the only edit in postings.php

NuclioN
09-12-2002, 05:05 PM
Originally posted by FlyingDutchman
if you are a admin, you could also just move the thread to the recycle bin forum, right?
anyway, i'll do this tonight or so when i have more time...


Yes that would be nice. Our moderators have permission to delete threads and sometimes one is deleting in a controversial way...so we can look at the deleted thread and move it back eventually.

wolfe
09-13-2002, 06:31 AM
here is 3 requests

https://vborg.vbsupport.ru/showthread.php?s=&threadid=36107&highlight=Recycle

https://vborg.vbsupport.ru/showthread.php?s=&threadid=40989&highlight=Recycle

https://vborg.vbsupport.ru/showthread.php?s=&threadid=37264&highlight=Recycle

also nice hack :D

wolfe
09-13-2002, 06:34 AM
also d00d can u restore hacks after they get moved or *Deleted* into the recycle bin :D

FlyingDutchman
09-13-2002, 01:25 PM
Originally posted by wolfe
also d00d can u restore hacks after they get moved or *Deleted* into the recycle bin :D

*added to future additions-list*

;) - thanks for the suggestion, i think I already have an idea to solve this 'problem' kinda easily...

and also thanks for those request-threads (i was too lazy to search really :D)

Chris M
09-14-2002, 07:12 AM
Any news on that feature?

Satan

FlyingDutchman
09-14-2002, 09:08 AM
no, not yet, i've been busy all day yesterday and i will be today too... so... maybe tomorrow ;)

wolfe
09-30-2002, 12:05 AM
so whens it gonna be done also can u make it if the thread is deleted the whole thread goes to the bin forum and if just one post is do the same :D

FlyingDutchman
09-30-2002, 03:54 AM
i've opened a other thread, you can find it here:

https://vborg.vbsupport.ru/showthread.php?threadid=43695

that version is almost final...