Просмотр файла includes/wap/builder/page_copy.php

Размер файла: 2.36Kb
  1. <?php
  2. $query3=strtolower(rus2tr(utf2cyr($query3)));
  3.  
  4. $fname=explode('.',$query3);
  5. $name=$fname[0];
  6. $ext=$fname[1];
  7. if ($ext=='wml') $query3=$name;
  8.  
  9. if ($query3!='')
  10. {
  11. if ((strlen(trim(strtr(strtr(trim($query3),' ','^'),'0123456789-_abcdefghjiklmnopqrstuvwxyz',' ')))!=0)||(strlen($param1)>16))
  12. {
  13. print $head.cyr2utf('<card id="main" title="Копировать"><p>'.
  14. '<b>'.$param1.'.wml - недопустимое имя файла</b> <br/> <br/>'.
  15. '<b>'.$editfile.' копировать в:</b><br/>'.
  16. '<input name="pg'.$nocache.'" type="text" title="Новое имя" value="file'.$i.'" maxlength="16"/><br/>'.
  17. '<a href="http://wap.kmx.ru/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/copy/$(pg'.$nocache.')//'.$nocache.'">Переименовать</a> <br/>'.
  18. '<a href="http://wap.kmx.ru/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'">Отмена</a>'.
  19. '</p></card></wml>');
  20. exit;
  21. }
  22.  
  23. if ($query5!='') $nocache_=$query5+0;
  24. $fp = @fopen ($userpath."opeation.cache", "r");$testcache = trim(@fgets($fp, 10));@fclose ($fp);
  25. if ($nocache_!=$testcache)
  26. {
  27. if (file_exists($userpath.$currentdir.$query3.'.wml') && ($query4!='rewrite'))
  28. {
  29. print $head.cyr2utf('<card id="main" title="Копировать"><p>'.
  30. '<b>Файл '.$param1.'.wml уже существует, заменить?</b><br/>'.
  31. '<a href="http://wap.kmx.ru/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/copy/'.$param1.'/rewrite/'.$nocache.'">Заменить</a> <br/> <br/>'.
  32. '<b>'.$editfile.' копировать в:</b><br/>'.
  33. '<input name="pg'.$nocache.'" type="text" title="Новое имя" value="file'.$i.'" maxlength="16"/><br/>'.
  34. '<a href="http://wap.kmx.ru/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'/copy/$(pg'.$nocache.')//'.$nocache.'">Переименовать</a> <br/>'.
  35. '<a href="http://wap.kmx.ru/?'.$id.'/pm'.$dmpage.$mpage.'/'.$editfile.'">Отмена</a>'.
  36. '</p></card></wml>');
  37. exit;
  38. }
  39.  
  40. if ((!file_exists($userpath.$currentdir.$query3.'.wml')) || (file_exists($userpath.$currentdir.$query3.'.wml') && ($query4=='rewrite')))
  41. {
  42. @unlink($userpath.$currentdir.$query3.'.wml');
  43. @copy($userpath.$currentdir.$editfile.'.wml',$userpath.$currentdir.$query3.'.wml');
  44. @chmod($userpath.$currentdir.$query3.'.wml',0777);
  45. $fp = fopen ($userpath."opeation.cache", "w+");fwrite ($fp, $nocache_);fclose ($fp);
  46. }
  47. }
  48.  
  49. $editfile=$query3;
  50. $action=$query2='';
  51. include($buildpath.'page_menu.php');
  52. exit;
  53. }
  54. ?>