Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Recycle Bin (Read 13194 times)
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Recycle Bin
Aug 12th, 2005 at 4:54pm
Print Post  
Not sure where to put this - so here will do!

I have developed a Recycle Bin MOD.

Thanks goes to BHRA Webmaster for the code taken from his Recycle Bin (I have used part of this in my MOD to recycle threads).  I have not been able to get in contact with BHRA to ask his permission......

Thanks also goes to Astropilot for his tuition in my last mod....helped here too!

Also to Curtiss Grymala, AK108 for help in the coding board!





I would be greatful to anyone who would try this MOD to insure it installs cleanly to other boards - has worked fine on 3 boards so far (1.4, 1.3.2, 1.3.1).






This mod will recycle all threads, posts, and original of modified posts.

Useful when you have over-active moderators!

Admin center prefs allows you to decide what you want to recycle.

You need to create a board viewable only to members you want to see recycled posts (admin only is best!) - All recycled posts/threads will be placed here.





I expect to find a bug or two, despite my testing!  Please feel free to let me know of any problems, or improvements!
« Last Edit: Aug 18th, 2005 at 7:24pm by Martin_W »  

RecycleBin_BETA_1.1.zip ( 6 KB | Downloads )
Back to top
WWW  
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Recycle Bin
Reply #1 - Aug 13th, 2005 at 4:39pm
Print Post  
moving this to the beta mods boards. Wink
  

The Administrator.
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #2 - Aug 15th, 2005 at 5:19pm
Print Post  
Anyone willing to try this mod  Undecided
  
Back to top
WWW  
IP Logged
 
akdb8r
New Member
*
Offline


I love YaBB 1G - SP1.2!

Posts: 19
Joined: Dec 5th, 2004
Re: Recycle Bin
Reply #3 - Aug 16th, 2005 at 7:10am
Print Post  
Hey Martin,

I had a much cruder version of this mod running on my message board, and I really like yours. It's quite smooth.

I may play around with your mod a bit. Some changes that I'd like to make (and which I had up and going in my cruder mod) would make show me the original version of the modified message alongside the newer version, so I could see precisely what changed. Also, it would be nice if I could see all changes made within a thread without having to click around outside of the thread, navigating to the recycle bin.

Anyway, I'll play around with it. But thank you for this mod; I'm pretty sure that others have asked for this mod before, and I think they'll be happy to find this thread (whenever they find it).
  
Back to top
 
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #4 - Aug 16th, 2005 at 3:32pm
Print Post  
Thanks for looking!

It should be easy to add some code to allow comparing of modified posts to recycled originals.

How do you mean compare threads??  Once a thread is deleted, it is gone??

Glad it is of use!
  
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #5 - Aug 16th, 2005 at 4:14pm
Print Post  
Try this -

In english.lng

find
Code
Select All
$recbin{'54'} = "The date & time of this last post indicates the date & time this post was modified!"; 



Add after
Code
Select All
$recbin{'55'} = "The first post in this thread is the modified post,<br>the second post in this thread in the original."; 





In ModifyMessage.pl

find
Code
Select All
	if( $postkilled ) {
		# If post was killed, update the current board.
		my( $threadcount, $messagecount, $lastposttime, $lastposter ) = &BoardCountGet($currentboard);
		--$messagecount;
		if( $threadkilled ) {
			--$threadcount;
		}
		&BoardCountSet( $currentboard, $threadcount, $messagecount, $newlastposttime || $lastposttime, $newlastposter || $lastposter );
	} 



Add before
Code
Select All
fopen(FILE, "$datadir/$recyclepost.txt");
@recpostsmodify=<FILE>;
fclose(FILE);
unshift (@recpostsmodify, $messages[$postid]);
fopen(FILE, ">$datadir/$recyclepost.txt");
print FILE @recpostsmodify;
fclose(FILE); 




And, sorry, missed thisbit (added 18 Aug)


In ModifyMessage.pl

