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

    +165

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <?
    $text = @file("MySql/base123/reg/$log.dat");		
    $udata = explode(":||:", $text[0]);		
    $udata[100] = round($udata[100] + 1);
    $text = $udata[0] .':||:'. $udata[1] .':||:'. $udata[2] .':||:'. $udata[3] .':||:'. $udata[4] .':||:'. $udata[5] .':||:'. $udata[6] .':||:'. $udata[7] .':||:'. $udata[8] .':||:'. $udata[9] .':||:'. $udata[10] .':||:'. $udata[11] .':||:'. $udata[12] .':||:'. $udata[13] .':||:'. $udata[14] .':||:'. $udata[15] .':||:'. $udata[16] .':||:'. $udata[17] .':||:'. $udata[18] .':||:'. $udata[19] .':||:'. $udata[20] .':||:'. $udata[21] .':||:'. $udata[22] .':||:'. $udata[23] .':||:'. $udata[24] .':||:'. $udata[25] .':||:'. $udata[26] .':||:'. $udata[27] .':||:'. $udata[28] .':||:'. $udata[29] .':||:'. $udata[30] .':||:'. $udata[31] .':||:'. $udata[32] .':||:'. $udata[33] .':||:'. $udata[34] .':||:'. $udata[35] .':||:'. $udata[36] .':||:'. $udata[37] .':||:'. $udata[38] .':||:'. $udata[39] .':||:'. $udata[40] .':||:'. $udata[41] .':||:'. $udata[42] .':||:'. $udata[43] .':||:'. $udata[44] .':||:'. $udata[45] .':||:'. $udata[46] .':||:'. $udata[47] .':||:'. $udata[48] .':||:'. $udata[49] .':||:'. $udata[50] .':||:'. $udata[51] .':||:'. $udata[52] .':||:'. $udata[53] .':||:'. $udata[54] .':||:'. $udata[55] .':||:'. $udata[56] .':||:'. $udata[57] .':||:'. $udata[58] .':||:'. $udata[59] .':||:'. $udata[60] .':||:'. $udata[61] .':||:'. $udata[62] .':||:'. $udata[63] .':||:'. $udata[64] .':||:'. $udata[65] .':||:'. $udata[66] .':||:'. $udata[67] .':||:'. $udata[68] .':||:'. $udata[69] .':||:'. $udata[70] .':||:'. $udata[71] .':||:'. $udata[72] .':||:'. $udata[73] .':||:'. $udata[74] .':||:'. $udata[75] .':||:'. $udata[76] .':||:'. $udata[77] .':||:'. $udata[78] .':||:'. $udata[79] .':||:'. $udata[80] .':||:'. $udata[81] .':||:'. $udata[82] .':||:'. $udata[83] .':||:'. $udata[84] .':||:'. $udata[85] .':||:'. $udata[86] .':||:'. $udata[87] .':||:'. $udata[88] .':||:'. $udata[89] .':||:'. $udata[90] .':||:'. $udata[91] .':||:'. $udata[92] .':||:'. $udata[93] .':||:'. $udata[94] .':||:'. $udata[95] .':||:'. $udata[96] .':||:'. $udata[97] .':||:'. $udata[98] .':||:'. $udata[99] .':||:'. $udata[100] .':||:';
            $fp = fopen("MySql/base123/reg/$log.dat", "a+");
            flock($fp, LOCK_EX);
            ftruncate($fp, 0);
            fputs($fp, "$text");
            fflush($fp);
            flock($fp, LOCK_UN);
            fclose($fp);

    Попался скрипт браузерной игры. Автор - Bishop какой то. Это просто залежи позитива. Второй день ржунимагу.

    twin, 12 Февраля 2011

    Комментарии (27)
  2. PHP / Говнокод #5647

    +185

    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
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    <?php 
    
    for ($i=1;$i<=31;$i++) {         // дни
    for ($j=1;$j<=12;$j++) {        // месяцы
    for ($k=70;$k<=99;$k++) {    // годы
    
    $i0=$i; // сохраняем оригинальные значения 
    $j0=$j; // переменных i и j
    
    if ($i=1) { $i="01"; }
    if ($i=2) { $i="02"; }
    if ($i=3) { $i="03"; }
    if ($i=4) { $i="04"; } // конвертируем их значения 
    if ($i=5) { $i="05"; } // в двухзначную форму
    if ($i=6) { $i="06"; }
    if ($i=7) { $i="07"; }
    if ($i=8) { $i="08"; }
    if ($i=9) { $i="09"; }
    
    if ($j=1) { $j="01"; }
    if ($j=2) { $j="02"; }
    if ($j=3) { $j="03"; }
    if ($j=4) { $j="04"; }
    if ($j=5) { $j="05"; }
    if ($j=6) { $j="06"; }
    if ($j=7) { $j="07"; }
    if ($j=8) { $j="08"; }
    if ($j=9) { $j="09"; }
    
    echo("$i$j$k<br>"); // выводим дату: число-месяц-год (год двузначный с 70 по 99)
    
    $i=$i0; // востанавливаем оригинальные 
    $j=$j0; // значения переменных i и j
    
    }}}
    
    for ($i=1;$i<=12;$i++) {
    for ($j=13;$j<=31;$j++) {     // начинаем с 13 чтобы не повторяться в датах
    for ($k=70;$k<=99;$k++) {
    
    $i0=$i;
    $j0=$j;
    
    if ($i=1) { $i="01"; }
    if ($i=2) { $i="02"; }
    if ($i=3) { $i="03"; }
    if ($i=4) { $i="04"; }
    if ($i=5) { $i="05"; }
    if ($i=6) { $i="06"; }
    if ($i=7) { $i="07"; }
    if ($i=8) { $i="08"; }
    if ($i=9) { $i="09"; }
    
    if ($j=1) { $j="01"; }
    if ($j=2) { $j="02"; }
    if ($j=3) { $j="03"; }
    if ($j=4) { $j="04"; }
    if ($j=5) { $j="05"; }
    if ($j=6) { $j="06"; }
    if ($j=7) { $j="07"; }
    if ($j=8) { $j="08"; }
    if ($j=9) { $j="09"; }
    
    echo("$i$j$k<br>"); //  дата: месяц-число-год (год двузначный с 70 по 99)
    
    $i=$i0;
    $j=$j0;
    
    }}}
    
    for ($i=1;$i<=31;$i++) {
    for ($j=1;$j<=12;$j++) {
    for ($k=0;$k<=12;$k++) {
    
    $i0=$i;
    $j0=$j;
    $k0=$k;
    
    if ($i=1) { $i="01"; }
    if ($i=2) { $i="02"; }
    if ($i=3) { $i="03"; }
    if ($i=4) { $i="04"; }
    if ($i=5) { $i="05"; }
    if ($i=6) { $i="06"; }
    if ($i=7) { $i="07"; }
    if ($i=8) { $i="08"; }
    if ($i=9) { $i="09"; }
    
    if ($j=1) { $j="01"; }
    if ($j=2) { $j="02"; }
    if ($j=3) { $j="03"; }
    if ($j=4) { $j="04"; }
    if ($j=5) { $j="05"; }
    if ($j=6) { $j="06"; }
    if ($j=7) { $j="07"; }
    if ($j=8) { $j="08"; }
    if ($j=9) { $j="09"; }
    
    if ($k=0) { $k="00"; }

    http://www.php.ru/forum/viewtopic.php?t=30748

    Devzirom, 12 Февраля 2011

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

    +157

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    //@see http://ru2.php.net/manual/en/function.exif-imagetype.php
    if (!function_exists('exif_imagetype')) {
        function exif_imagetype($filename) {
            if ((list($width, $height, $type, $attr) = getimagesize($filename)) !== false) {
                if ($type > 0) {
                    return $type;
                }
            }
            return false;
        }
    }

    Скопипастил этот код к себе в проект из мануала с php.net для определения типа картинки, т.к на сервере не было экстеншина Exif.
    Много лишних переменных, но в ломак было переписывать, запузырил как есть.

    govnomes, 12 Февраля 2011

    Комментарии (17)
  4. PHP / Говнокод #5645

    +162

    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
    if(strLen($arParams["BLOG_VAR"])<=0)
    	$arParams["BLOG_VAR"] = "blog";
    if(strLen($arParams["PAGE_VAR"])<=0)
    	$arParams["PAGE_VAR"] = "page";
    if(strLen($arParams["USER_VAR"])<=0)
    	$arParams["USER_VAR"] = "id";
    if(strLen($arParams["POST_VAR"])<=0)
    	$arParams["POST_VAR"] = "id";
    	
    $arParams["PATH_TO_BLOG"] = trim($arParams["PATH_TO_BLOG"]);
    if(strlen($arParams["PATH_TO_BLOG"])<=0)
    	$arParams["PATH_TO_BLOG"] = htmlspecialchars($APPLICATION->GetCurPage()."?".$arParams["PAGE_VAR"]."=blog&".$arParams["BLOG_VAR"]."=#blog#");
    
    $arParams["PATH_TO_BLOG_CATEGORY"] = trim($arParams["PATH_TO_BLOG_CATEGORY"]);
    if(strlen($arParams["PATH_TO_BLOG_CATEGORY"])<=0)
    	$arParams["PATH_TO_BLOG_CATEGORY"] = htmlspecialchars($APPLICATION->GetCurPage()."?".$arParams["PAGE_VAR"]."=blog&".$arParams["BLOG_VAR"]."=#blog#"."&category=#category_id#");
    	
    $arParams["PATH_TO_POST_EDIT"] = trim($arParams["PATH_TO_POST_EDIT"]);
    if(strlen($arParams["PATH_TO_POST_EDIT"])<=0)
    	$arParams["PATH_TO_POST_EDIT"] = htmlspecialchars($APPLICATION->GetCurPage()."?".$arParams["PAGE_VAR"]."=post_edit&".$arParams["BLOG_VAR"]."=#blog#&".$arParams["POST_VAR"]."=#post_id#");
    
    $arParams["PATH_TO_USER"] = trim($arParams["PATH_TO_USER"]);
    if(strlen($arParams["PATH_TO_USER"])<=0)
    	$arParams["PATH_TO_USER"] = htmlspecialchars($APPLICATION->GetCurPage()."?".$arParams["PAGE_VAR"]."=user&".$arParams["USER_VAR"]."=#user_id#");

    Из проекта на битрикс, обратите внимание на импровизацию в вариантах написания функции strlen D)))
    Код успешно работает в продакшене более года.

    govnomes, 11 Февраля 2011

    Комментарии (0)
  5. PHP / Говнокод #5643

    +152

    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
    $mime_types = array('jad'  => 'text/vnd.sun.j2me.app-descriptor',
                            'jar'  => 'application/java-archive',
                            'txt'  => 'text/plain',
                            'sis'  => 'application/vnd.symbian.install',
                            'cab'  => 'application/vnd.ms-cab-compressed',
                            'zip'  => 'application/x-zip', 
                            'gz'   => 'application/x-gzip',
                            'tgz'  => 'application/x-gzip',
                            'bz'   => 'application/x-bzip', 
                            'bz2'  => 'application/x-bzip',
                            '7z'   => 'application/x-7z-compressed',
                            'rar'  => 'application/x-rar-compressed',
                            'doc'  => 'application/msword',
                            'pdf'  => 'application/pdf', 
                            'mp3'  => 'audio/mpeg', 
                            'wav'  => 'audio/x-wav',
                            'wma'  => 'audio/x-ms-wma',
                            'avi'  => 'video/x-msvideo',
                            '3gp'  => 'video/3gpp', 
                            'wmv'  => 'video/x-ms-wmv', 
                            'mpg'  => 'video/mpeg', 
                            'gif'  => 'image/gif', 
                            'jpg'  => 'image/jpeg',
                            'jpe'  => 'image/jpeg', 
                            'jpeg' => 'image/jpeg',
    	           );
    
    	$mime_type = (array_key_exist(pathinfo($filepath, PATHINFO_EXTENSION), $mime_types)) ? $mime_types[pathinfo($filepath, PATHINFO_EXTENSION)] : 'application/octet-stream';
    		
    	header('Content-Type: ' . $mime_type . ';');
                  header('content-disposition: attachment; filename="' . basename($filepath) . '";');
                  readfile($download);

    Использую сие для определения Content-Type перед отдачей файла для загрузки.
    И тут меня орашарашили тем, что прямо в лицо сказали, что сие - говнокод, а я - говнокодер всея Руси.
    Что такие дела делаются функциями и вообще что за говно, тут можно без массива.
    Неужто?

    7ion, 11 Февраля 2011

    Комментарии (27)
  6. PHP / Говнокод #5641

    +159

    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
    <?php
    	if($showCapcha != 'showCapcha_0') {
    		echo 'Решите пример: ';
    		$secretCode_1 = rand(1 , 9);
    		$secretCode_2 = rand(1 , 9);
    		$secretCode = $secretCode_1 + $secretCode_2;
    		echo "<strong>" . $secretCode_1 . "</strong> + <strong>" . $secretCode_2 . "</strong> = ";
    		echo '
    			<input id="button_form_contact" type="text" name="secretCode" value="" />
    			<input type="hidden" name="secretCodeHide" value="'.$secretCode.'" />
    		';
    	}
    ?>
    <input id="button_form_contact" type="submit" value=" <?php echo MOD_CON_AM_GO_GO__; ?> ">

    Всё хватит придумывать капчи! Всё уже придумано xDDDD

    nethak, 11 Февраля 2011

    Комментарии (8)
  7. PHP / Говнокод #5638

    +163

    1. 1
    2. 2
    3. 3
    function isInt($val) {
        return is_int($val) || (string)(int)$val === (string)$val;
    }

    Проверка на целое число

    govnomes, 11 Февраля 2011

    Комментарии (23)
  8. PHP / Говнокод #5637

    +156

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    # Преоброзование расширения в MIME тип
    function replace_type_in_mime($type) {
    	$type = strtolower($type);
    	$res = array("323" => "text/h323", "acx" => "application/internet-property-stream", "ai" => "application/postscript", "aif" => "audio/x-aiff", "aifc" => "audio/x-aiff", "aiff" => "audio/x-aiff", "asf" => "video/x-ms-asf", "asr" => "video/x-ms-asf", "asx" => "video/x-ms-asf", "au" => "audio/basic", "avi" => "video/x-msvideo", "axs" => "application/olescript", "bas" => "text/plain", "bcpio" => "application/x-bcpio", "bin" => "application/octet-stream", "bmp" => "image/bmp", "c" => "text/plain", "cat" => "application/vnd.ms-pkiseccat", "cdf" => "application/x-cdf", "cer" => "application/x-x509-ca-cert", "class" => "application/octet-stream", "clp" => "application/x-msclip", "cmx" => "image/x-cmx", "cod" => "image/cis-cod", "cpio" => "application/x-cpio", "crd" => "application/x-mscardfile", "crl" => "application/pkix-crl", "crt" => "application/x-x509-ca-cert", "csh" => "application/x-csh", "css" => "text/css", "dcr" => "application/x-director", "der" => "application/x-x509-ca-cert", "dir" => "application/x-director", "dll" => "application/x-msdownload", "dms" => "application/octet-stream", "doc" => "application/msword", "dot" => "application/msword", "dvi" => "application/x-dvi", "dxr" => "application/x-director", "eps" => "application/postscript", "etx" => "text/x-setext", "evy" => "application/envoy", "exe" => "application/octet-stream", "fif" => "application/fractals", "flr" => "x-world/x-vrml", "gif" => "image/gif", "gtar" => "application/x-gtar", "gz" => "application/x-gzip", "h" => "text/plain", "hdf" => "application/x-hdf", "hlp" => "application/winhlp", "hqx" => "application/mac-binhex40", "hta" => "application/hta", "htc" => "text/x-component", "htm" => "text/html", "html" => "text/html", "htt" => "text/webviewhtml", "ico" => "image/x-icon", "ief" => "image/ief", "iii" => "application/x-iphone", "ins" => "application/x-internet-signup", "isp" => "application/x-internet-signup", "jfif" => "image/pipeg", "jpe" => "image/jpeg", "jpeg" => "image/jpeg", "jpg" => "image/jpeg", "js" => "application/x-javascript", "latex" => "application/x-latex", "lha" => "application/octet-stream", "lsf" => "video/x-la-asf", "lsx" => "video/x-la-asf", "lzh" => "application/octet-stream", "m13" => "application/x-msmediaview", "m14" => "application/x-msmediaview", "m3u" => "audio/x-mpegurl", "man" => "application/x-troff-man", "mdb" => "application/x-msaccess", "me" => "application/x-troff-me", "mht" => "message/rfc822", "mhtml" => "message/rfc822", "mid" => "audio/mid", "mny" => "application/x-msmoney", "mov" => "video/quicktime", "movie" => "video/x-sgi-movie", "mp2" => "video/mpeg", "mp3" => "audio/mpeg", "mpa" => "video/mpeg", "mpe" => "video/mpeg", "mpeg" => "video/mpeg", "mpg" => "video/mpeg", "mpp" => "application/vnd.ms-project", "mpv2" => "video/mpeg", "ms" => "application/x-troff-ms", "mvb" => "application/x-msmediaview", "nws" => "message/rfc822", "oda" => "application/oda", "p10" => "application/pkcs10", "p12" => "application/x-pkcs12", "p7b" => "application/x-pkcs7-certificates", "p7c" => "application/x-pkcs7-mime", "p7m" => "application/x-pkcs7-mime", "p7r" => "application/x-pkcs7-certreqresp", "p7s" => "application/x-pkcs7-signature", "pbm" => "image/x-portable-bitmap", "pdf" => "application/pdf", "pfx" => "application/x-pkcs12", "pgm" => "image/x-portable-graymap", "pko" => "application/ynd.ms-pkipko", "pma" => "application/x-perfmon", "pmc" => "application/x-perfmon", "pml" => "application/x-perfmon", "pmr" => "application/x-perfmon", "pmw" => "application/x-perfmon", "pnm" => "image/x-portable-anymap");
    	if($ret == null) {
    		$ret = "application/x-unknown-content-type";
    	} else {
    		$ret = $res[$type];
    	}
    	return $ret;
    }

    Не знаю смешно ли это или нет, но разобраться в одной километровой строке будет ооочень интересно))))
    Я вас огорчу, пришлось урезать на несколько тысяч символов эту дистанцию))

    nethak, 11 Февраля 2011

    Комментарии (8)
  9. PHP / Говнокод #5634

    +157

    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
    function getAvailablePrivileges(Workset_Model_Object_Interface $resource, $where = null, $order = null, $limit = null, $offset = null, $offsetByPage = false) {
    
            if (true == $offsetByPage) {
                $offset = $this->getPageOffset($limit, $offset);
            }
    
    	$table = $this->_getTable();
    	$select = $table->prepareSelect($where, $order, $limit, $offset);
    
            $iselect = $this->_getTable()->select();
    
            $iselect->from(
                array('m' => $this->_getTable()->info(Zend_Db_Table_Abstract::NAME)),
                array('id')
            )
           ->join(
                array('i' => $this->_getTable($this->_linkedObjectTableClass)->info(Zend_Db_Table_Abstract::NAME)),
                "i.privilege_id = m.id",
                array()
            )
            ->where(
                'i.resource_id = ?', $resource->getId()
            );
    
            $select->where("id not in(?)", new Zend_Db_Expr($iselect->assemble()));
    
            $rowset = $table->fetchAll($select);
    
            return $this->getIterator($rowset, array(
                'countRows' => $this->_countAllRecords,
                'filter' => $select
            ));
    
        }

    Из проекта на Zend

    govnomes, 11 Февраля 2011

    Комментарии (8)
  10. PHP / Говнокод #5630

    +157

    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
    if($amount > 0) :
    	if (is_dir($directory)) {
    		if ($open_dir = opendir($directory)) {
    			$a = 0; $b = 0;
    			while (false !== ($file = readdir($open_dir))) {
    				if ($file != "." && $file != ".." && !is_dir($directory."/".$file)) {
    					$a++;
    					if($a > $min) {
    						$b++;
    						echo "<tr id=\"am-list-input\" valign=\"center\" height: 20px;><td align=\"left\" width=\"10%\">";
    						echo " <a href=\"index.php?am=mod[uploader]&delete=$file\"><img src=\"../images/mini_icons/del.png\" /></a> ";
    						if(in_array(strtolower(getExtension($file)), $gud_types)) echo "<span OnClick=\"CaricaFoto('".$directory."/".$file."')\" OnMouseOver=\"Tip('<img style="max-width: 400px" src="".$directory."/".$file."" >')\"><img style=\"cursor: help\" src=\"../images/mini_icons/display.png\" /></span>";
    						if(in_array(strtolower(getExtension($file)), explode(',', strtolower("mp3,wma,waw,amr,ape,bin,flac,m4a,mdi,ram")))) echo "<img src=\"modules/mod[uploader]/assets/type/sound.png\" />";
    						if(in_array(strtolower(getExtension($file)), explode(',', strtolower("3gp,avi,dat,flv,ifo,m4v,mkv,mov,mp4,rm,vob,wmv")))) echo "<img src=\"modules/mod[uploader]/assets/type/video.png\" />";
    						if(!in_array(strtolower(getExtension($file)), explode(',', strtolower("3gp,avi,dat,flv,ifo,m4v,mkv,mov,mp4,rm,vob,wmv,mp3,wma,waw,amr,ape,bin,flac,m4a,mdi,ram,jpg,jpeg,png,gif")))) echo "<img src=\"modules/mod[uploader]/assets/type/all.png\" />";
    						echo "</td><td width=\"70%\"><span style=\"display: block; cursor: pointer; color: #446eb8; font-weight: bold; line-height: 16px;\" onClick=\"document.getElementById('onclick').value='".str_replace("..", $conf_global["base_url"], $directory)."/".$file."'\" />".substr($file, 0, 100)."</span></td><td width=\"20%\">".formatsize(filesize($directory.DS.$file))."</td></tr>";
    						if($b == $max) : break; endif;
    					}
    				}
    			}
    		closedir($open_dir);
    		}
    	}
    endif;

    Грех не посмеятся над своими старыми проектами =)))

    nethak, 11 Февраля 2011

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