Размер файла: 9.33Kb
<? if (! is_file ( "head.php" )) { } else { include "head.php" ; } ############################################\ # Создание скрипта: -=FreeMan=- # # Имя скрипта: Форум # # Версия скрипта: 1.0 # # Статус: скрипт бесплатный # # Требования: PHP4 # # Дата создания скрипта: 4 июня 2004 год # # Мыло: freemen1983@inbox.ru # ############################################# # Читай файл readme.txt # ############################################/ include "config.php" ; print "<table width=$width cellpadding=0 cellspacing=0 border=0 align=center> <tr><td width=20><tr><td bgcolor=$c01> <img src=new.png align=center> <b><a href='index.php?x=add'>Новая тема </a></b></td><td bgcolor=$c01></td><td bgcolor=$c01><a href='http://script-php.pp.ru'> Так же посетите сайт : Скрипты на РНР................................. </a><a href='forum.php?show=all'> Архив тем</a></td></tr> <tr><td colspan=3 height=5></td></tr> <tr><td colspan=3 bgcolor=$co3> $title</td></tr> <tr><td colspan=3 height=5></td></tr> </table> " ; switch ( $x ) : default : print "<table width=$width cellpadding=0 cellspacing=0 border=0 align=center>" ; $data1 = file ( "data.data" ); $data1size = sizeof ( $data1 ); if ( $part == "" ) { $n = "$data1size" ; } else { $part2 = $part * 10 ; $n = $data1size - $part2 ; } $g = "0" ; $limx = 0 ; do { $limx ++; $n2 = $n + 1 ; $textdata = explode ( "|" , $data1 [ $n ]); $fiile = "files/$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 " <tr><td bgcolor=$c01><img src=$tema width=20 height=20 align=left> <a href='index.php?x=read&tema=$n2'>$textdata[3]</a></td> <td bgcolor=$c01 width=120><b>" ; if ( $textdata [ 4 ] != "" ) { print "<a href='mailto:$textdata[4]'>" ; } print "$textdata[1]</a></b></td> <td bgcolor=$c01 width=80>$textdata[2]</td></tr><tr><td height=1 background=pset.gif colspan=3><img src=pset.gif width=1 height=1></td></tr>\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 " <tr><td bgcolor=$c02><img src=_$textdata2[0].gif height=20 align=left> <a href='index.php?x=read&tema=$n2'>$textdata2[3]</a></td> <td bgcolor=$c02><b>$textdata2[1]</b></td> <td bgcolor=$c02>$textdata2[2]</td></tr><tr><td height=1 background=pset.gif colspan=3><img src=pset.gif width=1 height=1></td></tr>\r\n" ; } $xx ++; // if ($xx > $limit && $show != "all") { $xx = "$data2size"; } if ( $limx > 10 && $show != "all" ) { $n = "0" ; } } while ( $xx < $data2size ); } $n --; } while ( $n + 1 > 0 ); print " <tr><td bgcolor=$c01> <img src=new.png align=center> <b><a href='index.php?x=add'>Новая тема</a></b></td><td bgcolor=$c01> (Всего тем $data1size)</td><td bgcolor=$c01> <a href='index.php?show=all'>Архив тем</a></td></tr></table> " ; break ; case ( "read" ) : if ( $tema == "" ) { print "error" ; exit ; } $data1 = file ( "files/$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 "<table width=$width bgcolor=$col align=center><tr><td width=*> <font size=3><b>$datatext[3]</font></b></td><td width=150 valign=top align=right>" ; if ( $datatext [ 5 ] != "" ) { print "<a href='mailto:$datatext[5]'>" ; } print "$datatext[1]</a> ($datatext[2])</td></tr> <tr><td colspan=2>$datatext[4] </td></tr></table><br><br>" ; } $n ++; } while ( $n < $data1size ); print " <center><h2>Ответить:</h2></center> <form action=index.php?x=add2reply method=post> <input type=hidden name=tema value=$tema> <table width=$width align=center> <tr><td colspan=2>Заголовок: <br><input type=text name=subject maxlength=50 value=\"Re: $subject\" style=\"width: 100%;\"></td></tr> <tr><td width=50%>Ваше имя: <br><input type=text name=name maxlength=20 style=\"width: 100%;\"></td><td width=50%>Ваш E-mail: <br><input type=text name=email style=\"width: 100%;\"></td></tr> <tr><td colspan=2>Текст ответа: <br><textarea rows=7 name=text style=\"width: 100%;\"></textarea></td></tr> <tr><td colspan=2><input type=submit value=\"Отправить сообщение\" style=\"width: 100%;\"></td></tr> </table> " ; break ; case ( "add" ) : print " <center><h2>Добавить тему</h2></center> <form action=index.php?x=add2tema method=post> <table width=$width align=center> <tr><td colspan=2>Заголовок: <br><input type=text name=subject maxlength=50 value=\"\" style=\"width: 100%;\"></td></tr> <tr><td width=50%>Ваше имя: <br><input type=text maxlength=20 name=name style=\"width: 100%;\"></td><td width=50%>Ваш E-mail: <br><input type=text name=email style=\"width: 100%;\"></td></tr> <tr><td colspan=2>Текст: <br><textarea rows=7 name=text style=\"width: 100%;\"></textarea></td></tr> <tr><td colspan=2><input type=submit value=\"Отправить сообщение\" style=\"width: 100%;\"></td></tr> </table> " ; break ; case ( "add2tema" ): if ( $subject == "" ) { print "<h2>Не указана тема!</h2> <br>- Вернитесь и заполните все поля!" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } exit ; } if ( $name == "" ) { print "<h2>Введите свое имя!</h2> <br>- Вернитесь и заполните все поля!" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } exit ; } if ( $text == "" ) { print "<h2>Введите текст сообщения!</h2> <br>- Вернитесь и заполните все поля!" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } exit ; } $ss = file ( "data.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" , "<br>" , $text1 ); $fp = fopen ( "data.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" , "<br>" , $text2 ); $fff = "files/$s2size.txt" ; $fp = fopen ( "$fff" , "a+" ); fputs ( $fp , "$text2\r\n" ); fclose ( $fp ); @chmod ( "$fff" , 0777 ); print "<script language=JavaScript>window.alert('Ваша тема добавлена!');</script>" ; print " <script language=\"JavaScript\"> <!-- if (navigator.appName == \"Netscape\") window.location.href = \"index.php?\"; else if (navigator.appName == \"Microsoft Internet Explorer\") window.location.href = \"index.php?\"; else window.location.href = \"index.php?\"; // --> </script>" ; break ; case ( "add2reply" ): if ( $subject == "" ) { print "<h2>Не указана тема!</h2> <br>- Вернитесь и заполните все поля!" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } exit ; } if ( $name == "" ) { print "<h2>Введите свое имя!</h2> <br>- Вернитесь и заполните все поля!" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } exit ; } if ( $text == "" ) { print "<h2>Введите текст сообщения!</h2> <br>- Вернитесь и заполните все поля!" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } exit ; } $ss = file ( "files/$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" , "<br>" , $text1 ); $fp = fopen ( "files/$tema.txt" , "a" ); fputs ( $fp , "$text1\r\n" ); fclose ( $fp ); print "<script language=JavaScript>window.alert('Ваш ответ добавлен!');</script>" ; print " <script language=\"JavaScript\"> <!-- if (navigator.appName == \"Netscape\") window.location.href = \"index.php?x=read&tema=$tema&\"; else if (navigator.appName == \"Microsoft Internet Explorer\") window.location.href = \"index.php?x=read&tema=$tema&\"; else window.location.href = \"index.php?x=read&tema=$tema&\"; // --> </script>" ; break ; endswitch ; print " <br> <table cellpadding=0 cellspacing=0 width=$width align=center> <tr> <td>" ; $num4 = $data1size / 10 ; $num4 = explode ( "." , $num4 ); $n = "0" ; do { $nn = $n + 1 ; print " [<a href='index.php?part=$n'>$nn</a>] " ; $n ++; } while ( $n < $num4 [ 0 ]+ 1 ); print "</td> </tr> </table>" ; if (! is_file ( "bottom.php" )) { } else { include "bottom.php" ; } ?>