find
Code
Select All
				print FILE "$recbin{'28'}|$adminprefs[1]|$adminprefs[2]|$date|admin|xx|0|$recbin{'29'}|[center][color=blue]<br>$recbin{'30'}<br><br>$recbin{'49'} [url=$scripturl?action=viewprofile;username=$username] $usersprefs[1] [/url]($usersprefs[7]).<br><br>$recbin{'50'} [url=$scripturl?board=$currentboard] $board[0] [/url] $recbin{'39'}.<br>($recbin{'45'} '$cat[0]' $recbin{'44'})<br><br>$recbin{'51'}<br><br>[url=$cgi&action=display&num=$threadid&start=0#0]>>$recbin{'53'}<<[/url]<br><br>$recbin{'54'} [/color][/center]||\n";
			}else{
				print FILE "$recbin{'28'}|$adminprefs[1]|$adminprefs[2]|$date|admin|xx|0|$recbin{'29'}|[center][color=blue]<br>$recbin{'30'}<br><br>$recbin{'49'} [url=$scripturl?action=viewprofile;username=$username] $usersprefs[1] [/url]($usersprefs[7]).<br><br>$recbin{'50'} [url=$scripturl?board=$currentboard] $board[0] [/url] $recbin{'39'}.<br>($recbin{'45'} '$cat[0]' $recbin{'44'})<br><br>$recbin{'52'} $postid $recbin{'33'}<br><br>[url=$cgi&action=display&num=$threadid&start=0#0]>>$recbin{'53'}<<[/url]<br><br>$recbin{'54'} [/color][/center]||\n"; 




replace
Code
Select All
				print FILE "$recbin{'28'}|$adminprefs[1]|$adminprefs[2]|$date|admin|xx|0|$recbin{'29'}|[center][color=blue]<br>$recbin{'30'}<br><br>$recbin{'49'} [url=$scripturl?action=viewprofile;username=$username] $usersprefs[1] [/url]($usersprefs[7]).<br><br>$recbin{'55'}<br><br>$recbin{'50'} [url=$scripturl?board=$currentboard] $board[0] [/url] $recbin{'39'}.<br>($recbin{'45'} '$cat[0]' $recbin{'44'})<br><br>$recbin{'51'}<br><br>[url=$cgi&action=display&num=$threadid&start=0#0]>>$recbin{'53'}<<[/url]<br><br>$recbin{'54'} [/color][/center]||\n";
			}else{
				print FILE "$recbin{'28'}|$adminprefs[1]|$adminprefs[2]|$date|admin|xx|0|$recbin{'29'}|[center][color=blue]<br>$recbin{'30'}<br><br>$recbin{'49'} [url=$scripturl?action=viewprofile;username=$username] $usersprefs[1] [/url]($usersprefs[7]).<br><br>$recbin{'55'}<br><br>$recbin{'50'} [url=$scripturl?board=$currentboard] $board[0] [/url] $recbin{'39'}.<br>($recbin{'45'} '$cat[0]' $recbin{'44'})<br><br>$recbin{'52'} $postid $recbin{'33'}<br><br>[url=$cgi&action=display&num=$threadid&start=0#0]>>$recbin{'53'}<<[/url]<br><br>$recbin{'54'} [/color][/center]||\n"; 

« Last Edit: Aug 18th, 2005 at 7:27pm by Martin_W »  
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #6 - Aug 16th, 2005 at 4:25pm
Print Post  
I have included this change in the attached file at the beginning of this thread.
  
Back to top
WWW  
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Recycle Bin
Reply #7 - May 10th, 2006 at 12:06am
Print Post  
Wow, this mod rocks! Had installed the recycle bin mod by BHRA Webmaster but yours is much better.

It's a bit late, but if you find any time, could you make it compatible to the "In-thread multi delete" mod by Shoeb Omar? I've attached that mod to this post.

Oh, and would it be possible to use different recycle bin forums for deleted threads, deleted posts and modified posts?
  

multidel15sp13x.mod ( 8 KB | Downloads )

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #8 - May 10th, 2006 at 5:35pm
Print Post  
Hi - glad someone could use it!  I find it very useful on my board - call me nosey, but I like to see what gets modded!

The alterations you want shouldn't be that hard, and I am a little better at coding these days - That was one of my first and only mods I wrote.

I am a little stuck for time recently at work, and in my little free time, I am writting an Alert Moderator mod for YaBB2 - Very near the end now, just having trouble with writting new board vars with the &BoardTotals "load" subroutine.......

Feel free to re-code the mod yourself if you want, or I will look at it as I have time!
  
Back to top
WWW  
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Recycle Bin
Reply #9 - May 10th, 2006 at 7:59pm
Print Post  
@Multidel compatibility:
Well, I would change it by myself, but my perl knowledge is not that good and as it is about deleting posts, I prefer not do try as I'm afraid of destroying something within threads.

@My other suggestion:
I could do it myself if I try, I think. Perhaps I'll simply hardcode it without ability to change it in Admin Center.
  

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Recycle Bin
Reply #10 - May 14th, 2006 at 10:36am
Print Post  
Deleting threads within recycle bin by age doesn't work. The output does always look like

Thread [1147558045] is -13281 days old.
Thread [1147558023] is -13281 days old.
Thread [11475571939] is -13106 days old.
Thread [11475571938] is -13181 days old.
Thread [11475571937] is -13183 days old.
Thread [11475571936] is -13183 days old.
Thread [11475571935] is -13186 days old.
Thread [11475571934] is -13187 days old.
Thread [11475571933] is -13187 days old.
Thread [11475571932] is -13188 days old.

And so on.
  

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #11 - May 14th, 2006 at 2:38pm
Print Post  
Not sure whats causing that - I have the mod installed on the two forums I admin for, and they both work well ???

Thread [1147552909] is 1 days old.
Thread [1147467265] is 2 days old.
Thread [1147449253] is 2 days old.
Thread [1147427822] is 2 days old.
Thread [1147292012] is 4 days old.
Thread [1147109908] is 6 days old.
Thread [1146902859] is 8 days old.
Thread [1146902808] is 8 days old.
Thread [1146654982] is 11 days old.
Thread [1146590676] is 12 days old.
Thread [1146590660] is 12 days old.
Thread [1146590644] is 12 days old.
Thread [1146516945] is 13 days old.
Thread [1146514822] is 13 days old.
Thread [1146514790] is 13 days old.
Thread [1146514772] is 13 days old.
Thread [1146243603] is 16 days old.
Thread [1146066381] is 18 days old.
Thread [1145999398] is 19 days old.
Thread [1145985074] is 19 days old.
Thread [1145985001] is 19 days old.
Thread [1145984972] is 19 days old.
Thread [1145217289] is 28 days old.
Thread [1144775557] is 33 days old. (REMOVED.)



Just cleared one of mine - it was almost empty anyway.....but worked ???

Maybe a conflicting mod?
  
Back to top
WWW  
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Recycle Bin
Reply #12 - May 14th, 2006 at 3:37pm
Print Post  
Which sub do you use to calculate the thread's age? I have a different "calcdifference" sub than the standard was.
  

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Martin_W
Senior Member
****
Offline


I love YaBB 1G - SP1.2!

Posts: 463
Location: Devon
Joined: Jun 22nd, 2005
Gender: Male
Re: Recycle Bin
Reply #13 - May 14th, 2006 at 3:50pm
Print Post  
Just had a quick look to refresh my memory:

It uses the standard &calcdifference subroutine.

What mod has changed your calc difference??

Maybe instead of calling the &calcdifference routine, you could add the coding of the original &calcdifferenct into the recyclebin.pl file??  The sub &recbinmaint deals with the clearing by age.

I will look to sort that for you if you want - but give me time Wink
  
Back to top
WWW  
IP Logged
 
Valtiel
God Member
*****
Offline


Copy & paste coder

Posts: 873
Joined: Sep 5th, 2003
Gender: Male
Re: Recycle Bin
Reply #14 - May 14th, 2006 at 3:56pm
Print Post  
I found it myself already. No mod changed my &calcdifferende - I changed it because the normal one doesn't calculate accurately. And since some mod added the &stringtotime and &timetostring subs to my Subs.pl, I use the &stringtotime and it looks like following:

Code
Select All
sub calcdifference {  # Input: $date1 $date2
	$number1 = &stringtotime($date1);
	$number2 = &stringtotime($date2);
# Sommerzeit
	$result = int(($number2-$number1)/86400);
# Winterzeit
#	$result = int(($number2-($number1+3600))/86400);
} 



The one active at the moment is for daylight saving time. Normally there are no problems with that sub, I use it on many places in my board. Will try to figure out why your mod doesn't calculate the right amount of days.
  

Proud copy & paste coder Grin
Admin @ Silent Hill Forum
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint