1. Список говнокодов пользователя kolexander

    Всего: 2

  2. PHP / Говнокод #8881

    +156

    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
    exec(" cd $dir; ls -al|grep '^d';",$file_all);
      	//die(" cd $dir; ls -al|grep '^d';");
      	$filelist_date = array();
      	
      	for($i=0;$i<count($file_all);$i++) {
      		$file_all[$i] = preg_replace('/\s+/','|',$file_all[$i]);
      		
      		$file_all[$i] = explode('|',$file_all[$i],9);
      		if(!empty($file_all[$i][8])) $file_all[$i][8] = str_replace('|',' ',$file_all[$i][8]);
      		
      		//print_r($file_all[$i]); echo "\n\n";
      		if($file_all[$i][8] == '.' || $file_all[$i][8] == '..') continue;
      		
      		$k = strtotime($file_all[$i][5]." ".$file_all[$i][6]." ".$file_all[$i][7]);
      		$filelist_date[$k] = $file_all[$i][8];
      	}
      	krsort($filelist_date);
      	
      	$filelist = array_values($filelist_date);

    этот кусок кода выполняет начитку директорий фото галерей

    kolexander, 04 Января 2012

    Комментарии (13)
  3. PHP / Говнокод #8400

    +155

    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
    function toCyrillicTranslit($title)
    {
        $title = trim($title);
        
        $title = str_replace("&#192;", "А", $title);
        $title = str_replace("&#193;", "А", $title);
        $title = str_replace("&#194;", "А", $title);
        $title = str_replace("&#195;", "А", $title);
        $title = str_replace("&#196;", "А", $title);
        $title = str_replace("&#197;", "А", $title);
        $title = str_replace("&#198;", "А", $title);
        $title = str_replace("&#199;", "С", $title);
        $title = str_replace("&#200;", "Е", $title);
        $title = str_replace("&#201;", "Е", $title);
        $title = str_replace("&#202;", "Е", $title);
        $title = str_replace("&#203;", "Е", $title);
        $title = str_replace("&#204;", "И", $title);
        $title = str_replace("&#205;", "И", $title);
        $title = str_replace("&#206;", "И", $title);
        $title = str_replace("&#207;", "И", $title);
        $title = str_replace("&#208;", "Д", $title);
        $title = str_replace("&#209;", "Н", $title);
        $title = str_replace("&#210;", "О", $title);
        $title = str_replace("&#211;", "О", $title);
        $title = str_replace("&#212;", "О", $title);
        $title = str_replace("&#213;", "О", $title);
        $title = str_replace("&#214;", "О", $title);
        $title = str_replace("&#215;", "х", $title);
        $title = str_replace("&#216;", "О", $title);
        $title = str_replace("&#217;", "У", $title);
        $title = str_replace("&#218;", "У", $title);
        $title = str_replace("&#219;", "У", $title);
        $title = str_replace("&#220;", "У", $title);
        $title = str_replace("&#221;", "У", $title);
        $title = str_replace("&#222;", "П", $title);
    // и так далее ...

    kolexander, 02 Ноября 2011

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