vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Recycle Bin Hack v0.1b *UNSUPPORTED* (https://vborg.vbsupport.ru/showthread.php?t=43462)

FlyingDutchman 09-11-2002 10:00 PM

Recycle Bin Hack v0.1b *UNSUPPORTED*
 
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/showthrea...threadid=36107
2: https://vborg.vbsupport.ru/showthrea...threadid=40989
3: https://vborg.vbsupport.ru/showthrea...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

PHP Code:

deletethread($threadid,$use_recycle_bin,$bin_forumid,$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


All times are GMT. The time now is 12:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00998 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete