View file www/news/com_add.php

File size: 1.85Kb
<?php
  $ms_max = 500;                       // максимальный размер поля
include($cms.'flud/js/smyle.php');
?>
<form name="formText" id="cform" class="ramka" action="" method="post">
<?php
if ($_SESSION['user_login'] != '')
  echo ('<div >'.$_SESSION['user_login'].':</div>');
  else
  echo 'IP: '.$_SESSION['login'];
  $ms_pol = 'fa_mess1';               // имя поля area
  include($cms.'flud/js/sender.php'); // js код для проверки корректности поля $ms_pol
  include($cms.'flud/js/smyler.php');  // смайлы
?>
<input disabled name="t2" type="mess2" class="ramka" style="width: 98%;" value="Вы ввели: 0 из <?php echo $ms_max?>">
<textarea onkeyup="Change()" onkeydown="SendComment(event)" style="width: 99%;" name="fa_mess1" rows=5 cols=20></textarea><br />
<input name="pokas" type="hidden" value="file_com_add">
<?php echo '
      <input name="rasd" type="hidden" value="'.$filee.'">
      <input name="tov_ok" type="hidden" value="'.trim($tovar2).'">
      ';
?>
<a href="#" id="clickan" onmouseOver="Change()" onClick="form_next()"><span class="knopka">Сохранить (ctrl+enter)</span></a>
<script type="text/javascript">

</script>
</form>
<br />
<?php
 if (trim($_POST['fa_mess1']) != '')
 {
  if ($_SESSION['comm_news'] != trim($_POST['fa_mess1']))
  {
  $_SESSION['comm_news'] = trim($_POST['fa_mess1']);

  $mess1 = substr($_POST['fa_mess1'],0,$ms_max);
  include($cms.'flud/anti_x.php');
  $text = $mess1;

  if ($_SESSION['user_login'] != '')
  $name_quest = ('[b]'.$_SESSION['user_login'].':[/b]');
  else
  $name_quest = ('[b]Гость с IP: '.$_SESSION['login'].'[/b]');

  $mess1 = $name_quest;
  include($cms.'flud/anti_x.php');
  $name_quest = $mess1;

  $fp = fopen ($cms.'news/coment/'.trim($fn[0]).'.txt', "a+");
  fwrite ($fp, date("d/m/Y").'|'.$name_quest.'|'.stripslashes($text)."\r\n");
  fclose ($fp);
  }
 }
?>
 <hr />