"; if ($rep < ' '){ $result = pg_Exec ($conn, "Select message,name,date,subject,pic,ip from mboard where id = '$id' order by repid ASC"); echo "
"; printf ( "Subject:  %s
",pg_result($result,0,3)); printf ( "Posted by:  %s",pg_result($result,0,1)); printf ( "   On %s",pg_result($result,0,2)); printf ( "
Poster IP: %s
",pg_result($result,0,5)); printf ( "Message:   

%s

",nl2br(pg_result($result,0,0))); $picexists = pg_result($result,0,4); if ($picexists != ""){ printf ( "Attachment:
",pg_result($result,0,4)); } printf ( "
",pg_result($result,0,4)); $result = pg_Exec ($conn, "Select repid from mboard where id = '$id' and repid > '0' order by repid ASC"); $rows = pg_numrows($result); if ($rows > '0'){ $idz = pg_result($result,0,0); echo "View Replies "; } echo ""; exit; } else { $result = pg_Exec ($conn, "Select message,name,date,id,pic,ip from mboard where repid = '$rep'"); $id = pg_result($result,0,3); $result1 = pg_Exec ($conn, "Select message,name,date,subject,pic,ip from mboard where id = '$id' order by repid ASC"); echo "
"; printf ( "Subject:  %s
",pg_result($result1,0,3)); printf ( "Posted by:  %s",pg_result($result1,0,1)); printf ( "   On %s",pg_result($result1,0,2)); printf ( "
Poster IP: %s
",pg_result($result1,0,5)); printf ( "Original Message:
   %s",pg_result($result1,0,0)); $picexists = pg_result($result1,0,4); if ($picexists != ""){ printf ( "

Attachment:
",pg_result($result1,0,4)); } echo "


"; printf ( "Replied by:  %s",pg_result($result,0,1)); printf ( "   On %s",pg_result($result,0,2)); printf ( "
Poster IP: %s
",pg_result($result,0,5)); printf ( "Reply Message:
   %s",pg_result($result,0,0)); $picexists2 = pg_result($result,0,4); if ($picexists2 != ""){ printf ( "

Attachment:
",pg_result($result,0,4)); } echo "


"; $result = pg_Exec ($conn, "Select repid from mboard where id = '$id' and repid < '$rep' and repid > '0' order by repid desc"); $rows = pg_numrows($result); if ($rows > '0'){ $idz = pg_result($result,0,0); echo "Previous"; } else { echo "Message"; } $result = pg_Exec ($conn, "Select repid from mboard where id = '$id' and repid > '$rep' and repid > '0' order by repid asc"); $rows = pg_numrows($result); if ($rows > '0'){ $idz = pg_result($result,0,0); echo "   Next"; } else { echo "   iNext"; } echo "   Main Board "; echo ""; } ?>