#!/usr/bin/perl use strict; #use lib 'C:\Inetpub\wwwroot\Sites\asp\echoingw\members\login.'; use lib '.'; use MyBoard; # declare variables my($sth, $rv, $f, $count); my($limit); # untaint the limit count if ($cgi->param('start') =~ /^(\d+)$/) { $limit = $1; } else { $limit = 0; } # how many msgs to display per page my($maxcount) = 5; &do_header($maintitle); ## BEGIN HEADER PAGE CONTENT ## my($today) = ""; $count = 0; # delete the forum_id stuff in the query, # alter the date format to read "Thursday, May 8, 2002" # and format the time into "12:30 PM" # $sth = $dbh->prepare("select *,date_format(date, '%W, %M %e, %Y') as nicedate, date_format(date, '%l:%i %p') as nicetime from messages where thread_id=0 and approved=1 order by date desc limit $limit, $maxcount") or &dbdie; $rv = $sth->execute; while ($f = $sth->fetchrow_hashref) { my($asth) = $dbh->prepare("select count(*) from messages where thread_id=$f->{id}"); $rv = $asth->execute; my($r) = $asth->fetchrow_array; my($responses); if ($r == 1) { $responses = "1 comment"; } elsif ($r > 1) { $responses = "$r comments"; } else { $responses = "0 comments"; } # if ($f->{nicedate} ne $today) { # if ($today ne "") { # print qq(
\n); # } # print qq(

Dateline: $f->{nicedate}

\n); # $today = $f->{nicedate}; # } print qq(


$f->{subject}
Posted by $f->{author}: $f->{nicedate} ($f->{nicetime}) [MSG ID: $f->{id}]

\n); # Convert hard returns to line returns in post. $f->{message} =~ s/\r/
/g; # Stip all HTML Tags and convert to &alt characters. $f->{message} =~ s/{message} =~ s/ tag back to HTML. $f->{message} =~ s/<br/
{message} =~ s/>br/
{message} =~ s/\[i\]/\/g; $f->{message} =~ s/\[\/i\]/\<\/i>/g; # Bold $f->{message} =~ s/\[b\]/\/g; $f->{message} =~ s/\[\/b\]/\<\/b>/g; # Underline $f->{message}=~ s/\[u\]/\/g; $f->{message} =~ s/\[\/u\]/\<\/u>/g; # Lists $f->{message}=~ s/\[ul\]/\