1. PHP / Говнокод #9366

    +160

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    function get_image_phy_destination_path(){	
    	$today = getdate();
    	if ($today['month'] == "January"){
    	  $today['month'] = "01";
    	}elseif ($today['month'] == "February"){
    	  $today['month'] = "02";
    	}elseif  ($today['month'] == "March"){
    	  $today['month'] = "03";
    	}elseif  ($today['month'] == "April"){
    	  $today['month'] = "04";
    	}elseif  ($today['month'] == "May"){
    	  $today['month'] = "05";
    	}elseif  ($today['month'] == "June"){
    	  $today['month'] = "06";
    	}elseif  ($today['month'] == "July"){
    	  $today['month'] = "07";
    	}elseif  ($today['month'] == "August"){
    	  $today['month'] = "08";
    	}elseif  ($today['month'] == "September"){
    	  $today['month'] = "09";
    	}elseif  ($today['month'] == "October"){
    	  $today['month'] = "10";
    	}elseif  ($today['month'] == "November"){
    	  $today['month'] = "11";
    	}elseif  ($today['month'] == "December"){
    	  $today['month'] = "12";
    	}
    	
    	 $destination_path = ABSPATH . "wp-content/uploads/".$today['year']."/";
          if (!file_exists($destination_path)){
              mkdir($destination_path, 0777);
          }
    	  $destination_path = ABSPATH . "wp-content/uploads/".$today['year']."/".$today['month']."/";
    	if (!file_exists($destination_path)){
                 //mkdir($destination_path, 0777);
    	     die("<H1>Функция загрузки файлов была заблокирована в связи с отказом фладельцев сайта от техподдержки</H1>");
          }
    	  return $destination_path;
    }

    раз в месяц папка создавалась в ручную

    Запостил: randombot, 09 Февраля 2012

    Комментарии (8) RSS

    Добавить комментарий