#!/usr/bin/perl require "msgboard.setup"; ############################################################################## # Midmart Message Board 1.00 # # Author: M.Reza Ghasemi # # Email: webmaster@midmart.com # # Available at http://www.midmart.com/scripts/ # # Copyright 2001 Midmart Developers Group # # Created 4/4/2001 Last Modified 4/4/2001 # ############################################################################## # COPYRIGHT NOTICE # # Copyright 2001 Midmart Developers Group All Rights Reserved. # # # # This script can be used free of charge as long as you don't change this # # header, midmart logo, or the parts of this script that generate the return # # links. If you really need to remove the logo and links, visit # # http://www.midmart.com/order.htm to register your copy just for $40. # # We prosecute all violators via both civil legal actions and in cooperation # # with U.S. and international criminal authorities. # # # # By using this script you agree to indemnify the author and Midmart # # Developers Group from any liability that might arise from its use. # # # # This code must not be sold or redistributed, even in modified form, # # without the written permission of the Midmart Developers Group. # ############################################################################## print "Content-type: text/html\n\n"; &Read_Parse; if ($form{'action'} eq "detail") { &view_detail; } if ($form{'action'} eq "previous") { &previous_division; } if ($form{'action'} eq "next") { &next_division; } if ($form{'action'} eq "selectedsubjects") { &selected_subjects; } else { &view_title; } ##################### START VIEWING TITLE OF DATA ########### sub view_title { &read_data; print "$SITE_NAME\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; ############################################################################## # YOU MAY NOT USE MIDMART MESSAGEBOARD IF THE FOLLOWING COPYRIGHT NOTICES # # ARE ALTERED OR EDITED. If you really need to remove this code, you may # # register the Midmart Messageboard just for $40. # # We prosecute all violators via both civil legal actions and in cooperation # # with U.S. and international criminal authorities. YOU HAVE BEEN WARNED! # ############################################################################## print "\n"; ################################################>############################## # END OF DO NOT ALTER # # ############################################################################## print "\n"; print "
Powered by:

$SITE_NAME

\n"; print "
Recent MessagesPost a Message

\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; if ($form{'start'} eq "") { $form{'start'} = 0; } ##################### Counting The Number of Records ############ $i=0; foreach $line (@input) { $i++; } $results = $i; $l=0; foreach $line (@input) { @column = split(/#!#/,"$line"); if ($l >= $form{'start'}) { if ($l < ($form{'start'} +10)) { if ($l < $results ) { print "\n"; print "\n"; print "\n"; print "\n"; } } } $l++; } $next= $form{'start'} +10; $previous= $form{'start'} -10; print "
#FromSubjectDate
$column[0]$column[1]\n"; print "$column[4]$column[3]
\n"; print "\n"; if ($previous >= 0) { print "\n"; } else { } if ($next < $results) { print "\n"; } else { } print "
< PreviousNext >

