Форум Центра открытых систем
  • Новая тема
  • Архив сообщений
    "; switch($x) : default : print ""; $data1 = file("forum.data"); $data1size = sizeof($data1); $n = "$data1size"; $g = "0"; do { $n2 = $n+1; $textdata = explode("|", $data1[$n]); $fiile = "forumfiles/$n2.txt"; if (! is_file("$fiile")) { } else { $xx = "1"; $data2 = file("$fiile"); $data2size = sizeof($data2); if ($data2size < 2) { $tema = "tema0.gif"; } else { $tema = "tema.gif"; } $textdata[3] = substr($textdata[3],0,45); $textdata[1] = substr($textdata[1],0,10); if ($textdata[1] != "") { print " \r\n"; } do { $textdata2 = explode("|", $data2[$xx]); if ($textdata2[1] != "") { if ($textdata2[0] > "4") { $textdata2[0] = "4"; } if ($data2size == "2" && $textdata2[0] == "1") { $textdata2[0] = "1e"; } if ($data2size == "3" && $textdata2[0] == "2") { $textdata2[0] = "2e"; } if ($data2size == "4" && $textdata2[0] == "3") { $textdata2[0] = "3e"; } if ($data2size == "5" && $textdata2[0] == "4") { $textdata2[0] = "4e"; } if ($data2size > "6" && $textdata2[0] > "5") { $textdata2[0] = "4e"; } $xx1 = $xx+1; if ($data2size == "$xx1" && $xx1 > "4") { $textdata2[0] = "4e"; } $textdata2[3] = substr($textdata2[3],0,45); $textdata2[1] = substr($textdata2[1],0,10); print " \r\n"; } $xx++; if ($xx > $limit && $show != "all") { $xx = "$data2size"; } } while($xx < $data2size); } $n--; } while($n+1 > 0); print "
    $textdata[3] "; if ($textdata[4] != "") { print ""; } print "$textdata[1] $textdata[2]
    $textdata2[3] $textdata2[1] $textdata2[2]
      Новая тема (Всего тем $data1size) Архив тем
    "; break; case("read") : if ($tema == "") { print "error"; exit; } $data1 = file("forumfiles/$tema.txt"); $data1size = sizeof($data1); $n = "0"; do { $datatext = explode("|", $data1[$n]); if ($n == "0") { $col = $c01; $subject = "$datatext[3]"; } else { $col = $c02; } if ($datatext[3] != "") { print "
    $datatext[3]"; if ($datatext[5] != "") { print ""; } print "$datatext[1] ($datatext[2])
    $datatext[4]


    "; } $n++; } while($n < $data1size); print "

    Ответить:

    Заголовок: 
    Ваше имя: 
    Ваш E-mail: 
    Текст ответа: 
    "; break; case("add") : print "

    Добавить тему

    Заголовок: 
    Ваше имя: 
    Ваш E-mail: 
    Текст: 
    "; break; case("add2tema"): $ss = file("forum.data"); $s2size = sizeof($ss); $s2size++; $dat = date("d.m.Y"); $text1 = "$s2size|$name|$dat|$subject|$email|"; $text1 = stripslashes($text1); $text1 = htmlspecialchars($text1); $text1 = str_replace("\r\n", "
    ", $text1); $fp=fopen("forum.data","a"); fputs($fp,"$text1\r\n"); fclose($fp); $text2 = "main|$name|$dat|$subject|$text|$email|"; $text2 = stripslashes($text2); $text2 = htmlspecialchars($text2); $text2 = str_replace("\r\n", "
    ", $text2); $fff = "forumfiles/$s2size.txt"; $fp=fopen("$fff","a+"); fputs($fp,"$text2\r\n"); fclose($fp); @chmod("$fff", 0777); print ""; print " "; break; case("add2reply"): $ss = file("forumfiles/$tema.txt"); $s2size = sizeof($ss); //$s2size++; $dat = date("d.m.Y"); $text1 = "$s2size|$name|$dat|$subject|$text|$email|"; $text1 = stripslashes($text1); $text1 = htmlspecialchars($text1); $text1 = str_replace("\r\n", "
    ", $text1); $fp=fopen("forumfiles/$tema.txt","a"); fputs($fp,"$text1\r\n"); fclose($fp); print ""; print " "; break; endswitch; if (! is_file("do.php")) { } else { include "do.php"; } ?>