Просмотр файла eforum25/add.php

Размер файла: 1.76Kb
  1. <?php
  2. include "config.php";
  3. include "incl/head.inc";
  4. include "incl/ban.inc";
  5.  
  6. $pass_reason='';
  7. $temp_title=$lang[19];
  8. if(isset($memname)){$name=urldecode($memname);}
  9. if(isset($mempass)){$key=urldecode($mempass);}
  10.  
  11. if(isset($name)&&isset($title)&&isset($text)&&isset($topic)){
  12. if(!isset($image)||$image=='http://'){$image='';}
  13.  
  14. include "incl/flood.inc";
  15. include "incl/format.inc";
  16.  
  17. $file="$data/$topic";
  18. file_allowed($topic);
  19.  
  20. if($name==''||$title==''||$text==''){redirect("main.php?f=$f");}
  21.  
  22. $fs=open_file($log);
  23. $fs=explode("\n",$fs);
  24.  
  25. for($i=0;$i<count($fs);$i++){
  26. $row=explode(":|:",$fs[$i]);
  27.  
  28. if($i==0){$last=$row[1];
  29. if(!strstr($last,' ')&&($current_time-$last)<$post_interval){
  30.  
  31. $temp_link='show.php?f='.$f.'&amp;topic='.$topic;
  32. $text=str_replace('<br />',"\r\n",$text);
  33. $text=strip_tags($text);
  34. $name=strip_tags($name);
  35. $pass_reason=$lang[75];
  36. include "incl/edit.inc";
  37. die();}}
  38.  
  39. if($row[0]==$topic){$row[5]=(int)$row[5];
  40. $row[5]=$row[5]+1;
  41. $row[1]=$current_time;
  42. $row[6]=strip_tags($name);
  43. $row=implode(":|:",$row);
  44. $fs[$i]='';break;}}
  45.  
  46. $fs=implode("\n",$fs);
  47. $fs="$row\n$fs";
  48. save_file($log,$fs,0);
  49.  
  50. $fs=open_file($file);
  51. $fs="$fs\n$current_time:|:$title:|:$name:|:$text:|:$image:|:$REMOTE_ADDR";
  52. $temp_var=explode("\n",$fs);$temp_var=count($temp_var);
  53. save_file($file,$fs,0);
  54.  
  55. if(isset($admin_mail)&&$admin_mail!='not_set_yet'){
  56. $snm=strip_tags($name);
  57. $txt=strip_tags($text);
  58. $message="Subject: $title\nAuthor: $snm\n\n$txt";
  59. mail($admin_mail,"Forum Notification",$message,"From: admin@$SERVER_NAME");}
  60.  
  61. redirect("show.php?f=$f&topic=$topic&u=$temp_var");}
  62.  
  63. elseif(isset($topic)){
  64. file_allowed($topic);
  65.  
  66. $temp_link='show.php?f='.$f.'&amp;topic='.$topic;
  67. include "incl/edit.inc";}
  68.  
  69. else{redirect("main.php?f=$f");}
  70. ?>
  71.