\n"; ############################################################################## # YOU MAY NOT USE MIDMART MESSAGEBOARD IF THE FOLLOWING COPYRIGHT NOTICES # # ARE ALTERED OR EDITED. If you really need to remove this code, you may # # register the Midmart Messageboard just for $40. # # We prosecute all violators via both civil legal actions and in cooperation # # with U.S. and international criminal authorities. YOU HAVE BEEN WARNED! # ############################################################################## print "
\n"; print "Powered by Midmart Messageboard
\n"; print "
\n"; ################################################>############################## # END OF DO NOT ALTER # # ############################################################################## print "\n"; exit; } ##################### End of Viewing Data Title ################# ##################### Start of Viewing DATA Detail ############## sub view_detail { &read_data; $i = 0; foreach $line (@input) { @column = split(/#!#/,"$line"); $i++; } LINE: foreach $line (@input) { @column = split(/#!#/,"$line"); $position++; if ($column[0] eq $form{'number'}) { last LINE; } } foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { if ($position eq 1) { &top_part_htm; exit; } } } foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { if ($position eq $i) { &top_part_htm; exit; } } } foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { &top_part_htm; exit; } } } ##################### End of Viewing Data Detail ################# ##################### Start Previous Action ###################### sub previous_division { &read_data; $i = -1; LINE: foreach $line (@input) { @column = split(/#!#/,"$line"); $position++; $i++; $no = $column[0]; if ($column[0] eq $form{'number'}) { last LINE; } } $position = 0; LINE: foreach $line (@input) { @column = split(/#!#/,"$line"); $position++; $no = $column[0]; if ($position eq $i) { last LINE; } } $form{'number'} = $no; foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { if ($i > 1) { &top_part_htm; exit; } } } foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { if ($i eq 1) { &top_part_htm; exit; } } } } ##################### End of Previous Action #################### ##################### Start Next Action ######################### sub next_division { &read_data; foreach $line (@input) { $j++; } $i = 1; LINE: foreach $line (@input) { @column = split(/#!#/,"$line"); $position++; $i++; $no = $column[0]; if ($column[0] eq $form{'number'}) { last LINE; } } $position = 0; LINE: foreach $line (@input) { @column = split(/#!#/,"$line"); $position++; $no = $column[0]; if ($position eq $i) { last LINE; } } $form{'number'} = $no; foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { if ($position <$j) { &top_part_htm; exit; } } } foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { if ($position eq $j) { &top_part_htm; exit; } } } } ##################### End of Next Action ######################## #################### Start Viewing Selected Subjects ############ sub selected_subjects { &read_data; print "$SITE_NAME\n"; print "

$SITE_NAME

\n"; print "\n"; print "\n"; print "\n"; print "\n"; foreach $line (@input) { @column = split(/#!#/,"$line"); if ($column[0] eq $form{'number'}) { $without_re = $column[4]; $without_re =~ s/\Re: //g; } } foreach $line (@input) { @column = split(/#!#/,"$line"); $real_subject = $column[4]; $column[4] =~ s/\Re: //g; if ($column[4] eq $without_re) { print "\n"; print "\n"; print "\n"; print "\n"; } } print "
#FromSubjectDate
$column[0]$column[1]\n"; print "$real_subject$column[3]

\n"; exit; } ##################### End of Viewing Selected Subjects ############ ##################### Sub Read Data ############################### sub read_data { open (DATA, "$DATA_DIR/messages.dat"); @input = ; close (DATA); } ################################################################### ################### Sub Print Top of HTML ######################### sub top_part_htm { print "$SITE_NAME\n"; print "

$SITE_NAME



\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Reply to this messageMessage: $column[0]Post a New Message
\n"; print "
\n"; print "\n"; print "\n"; print "\n"; print "
From: $column[1]Date: $column[3]
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Subject: $column[4]
$column[5]

View replies to this message
\n"; print "
\n"; ########## START Getting the Message Number of Last Message ########### @entry = split(/#!#/,"$input[0]"); ########### END Getting the Message Number of Last Message ############ print "\n"; if ($form{'number'} < $entry[0] ) { print "\n"; } else { print "\n"; } print "\n"; ########## START Getting the Message Number of First Message ########### foreach $line (@input) { @entryB = split(/#!#/,"$line"); } ########### END Getting the Message Number of First Message ############ if ($form{'number'} > $entryB[0] ) { print "\n"; } else { print "\n"; } print "
< Previous
Message: $column[0]Next >
\n"; print "
\n"; ############################################################################## # YOU MAY NOT USE MIDMART MESSAGEBOARD IF THE FOLLOWING COPYRIGHT NOTICES # # ARE ALTERED OR EDITED. If you really need to remove this code, you may # # register the Midmart Messageboard just for $40. # # We prosecute all violators via both civil legal actions and in cooperation # # with U.S. and international criminal authorities. YOU HAVE BEEN WARNED! # ############################################################################## print "
\n"; print "Powered by Midmart Messageboard
\n"; print "
\n"; ################################################>############################## # END OF DO NOT ALTER # # ############################################################################## print "\n"; }