Page Index Toggle Pages: [1] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Rebuild Messageindex - Plus (Read 5812 times)
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Rebuild Messageindex - Plus
Jan 15th, 2007 at 10:03pm
Print Post  
Rebuild Messageindex - Plus V 1.2 (26.01.06)


This isn't classic mod. This is a simple, but working code.

Original 'Rebuild Messageindex' function is lack.
Try it. Edit a ctb file, replace boardname to 'abrakadabra', or clear the full content, or remove this file.
After this do rebuild with original code.
So?

This mod repair this damaged ctb files, rebuild message index files, and back to lost topic (if it's still on Messages folder)

------
History:
ver 1.0 - Initial beta release
ver 1.1      - Fixed grep with -f don't work in W98. Fixed SSS compatibility
ver 1.2 - Fixed: repair if ctb does not exist and threadid dosn't exist in boards
« Last Edit: Feb 20th, 2007 at 4:10pm by Administrator »  
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Rebuild Messageindex - Plus
Reply #1 - Jan 15th, 2007 at 10:19pm
Print Post  
Hi
can you make Sticky Shimmy Shuffle compatible?

I have this in Sticky Shimmy Shuffle mod

search
           my $thisboard = $thisthread[0];

add after
           if ($thisthread[10] =~ /(a|s)/) {&Sticky_Add_Del("add",$thisboard,$thisthread[2]);} ### Sticky Shimmy Shuffle mod ###

but search cannot find your mod?
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Rebuild Messageindex - Plus
Reply #2 - Jan 16th, 2007 at 9:45am
Print Post  
added, SSS compatible mod in zip
  
Back to top
 
IP Logged
 
Jeff
God Member
*****
Offline


There are no bugs there
are only features

Posts: 2552
Joined: Jan 14th, 2005
Gender: Male
Re: Rebuild Messageindex - Plus
Reply #3 - Jan 16th, 2007 at 10:24am
Print Post  
Hi
thnx. but in search need this code for SSS

Code
Select All
sub RebuildMessageIndex {
	opendir(CTB, $datadir);
	@threadlist = grep { /\.ctb$/ } readdir(CTB);
	closedir(CTB);
	$i = 0;
	foreach my $thread (@threadlist) {
		chomp $thread;
		$thread =~ s/\.ctb$//g;
		if (!-e "$datadir/$thread.txt") {
			unlink("$datadir/$thread.ctb");
			next;
		}
		fopen(FILECTB, "$datadir/$thread.ctb");
		@boarddata = <FILECTB>;
		fclose(FILECTB);
		$theboard = $boarddata[0];
		chomp $theboard;
		$thestatus = $boarddata[5];
		chomp $thestatus;
		fopen(FILETXT, "$datadir/$thread.txt");
		@threaddata = <FILETXT>;
		fclose(FILETXT);
		(@firstinfo) = split(/\|/, $threaddata[0]);
		(@lastinfo)  = split(/\|/, $threaddata[$#threaddata]);
		$thelastinfo = sprintf("%010d", $lastinfo[3]);
		$threadinfo[$i] = qq~$theboard|$thelastinfo|$thread|$firstinfo[0]|$firstinfo[1]|$firstinfo[2]|$lastinfo[3]|$#threaddata|$firstinfo[4]|$firstinfo[5]|$thestatus\n~;
		$i++;
	}
	@SortBoards = sort { lc($b) cmp lc($a) } (@threadinfo);
	$openfile = "";
	(@firsthread) = split(/\|/, $SortBoards[0]);
	$closefile = $firsthread[0];
	for ($i = 0; $i < @SortBoards; $i++) {
		@thisthread = ();
		(@thisthread) = split(/\|/, $SortBoards[$i]);
		my $thisboard = $thisthread[0];
		if ($thisthread[10] =~ /(a|s)/) {&Sticky_Add_Del("add",$thisboard,$thisthread[2]);} ### Sticky Shimmy Shuffle mod ###
		if ($thisboard ne $closefile) {
			fclose(REBUILDMESSAGE);
			$closefile = $thisboard;
		}
		if ($thisboard ne $openfile) {
			fopen(REBUILDMESSAGE, ">$boardsdir/$thisboard.txt");
			$openfile = $thisboard;
		}
		print REBUILDMESSAGE qq~$thisthread[2]|$thisthread[3]|$thisthread[4]|$thisthread[5]|$thisthread[6]|$thisthread[7]|$thisthread[8]|$thisthread[9]|$thisthread[10]~;
	}
	fclose(REBUILDMESSAGE);
	$yymain .= qq~<b>$admin_txt{'507'}</b>~;
	$yytitle     = $admin_txt{'506'};
	$action_area = "rebuildmesindex";
	&AdminTemplate;
	exit;
} 



Edit: I edit ctb file and look thead get error, and after rebuild working read thread. Good work.  8)
  

greetings
Jeff
Back to top
WWW  
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Rebuild Messageindex - Plus
Reply #4 - Jan 16th, 2007 at 11:19am
Print Post  
thx

Code
Select All
if ($thisthread[10] =~ /(a|s)/) {&Sticky_Add_Del("add",$thisboard,$thisthread[2]);} ### Sticky Shimmy Shuffle mod ### 

again

zip updated
  
Back to top
 
IP Logged
 
Larian
Senior Member
****
Offline



Posts: 316
Location: Leipzig
Joined: Oct 22nd, 2002
Gender: Male
Re: Rebuild Messageindex - Plus
Reply #5 - Jan 17th, 2007 at 11:02am
Print Post  
Hi!

At my Admin.pl (with SSS) there are the lines:

Code
Select All
		    my $thisboard = $thisthread[0];
		if ($thisthread[10] =~ /(a|s)/) {&Sticky_Add_Del("add",$thisboard,$thisthread[2]);} ### Sticky Shimmy Shuffle mod ###
 



and not

Code
Select All
		if ($thisthread[10] =~ /(a|s)/) {&Sticky_Add_Del("add",$thisboard,$thisthread[2]);} ### Sticky Shimmy Shuffle mod ###
		    my $thisboard = $thisthread[0];
 



like in your code, but after changing the order of that lines it installs fine and everything worka!

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


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: Rebuild Messageindex - Plus
Reply #6 - Jan 17th, 2007 at 9:06pm
Print Post  
thx, zip updated
  
Back to top
 
IP Logged
 
MF-B
Senior Member
****
Offline



Posts: 410
Location: Moscow
Joined: Apr 11th, 2006
Gender: Male
Re: [DONE] Rebuild Messageindex - Plus
Reply #7 - Jan 18th, 2007 at 2:10pm
Print Post  
Hi Zoo

Cool mod! I testing on 2.1 - work fine Thumbs Upsup:
  
Back to top
WWW  
IP Logged
 
delrick
Senior Member
****
Offline


Write more...talk less

Posts: 362
Location: Fort Smith
Joined: Nov 28th, 2002
Gender: Male
Re: [DONE] Rebuild Messageindex - Plus
Reply #8 - Jan 20th, 2007 at 5:39pm
Print Post  
I've needed this mod since installing 2.1. Thanks for saving the orphans.
  

Delrick Gist
Writer's Block

WRITERSBLOCK.COM
Back to top
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: [DONE] Rebuild Messageindex - Plus
Reply #9 - Jan 26th, 2007 at 8:05am
Print Post  
I found a bug. It's bit, but major error. Fixed.
  
Back to top
 
IP Logged
 
Bestovian
New Member
*
Offline


I love YaBB 1G - SP1.2!

Posts: 1
Joined: Jan 29th, 2007
Re: [DONE] Rebuild Messageindex - Plus
Reply #10 - Jan 29th, 2007 at 3:35pm
Print Post  
I cannot seem to get this to work so not sure what I am doing wrong.

Shows the Mod loaded but I still cant seem to recover any of the missing post.

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


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: [DONE] Rebuild Messageindex - Plus
Reply #11 - Jan 29th, 2007 at 4:41pm
Print Post  
Have you a board with 'recycle' ID? To be a must  because orphan topic recover to it.
'recycle' isn't board name, this a default board in yabb package.
  
Back to top
 
IP Logged
 
singletracker500
New Member
*
Offline


I love YaBB 1G - SP1.2!

Posts: 19
Joined: Feb 15th, 2007
Re: [DONE] Rebuild Messageindex - Plus
Reply #12 - Feb 15th, 2007 at 7:35pm
Print Post  
All of the boards I maintain have the problems this mod fixes. But I don't feel confident moding the files. Does anyone have the moded files so I could just upload them. Thanks.
  
Back to top
 
IP Logged
 
Zoo
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 290
Joined: Jan 22nd, 2003
Re: [DONE] Rebuild Messageindex - Plus
Reply #13 - Feb 15th, 2007 at 8:53pm
Print Post  
I send to you if I get a mail
  
Back to top
 
IP Logged
 
singletracker500
New Member
*
Offline


I love YaBB 1G - SP1.2!

Posts: 19
Joined: Feb 15th, 2007
Re: [DONE] Rebuild Messageindex - Plus
Reply #14 - Feb 15th, 2007 at 9:37pm
Print Post  
Thank you Zoo. The files youe sent fixed the problems.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint