Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Damage .ctb Indicator V1.0 for YaBB 2.1 (Read 1929 times)
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Damage .ctb Indicator V1.0 for YaBB 2.1
Mar 10th, 2007 at 9:53pm
Print Post  
hello YaBBer   Cheesy

MF-B and I have make Damage .ctb Indicator mod for YaBB 2.1

----------------------------------------------------------
Damage .ctb Indicator V1.0
----------------------------------------------------------


Description:
This mod allows you to see damage .ctb file in MessageIndex.

How this works?

Example:

Edit one or more .ctb file in Message folder. change first line what you want like damage Upload it to Messages folder. Go to MessageIndex which Topics is damaged.

This is what you get



Try click Topic link, get this error



If you dont know how much ctb file is damage, you can install Rebuild Messageindex - Plus for autorepair.  Grin

After Rebuild MessageIndex go to MessageIndex to see repaired Topics.




Installation:
1) Modify YaBB files using BoardMod or manually.
2) Load modified files to your server in ASCII mode.

Admin/ModList.pl (ASCII)
Languages/English/MessageIndex.lng (ASCII)
Sources/MessageIndex.pl (ASCII)

Mod History:
Status Damage .ctb Indicator V1.0 (March 10 2007)
- First release
« Last Edit: Sep 1st, 2007 at 5:34am by Jeff »  

Damage_ctb_Indicator_V1_0.zip ( 1 KB | Downloads )

greetings
Jeff
Back to top
WWW  
IP Logged
 
Outumuro
God Member
*****
Offline


Publisher - YaBB Toolbar

Posts: 569
Location: Los Angeles
Joined: Apr 14th, 2004
Gender: Male
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #1 - Mar 10th, 2007 at 10:02pm
Print Post  
Nice! Smiley
  


Back to top
WWW  
IP Logged
 
aerow90
Senior Member
****
Offline



Posts: 253
Joined: Mar 18th, 2006
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #2 - Mar 11th, 2007 at 11:53am
Print Post  
Nice mod, thank you very much  Smiley
  
Back to top
WWW  
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #3 - Mar 11th, 2007 at 11:54am
Print Post  
Hi there
your welcome.  Grin
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
JMB
New Member
*
Offline



Posts: 20
Joined: Oct 7th, 2005
Gender: Male
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #4 - Mar 11th, 2007 at 2:05pm
Print Post  
Useful mod, thanks guys!  Smiley
  
Back to top
 
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #5 - Mar 11th, 2007 at 3:23pm
Print Post  
so!
what do you think?

in messageindex.pl
search
Code
Select All
&MessageTotals("load", $mnum); 


add after
Code
Select All
&QuickCTBCheckAndFix('quick',$mnum); 



and put this sub into messagindex.pl or subs.pl
Code
Select All
sub QuickCTBCheckAndFix {
	# usage: &QuickCTBCheckAndFix("task",<threadid>)
	# tasks: quick, full

	my ($job, $checkthread) = @_;
	my $needrepair;

	if ($mstate =~ /a/i) {
		if ${$checkthread}{'board'} ne $annboard) {
			${$checkthread}{'board'} = $annboard;
			$needrepair = 1;
		}
	} else {
		if (${$checkthread}{'board'} ne $currentboard) {
			${$checkthread}{'board'} = $currentboard;
			$needrepair = 1;
		}
	}

	if ( ${$checkthread}{'views'} =~ /\D/ ) {
		${$checkthread}{'views'} = 0;
		$needrepair = 1;
	}

	if ( ${$checkthread}{'threadstatus'} ne $mstate) {
		${$checkthread}{'threadstatus'} = $mstate;
		$needrepair = 1;
	}

	if ($job eq 'full') {

		fopen(FILETXT, "$datadir/$checkthread.txt");
		my @threaddata = <FILETXT>;
		fclose(FILETXT);
		my @lastinfo  = split(/\|/, $threaddata[$#threaddata]);

		if ( ${$checkthread}{'replies'} ne $#threaddata ) {
			${$checkthread}{'replies'} = $#threaddata;
			$needrepair = 1;
		}

		my $lastposter = $lastinfo[4] eq "Guest" ? qq~Guest-$lastinfo[1]~ : $lastinfo[4];
		if ( ${$checkthread}{'lastposter'} ne $lastposter ) {
			${$checkthread}{'lastposter'} = $lastposter;
			$needrepair = 1;
		}

		if ( ${$checkthread}{'lastpostdate'} ne sprintf("%010d", $lastinfo[3]) ) {
			${$checkthread}{'lastpostdate'} = sprintf("%010d", $lastinfo[3]);
			$needrepair = 1;
		}
	}

	if ($needrepair) { &MessageTotals("update", $checkthread) }
} 



online rebuild  Wink

but not tested!
  
Back to top
 
IP Logged
 
MF-B
Senior Member
****
Offline



Posts: 410
Location: Moscow
Joined: Apr 11th, 2006
Gender: Male
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #6 - Mar 11th, 2007 at 3:49pm
Print Post  
Nice idea... but not working...
  
Back to top
WWW  
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #7 - Mar 11th, 2007 at 4:15pm
Print Post  
try
my ($job, $updatethread) = @_;

replace with
my ($job, $checkthread) = @_;


  
Back to top
 
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #8 - Mar 11th, 2007 at 4:23pm
Print Post  
ok, a very simple online .ctb rebuild
check and repair only if boardid wrong

in messageindex.pl
search
Code
Select All
		&MessageTotals("load", $mnum); 



add after
Code
Select All
	if ($mstate =~ /a/i) {
		if ${$mnum}{'board'} ne $annboard) {
			${$mnum}{'board'} = $annboard;
			&MessageTotals("update", $mnum);
		}
	} else {
		if (${$mnum}{'board'} ne $currentboard) {
			${$mnum}{'board'} = $currentboard;
			&MessageTotals("update", $mnum);
		}
	}
 

  
Back to top
 
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Damage .ctb Indicator V1.0 for YaBB 2.1
Reply #9 - Mar 11th, 2007 at 5:28pm
Print Post  
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint