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

Размер файла: 1.5Kb
  1. <?php
  2.  
  3. include "config.php";
  4. include "incl/pss.inc";
  5. include "incl/head.inc";
  6.  
  7. if(!isset($topic)){redirect("admin.php?f=$f");}
  8. else{$file="$data/$topic";file_allowed($topic);}
  9.  
  10. $fs=open_file($file);
  11. $fs=explode("\n",$fs);
  12.  
  13. if(isset($line)&&isset($subject)&&isset($post)){
  14. $line=(int)$line;
  15. $subject=str_replace(':|:','',$subject);
  16. $post=str_replace(':|:','',$post);
  17. $post=str_replace("\r",'',$post);
  18. $post=str_replace("\n",'<br />',$post);
  19. $subject=stripslashes($subject);
  20. $post=stripslashes($post);
  21. $row=explode(":|:",$fs[$line]);
  22. $row[1]=$subject;
  23. $row[3]=$post;
  24. $fs[$line]=implode(':|:',$row);
  25. $fs=implode("\n",$fs);
  26. save_file($file,$fs);
  27. die("<script type=\"text/javascript\">a='adminsh.php?f=$f&topic=$topic';window.location=a;</script></head></body><body></body></html>");
  28. }
  29. ?>
  30. </head><body>
  31. <?php
  32.  
  33. for($i=0;$i<count($fs);$i++){
  34. $row=explode(":|:",$fs[$i]);
  35. print '<form action="admined.php" method="post">'."\n";
  36. print '<input type="hidden" name="f" value="'.$f.'" />'."\n";
  37. print '<input type="hidden" name="topic" value="'.$topic.'" />'."\n";
  38. print '<input type="hidden" name="line" value="'.$i.'" />'."\n";
  39. print '<input type="text" style="position:relative;width:60%" name="subject" value="'.$row[1].'" /><br />'."\n";
  40. $msg=str_replace('<br />',"\r\n",$row[3]);
  41. print '<textarea cols="20" rows="8" name="post" style="position:relative;width:60%">'.$msg.'</textarea>'."\n";
  42. print '<br /><input type="submit" value="Save" />'."\n";
  43. print '</form><br />'."\n";
  44. }
  45. ?>
  46. </body></html>