I have this bulletin board script which used to work very well until i changed my site hosting company about two weeks ago. I then transferred all my files onto my new server as they were before.
The BB creates directories for each of the forums I have set up.
Can anyone help me please?
The following code is the bit which is supposed to find these directories and list them but it isn't detecting the existence of these directories even though I can clearly see the directories:
"To educate a man is to educate an individual; to educate a woman is to educate a nation"
Dr. Aggrey, Ghana.
The BB creates directories for each of the forums I have set up.
Can anyone help me please?
The following code is the bit which is supposed to find these directories and list them but it isn't detecting the existence of these directories even though I can clearly see the directories:
Code:
$ENV{'PATH'} = '/bin:/usr/bin';
my $VERSION = '2.1';
my $script = url();
#read the whole file in
undef $/;
if (!param()) {
my ($forum,%count,@list,@rows);
#chdir($BBS_DIR) || die "Cant chdir to $BBS_DIR: $!";
opendir(DIR, $BBS_DIR) or die "Cant opendir $BBS_DIR: $!";
my @forums = grep { !/^\./ } readdir(DIR);
closedir(DIR);
foreach $forum (@forums) {
my $path = $BBS_DIR.'\\'.$forum;
if (-d $path) {
opendir(DIR, $path ) || die "Cant opendir $path: $!";
$count{$forum} = (@list = grep { !/^\./ } readdir(DIR));
closedir(DIR);
}
}
my $counter = 0;
my $odd_open = '<tr align="center"><td width="25%">';
my $odd_close = '</td>';
my $even_open = '<td width="25%">';
my $even_close = '</td></tr>';
foreach $forum ( sort keys %count) {
next if $forum =~ /_archive$/;
my $link = "$script?forum=$forum&task=list";
my $label = (($counter = 1- $counter) ? $odd_open : $even_open) .
a({-href=>$link},get_label($forum) . " ($count{$forum} post" .
($count{$forum} != 1 ? "s)" : ")")) . ($counter ? $odd_close : $even_close);
push @rows,$label;
}
print header,start_html(-bgcolor=>$BG,-text=>$TX,-link=>$LL,-vlink=>$VL,
-background=>$BGIMG,-title=>"$BBS_TITLE"),
h1({align=>'center'},"$BBS_TITLE");
if (!@rows) {
print center('No forums have been defined.');
}
else {
print center(
'Select a forum from the list below.',p,
table(@rows),
);
}
print hr;
if ($BBS_INFO) {
open(INFO, "$BBS_INFO") || die "Can't open $BBS_INFO: $!";
while (<INFO>) {
print;
}
close(INFO);
}
print hr,
font({-size=>'-1'},a({-href=>$HOME,-target=>'_blank'},
'Return to Old Vandals home page'),br, a({-href=>"mailto: $EMAIL"},
"Email Webmaster")),,
end_html;
exit(0);
}
my $forum = param('forum');
if ($forum =~ /(^[a-zA-Z0-9_]+$)/) {
$forum = $1;
}
else {
bad_input();
}
my $forum_label = get_label($forum);
my $task = param('task');
show_post_list() if $task eq 'list';
show_msg() if $task eq 'show_msg';
new_thread_form() if $task eq 'new_thread_form';
new_post() if $task eq 'new_post';
reply_form() if $task eq 'reply_form';
post_reply() if $task eq 'post_reply';
mark_read() if $task eq 'mark_read';
show_post_list() if $task eq 'list_archive';
"To educate a man is to educate an individual; to educate a woman is to educate a nation"
Dr. Aggrey, Ghana.