sub seperate_page { get_time(); open (TOPHTML, "$path_to_header") or die "where's the html file? : $!"; my @html_file = ; close TOPHTML; my $newhtml= strftime ("%m_%d_%Y", localtime ()); open (NEWHTML, ">$news_directory\/$newhtml-$$.html") || die "Cannot create $newhtml ($!)"; print NEWHTML @html_file; print NEWHTML qq|\n ::: $topic :::
\n \n
posted by $name\n $time_words.

\n   $words \n|; close NEWHTML; my $data = $words; my $regex = '.*?' . join('.*?', map { "
" } (1..8)); my ($match) = $data =~ /($regex)/si; $words = "$match   MORE>>

"; } sub file_up { local $| = 1; my ($bytesread,$buffer,$file); my $directory = $base_dir . $target_dir; my $fh = $q->upload('upload_file'); my $filename = $q->param('upload_file'); $filename =~ s/[^A-Za-z0-9\.\_]//g; $filename =~ s/windows//i; $filename =~ s/desktop//i; open(OUTF, '>' . $directory . $filename); while ($bytesread = read($fh, $buffer, 1024)) { print(OUTF $buffer); } close(OUTF); if (!$file && $q->cgi_error) { print($q->header(-status=>$q->cgi_error)); exit 0; } $image_link = $base_dom . $target_dir . $filename; $image_link; } sub bad_hacker_no_cookie { print "Content-type: text/html\n\n"; print " \n"; print " \n"; print "

!Unauthorized Access!\n"; print "
"; print "Hey bub, stop messin' with my News Page!\n"; print "
You are at IP address $user !"; print "

"; } sub mail_routine { if ($pass ne $goodpass) { open MAIL,"|mail $mail" or die "mail problem : $!"; print MAIL "$user tried to get in using $pass for a password.\n"; print MAIL "They wanted to add $plain_words."; close MAIL; } else { open MAIL,"|mail $mail" or die "mail problem : $!"; print MAIL "$user changed the news to: $plain_words.\n"; close MAIL; } } sub show_news { #This sub produces the current news page if ($topic eq "" && $words eq "") { open (FTXT, "$path_to_text") or die "where's the text file? : $! is looking for $path_to_text"; my @text_file = ; open (FHTML, "$path_to_header") or die "where's the html file? : $!"; my @html_file = ; print "Content-type: text/html\n\n"; print @html_file; print @text_file; print " \n"; exit; } else { return; } } sub send_edit_form { my %FORM = $q->Vars('post_number'); my $post_number = $q->param('post_number'); my $start = $q->param('post_number'); $pass = $q->param('pass'); if ($pass eq $goodpass) { while ($post_number > 0) { if ( $q->param("box$post_number") ) { # ignore deleted $_= $q->param("box$post_number"); s/"/"/g; s/'/'/g; unshift @updated_text, $_; # keep the rest } $post_number--; } # now update file open(FH,">$path_to_text") || die $!; print FH join "\n\n\n", @updated_text; close(FH); print "Location: $newspage_url\n\n"; exit; } else { bad_hacker_no_cookie(); } } sub make_edit_form { open (FH, "$path_to_text") or die "where's the damn file? : $!"; print header; print qq|
\n

Edit Your Posts


Uncheck Items To Delete Them

Password:

|; while () { next if /^\n+$/; #ignore lines which contains only newlines $post_number++; chomp; s/"/"/g; s/'/'/g; print qq|Save This Post? \n

$_


\n

\n


\n|; } close FH; print qq|

\n Password:
|; exit; }