Hi, I got an error in step two. I have this code in my admin.pl
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;
}
sub case_insensitive {
uc($::a) cmp uc($::b);
}
sub DeleteOldMessages {
&is_admin_or_gmod;
fopen(DELETEOLDMESSAGE, "$vardir/oldestmes.txt");
$maxdays = <DELETEOLDMESSAGE>;
fclose(DELETEOLDMESSAGE);
$yytitle = "$aduptxt{'04'}";
$yymain .= qq~
<form action="$adminurl?action=removeoldthreads" method="POST">
<div class="bordercolor" style="padding: 0px; width: 99%; margin-left: 0px; margin-right: auto;">
<table width="100%" cellspacing="1" cellpadding="4">
<tr valign="middle">
<td align="left" class="titlebg">
<img src="$imagesdir/ban.gif" alt="" border="0" /> <b>$aduptxt{'04'}</b>
</td>
</tr>
<tr valign="middle">
<td align="left" class="windowbg2"><br />
$aduptxt{'05'}<br /><br />
</td>
</tr>
<tr valign="middle">
<td align="left" class="windowbg2"><br />
$admin_txt{'4'}: <input type="checkbox" name="keep_them" value="1" /><br />
$admin_txt{'124'} <input type=text name="maxdays" size="2" value="$maxdays" /> $admin_txt{'579'} $admin_txt{'2'}:<br /><br />
<div align="left" style="margin-left: 25px; margin-right: auto;">
~;
unless ($mloaded == 1) { require "$boardsdir/forum.master"; }
foreach $catid (@categoryorder) {
$boardlist = $cat{$catid};
(@bdlist) = split(/\,/, $boardlist);
($catname, $catperms) = split(/\|/, $catinfo{"$catid"});
foreach $curboard (@bdlist) {
($boardname, $boardperms, $boardview) = split(/\|/, $board{"$curboard"});
$selectname = $curboard . 'check';
$yymain .= qq~
<input type="checkbox" name="$selectname" value="1" /> $boardname<br />
~;
}
}
$yymain .= qq~
</div><br />
</td>
</tr>
<tr valign="middle">
<td align="center" class="catbg">
<input type=submit value="$admin_txt{'31'}" />
</td>
</tr>
</table>
</div>
</form>
~;
$action_area = "deleteoldthreads";
&AdminTemplate;
exit;
}
But if I change by hand, my admin Center shows an error, can you help me?