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

    Всего: 1419

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

    +18.4

    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
    function convert_code_tag_for_email($text = "", $lang=false)
    {
    	global $MESS;
    	if (strlen($text)<=0) return;
    	if($lang===false) $lang = LANGUAGE_ID;
    	$text = stripslashes($text);
    	$text = preg_replace("#<#", "&lt;", $text);
    	$text = preg_replace("#>#", "&gt;", $text);
    	$text = preg_replace("#^(.*?)$#", "   \\1", $text);
    	$OLD_MESS = $MESS;
    	$MESS = array();
    	include($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/lang/".$lang."/tools.php");
    	$s1 = "--------------- ".$MESS["MAIN_CODE_S"]." -------------------";
    	$MESS = $OLD_MESS;
    	$s2 = str_repeat("-",strlen($s1));
    	$text = "\n\n>".$s1."\n".$text."\n>".$s2."\n\n";
    	return $text;
    }

    говнобитрикс

    guest, 22 Января 2009

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

    +17

    1. 1
    2. 2
    3. 3
    4. 4
    function stemming_default($sText)
    {
    	return $sText;
    }

    Да! Битрикс лучшая CMS!

    guest, 22 Января 2009

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

    +32.5

    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
    function GetNext($bTextHtmlAuto=true, $use_tilda=true)
    	{
    		$res = parent::GetNext($bTextHtmlAuto, $use_tilda);
    		if($res)
    		{
    			if(strlen($res["IBLOCK_ID"])>0)
    			{
    				$res["LIST_PAGE_URL"] =
    					str_replace("//", "/",
    						str_replace("#LANG#", $res["LANG_DIR"],
    							str_replace("#SITE_DIR#", SITE_DIR,
    								str_replace("#SERVER_NAME#", SITE_SERVER_NAME,
    									str_replace("#IBLOCK_ID#", $res["IBLOCK_ID"], $res["LIST_PAGE_URL"])
    								)
    							)
    						)
    					);
    
    				if(array_key_exists("DETAIL_PAGE_URL", $res))
    					$res["DETAIL_PAGE_URL"] = CIBlock::ReplaceDetailUrl($res["DETAIL_PAGE_URL"], $res, true);
    				if(array_key_exists("SECTION_PAGE_URL", $res))
    					$res["SECTION_PAGE_URL"] = CIBlock::ReplaceDetailUrl($res["SECTION_PAGE_URL"], $res, true);
    			}
    			else
    				$res["LIST_PAGE_URL"] =
    					str_replace("//", "/",
    						str_replace("#LANG#", $res["LANG_DIR"],
    							str_replace("#SITE_DIR#", SITE_DIR,
    								str_replace("#SERVER_NAME#", SITE_SERVER_NAME,
    									str_replace("#IBLOCK_ID#", $res["ID"], $res["LIST_PAGE_URL"])
    								)
    							)
    						)
    					);
    		}
    		return $res;
    	}

    супер пупер битрикс

    guest, 22 Января 2009

    Комментарии (2)
  5. C# / Говнокод #434

    −13

    1. 1
    2. 2
    string emptyString = "";
    int? emptyInt = 0;

    guest, 21 Января 2009

    Комментарии (5)
  6. C# / Говнокод #433

    −13.6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    decimal QuantityOut = TehnoMap.Table["Брутто"].ToDecimal() * productionQuantity / TehnoMap["Норма закладки"].ToDecimal();
    
    				string separator = NumberFormatInfo.InvariantInfo.NumberDecimalSeparator;
    				string quantityString = QuantityOut.ToString(NumberFormatInfo.InvariantInfo);
    				if (quantityString.Contains(separator) && quantityString.IndexOf(separator) + 4 < quantityString.Length)
    				{
    					quantityString = quantityString.Remove(quantityString.IndexOf(separator) + 4);
    					QuantityOut = decimal.Parse(quantityString, NumberFormatInfo.InvariantInfo);
    				}

    Нужно было в дроби оставить первые 3 знака после запятой

    guest, 21 Января 2009

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

    +23.7

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function _validateDelete($d) {
        $valid = true;
        if (!$d["product_id"]) {
          $this->setError(dgettext("Core", "Product not selected."));
          return false;
        }
        if (!$d["product_id"]) {
          $this->setError(dgettext("Core", "Please select a record to delete."));
          $valid = false;
        }
        return $valid;
      }

    Индусокод классический

    guest, 21 Января 2009

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

    +79.2

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    if ($_GET[g] == 1) {$dir="g/irk/files/"; $dir_count="g/irk/banners/"; $city_for_files='Иркутск'; $city_for_files2='Иркутска'; $cityphonecode='3952'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 2) {$dir="g/novosib/files/"; $dir_count="g/novosib/banners/"; $city_for_files='Новосибирск'; $city_for_files2='Новосибирска'; $cityphonecode='383'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 3) {$dir="g/moscow/files/"; $dir_count="g/moscow/banners/"; $city_for_files='Москва'; $city_for_files2='Москвы'; $cityphonecode='495'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 4) {$dir="g/minsk/files/"; $dir_count="g/minsk/banners/"; $city_for_files='Минск'; $city_for_files2='Минска'; $cityphonecode='17'; $countryphonecode='Белорусии - 735';}
    elseif ($_GET[g] == 5) {$dir="g/speterburg/files/"; $dir_count="g/speterburg/banners/"; $city_for_files='Санкт-Петербург'; $city_for_files2='Санкт-Петербурга'; $cityphonecode='812'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 6) {$dir="g/kiev/files/"; $dir_count="g/kiev/banners/"; $city_for_files='Киев'; $city_for_files2='Киева'; $cityphonecode='44'; $countryphonecode='Украины - 380';}
    elseif ($_GET[g] == 7) {$dir="g/kemerovo/files/"; $dir_count="g/kemerovo/banners/"; $city_for_files='Кемерово'; $city_for_files2='Кемерово'; $cityphonecode='3842'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 8) {$dir="g/angarsk/files/"; $dir_count="g/angarsk/banners/"; $city_for_files='Ангарск'; $city_for_files2='Ангарска'; $cityphonecode='3951'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 9) {$dir="g/ijevsk/files/"; $dir_count="g/ijevsk/banners/"; $city_for_files='Ижевск'; $city_for_files2='Ижевска'; $cityphonecode='3412'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 10) {$dir="g/chudovo/files/"; $dir_count="g/chudovo/banners/"; $city_for_files='Чудово'; $city_for_files2='Чудово';}
    elseif ($_GET[g] == 11) {$dir="g/cheremhovo/files/"; $dir_count="g/cheremhovo/banners/"; $city_for_files='Черемхово'; $city_for_files2='Черемхово'; $cityphonecode='39546'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 12) {$dir="g/nnovgorod/files/"; $dir_count="g/nnovgorod/banners/"; $city_for_files='Нижний Новгород'; $city_for_files2='Нижнего Новгорода'; $cityphonecode='8312'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 13) {$dir="g/kaliningrad/files/"; $dir_count="g/kaliningrad/banners/"; $city_for_files='Калининград'; $city_for_files2='Калининграда'; $cityphonecode='4012'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 14) {$dir="g/bratsk/files/"; $dir_count="g/bratsk/banners/"; $city_for_files='Братск'; $city_for_files2='Братска'; $cityphonecode='3953'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 15) {$dir="g/dzerjinsk/files/"; $dir_count="g/dzerjinsk/banners/"; $city_for_files='Дзержинск'; $city_for_files2='Дзержинска'; $cityphonecode='8313'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 16) {$dir="g/serov/files/"; $dir_count="g/serov/banners/"; $city_for_files='Серов'; $city_for_files2='Серова'; $cityphonecode='34315'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 17) {$dir="g/ustilimsk/files/"; $dir_count="g/ustilimsk/banners/"; $city_for_files='Усть-Илимск'; $city_for_files2='Усть-Илимска'; $cityphonecode='39535'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 18) {$dir="g/vladivostok/files/"; $dir_count="g/vladivostok/banners/"; $city_for_files='Владивосток'; $city_for_files2='Владивостока'; $cityphonecode='4232'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 19) {$dir="g/chita/files/"; $dir_count="g/chita/banners/"; $city_for_files='Чита'; $city_for_files2='Читы'; $cityphonecode='3022'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 20) {$dir="g/krasnoiarsk/files/"; $dir_count="g/krasnoiarsk/banners/"; $city_for_files='Красноярск'; $city_for_files2='Красноярска'; $cityphonecode='3912'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 21) {$dir="g/barnaul/files/"; $dir_count="g/barnaul/banners/"; $city_for_files='Барнаул'; $city_for_files2='Барнаула'; $cityphonecode='3852'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 22) {$dir="g/arhangelsk/files/"; $dir_count="g/arhangelsk/banners/"; $city_for_files='Архангельск'; $city_for_files2='Архангельска'; $cityphonecode='8182'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 23) {$dir="g/tomsk/files/"; $dir_count="g/tomsk/banners/"; $city_for_files='Томск'; $city_for_files2='Томска'; $cityphonecode='3822'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 24) {$dir="g/astrahan/files/"; $dir_count="g/astrahan/banners/"; $city_for_files='Астрахань'; $city_for_files2='Астрахани'; $cityphonecode='8512'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 25) {$dir="g/nahodka/files/"; $dir_count="g/nahodka/banners/"; $city_for_files='Находка'; $city_for_files2='Находки'; $cityphonecode='42366'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 26) {$dir="g/cherepovec/files/"; $dir_count="g/cherepovec/banners/"; $city_for_files='Череповец'; $city_for_files2='Череповца'; $cityphonecode='8202'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 27) {$dir="g/belgorod/files/"; $dir_count="g/belgorod/banners/"; $city_for_files='Белгород'; $city_for_files2='Белгорода'; $cityphonecode='4722'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 28) {$dir="g/briansk/files/"; $dir_count="g/briansk/banners/"; $city_for_files='Брянск'; $city_for_files2='Брянска'; $cityphonecode='4832'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 29) {$dir="g/vladimir/files/"; $dir_count="g/vladimir/banners/"; $city_for_files='Владимир'; $city_for_files2='Владимира'; $cityphonecode='4922'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 30) {$dir="g/volgograd/files/"; $dir_count="g/volgograd/banners/"; $city_for_files='Волгоград'; $city_for_files2='Волгограда'; $cityphonecode='8442'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 31) {$dir="g/vologda/files/"; $dir_count="g/vologda/banners/"; $city_for_files='Вологда'; $city_for_files2='Вологды'; $cityphonecode='8172'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 32) {$dir="g/voronej/files/"; $dir_count="g/voronej/banners/"; $city_for_files='Воронеж'; $city_for_files2='Воронежа'; $cityphonecode='4732'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 33) {$dir="g/ivanovo/files/"; $dir_count="g/ivanovo/banners/"; $city_for_files='Иваново'; $city_for_files2='Иваново'; $cityphonecode='4932'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 34) {$dir="g/kaluga/files/"; $dir_count="g/kaluga/banners/"; $city_for_files='Калуга'; $city_for_files2='Калуги'; $cityphonecode='48422'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 35) {$dir="g/kirov/files/"; $dir_count="g/kirov/banners/"; $city_for_files='Киров'; $city_for_files2='Кирова'; $cityphonecode='8332'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 36) {$dir="g/kostroma/files/"; $dir_count="g/kostroma/banners/"; $city_for_files='Кострома'; $city_for_files2='Костромы'; $cityphonecode='4942'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 37) {$dir="g/rostov/files/"; $dir_count="g/rostov/banners/"; $city_for_files='Ростов-на-Дону'; $city_for_files2='Ростова-на-Дону'; $cityphonecode='8632'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 38) {$dir="g/klaipeda/files/"; $dir_count="g/klaipida/banners/"; $city_for_files='Клайпеда'; $city_for_files2='Клайпеды'; $cityphonecode='46'; $countryphonecode='Литвы - 370';}
    elseif ($_GET[g] == 39) {$dir="g/varshava/files/"; $dir_count="g/varshava/banners/"; $city_for_files='Варшава (Warszawa)'; $city_for_files2='Варшавы'; $cityphonecode='22'; $countryphonecode='Польши - 48';}
    elseif ($_GET[g] == 40) {$dir="g/usoliesib/files/"; $dir_count="g/usoliesib/banners/"; $city_for_files='Усолье-Сибирское'; $city_for_files2='Усолья-Сибирского'; $cityphonecode='39543'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 41) {$dir="g/GERMANY/hannover/files/"; $dir_count="g/GERMANY/hannover/banners/"; $city_for_files='Ганновер'; $city_for_files2='Ганновера'; $cityphonecode=''; $countryphonecode='Германии -';}
    elseif ($_GET[g] == 42) {$dir="g/habarovsk/files/"; $dir_count="g/habarovsk/banners/"; $city_for_files='Хабаровск'; $city_for_files2='Хабаровска'; $cityphonecode='4212'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 43) {$dir="g/lipeck/files/"; $dir_count="g/lipeck/banners/"; $city_for_files='Липецк'; $city_for_files2='Липецка'; $cityphonecode='4742'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 44) {$dir="g/yaroslavl/files/"; $dir_count="g/yaroslavl/banners/"; $city_for_files='Ярославль'; $city_for_files2='Ярославля'; $cityphonecode='4852'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 45) {$dir="g/riazan/files/"; $dir_count="g/riazan/banners/"; $city_for_files='Рязань'; $city_for_files2='Рязани'; $cityphonecode='4912'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 46) {$dir="g/ufa/files/"; $dir_count="g/ufa/banners/"; $city_for_files='Уфа'; $city_for_files2='Уфы'; $cityphonecode='347'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 47) {$dir="g/ekaterinburg/files/"; $dir_count="g/ekaterinburg/banners/"; $city_for_files='Екатеринбург'; $city_for_files2='Екатеринбурга'; $cityphonecode='343'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 48) {$dir="g/POLAND/poznan/files/"; $dir_count="g/POLAND/poznan/banners/"; $city_for_files='Познань'; $city_for_files2='Познани'; $cityphonecode='61'; $countryphonecode='Польши - 48';}
    elseif ($_GET[g] == 49) {$dir="g/pereslavlzalesskii/files/"; $dir_count="g/pereslavlzalesskii/banners/"; $city_for_files='Переславль-Залесский'; $city_for_files2='Переславля-Залесского'; $cityphonecode='48535'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 50) {$dir="g/ulanude/files/"; $dir_count="g/ulanude/banners/"; $city_for_files='Улан-Удэ'; $city_for_files2='Улан-Удэ'; $cityphonecode='30122'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 51) {$dir="g/stavropol/files/"; $dir_count="g/stavropol/banners/"; $city_for_files='Ставрополь'; $city_for_files2='Ставрополя'; $cityphonecode='8652'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 52) {$dir="g/velikieluki/files/"; $dir_count="g/velikieluki/banners/"; $city_for_files='Великие Луки'; $city_for_files2='города Великие Луки'; $cityphonecode='81153'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 54) {$dir="g/harkov/files/"; $dir_count="g/harkov/banners/"; $city_for_files='Харьков'; $city_for_files2='Харькова'; $cityphonecode='057'; $countryphonecode='Украины - 380';}
    elseif ($_GET[g] == 55) {$dir="g/tula/files/"; $dir_count="g/tula/banners/"; $city_for_files='Тула'; $city_for_files2='Тулы'; $cityphonecode='4872'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 56) {$dir="g/orel/files/"; $dir_count="g/orel/banners/"; $city_for_files='Орел'; $city_for_files2='Орла'; $cityphonecode='4862'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 57) {$dir="g/gomel/files/"; $dir_count="g/gomel/banners/"; $city_for_files='Гомель'; $city_for_files2='Гомеля'; $cityphonecode='232'; $countryphonecode='Белоруссии - 375';}
    elseif ($_GET[g] == 58) {$dir="g/vorkuta/files/"; $dir_count="g/vorkuta/banners/"; $city_for_files='Воркута'; $city_for_files2='Воркуты'; $cityphonecode='82151'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 59) {$dir="g/dnepropetrovsk/files/"; $dir_count="g/dnepropetrovsk/banners/"; $city_for_files='Днепропетровск'; $city_for_files2='Днепропетровск'; $cityphonecode='056'; $countryphonecode='Украины - 380';}
    elseif ($_GET[g] == 60) {$dir="g/dusseldorf/files/"; $dir_count="g/dusseldorf/banners/"; $city_for_files='Дюссельдорф'; $city_for_files2='Дюссельдорфа'; $cityphonecode='211'; $countryphonecode='Германии - 49';}
    elseif ($_GET[g] == 61) {$dir="g/bonn/files/"; $dir_count="g/bonn/banners/"; $city_for_files='Бонн'; $city_for_files2='Бонна'; $cityphonecode='228'; $countryphonecode='Германии - 49';}
    elseif ($_GET[g] == 62) {$dir="g/gamburg/files/"; $dir_count="g/gamburg/banners/"; $city_for_files='Гамбург'; $city_for_files2='Гамбурга'; $cityphonecode='40'; $countryphonecode='Германии - 49';}
    elseif ($_GET[g] == 63) {$dir="g/zaporozhie/files/"; $dir_count="g/zaporozhie/banners/"; $city_for_files='Запорожье'; $city_for_files2='Запорожья'; $cityphonecode='61'; $countryphonecode='Украины - 380';}
    elseif ($_GET[g] == 64) {$dir="g/voskresensk/files/"; $dir_count="g/voskresensk/banners/"; $city_for_files='Воскресенск'; $city_for_files2='Воскресенска'; $cityphonecode='496'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 65) {$dir="g/nijnitagil/files/"; $dir_count="g/nijnitagil/banners/"; $city_for_files='Нижний Тагил'; $city_for_files2='Нижнего Тагила'; $cityphonecode='3435'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 66) {$dir="g/samara/files/"; $dir_count="g/samara/banners/"; $city_for_files='Самара'; $city_for_files2='Самары'; $cityphonecode='846'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 67) {$dir="g/taganrog/files/"; $dir_count="g/taganrog/banners/"; $city_for_files='Таганрог'; $city_for_files2='Таганрога'; $cityphonecode='8634'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 68) {$dir="g/nurnberg/files/"; $dir_count="g/nurnberg/banners/"; $city_for_files='Нюрнберг'; $city_for_files2='Нюрнберга'; $cityphonecode='911'; $countryphonecode='Германии - 49';}
    elseif ($_GET[g] == 69) {$dir="g/mariuopol/files/"; $dir_count="g/mariuopol/banners/"; $city_for_files='Мариуополь'; $city_for_files2='Мариуополя'; $cityphonecode='629'; $countryphonecode='Украины - 380';}
    elseif ($_GET[g] == 70) {$dir="g/uzhnouralsk/files/"; $dir_count="g/uzhnouralsk/banners/"; $city_for_files='Южноуральск'; $city_for_files2='Южноуральска'; $cityphonecode='35134'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 73) {$dir="g/almati/files/"; $dir_count="g/almati/banners/"; $city_for_files='Алматы'; $city_for_files2='Алматы'; $cityphonecode='3272'; $countryphonecode='Казахстана - 7';}
    elseif ($_GET[g] == 74) {$dir="g/saratov/files/"; $dir_count="g/saratov/banners/"; $city_for_files='Саратов'; $city_for_files2='Саратова'; $cityphonecode='8452'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 75) {$dir="g/kirovgrad/files/"; $dir_count="g/kirovgrad/banners/"; $city_for_files='Кировград'; $city_for_files2='Кировграда'; $cityphonecode='34357'; $countryphonecode='Украины - 380';}
    elseif ($_GET[g] == 76) {$dir="g/orenburg/files/"; $dir_count="g/orenburg/banners/"; $city_for_files='Оренбург'; $city_for_files2='Оренбурга'; $cityphonecode='3532'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 77) {$dir="g/ulianovsk/files/"; $dir_count="g/ulianovsk/banners/"; $city_for_files='Ульяновск'; $city_for_files2='Ульяновска'; $cityphonecode='8422'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 78) {$dir="g/stupino/files/"; $dir_count="g/stupino/banners/"; $city_for_files='Ступино'; $city_for_files2='Ступино'; $cityphonecode='264'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 79) {$dir="g/abakan/files/"; $dir_count="g/abakan/banners/"; $city_for_files='Абакан'; $city_for_files2='Абакана'; $cityphonecode='39022'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 80) {$dir="g/ozersk/files/"; $dir_count="g/ozersk/banners/"; $city_for_files='Озерск'; $city_for_files2='Озерска'; $cityphonecode='35130'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 71) {$dir="g/tbilisi/files/"; $dir_count="g/tbilisi/banners/"; $city_for_files='Тбилиси'; $city_for_files2='Тбилиси'; $cityphonecode='32'; $countryphonecode='Грузии - 7';}
    elseif ($_GET[g] == 72) {$dir="g/vilnus/files/"; $dir_count="g/vilnus/banners/"; $city_for_files='Вильнюс'; $city_for_files2='Вильнюса'; $cityphonecode='5'; $countryphonecode='Литвы - 370';}
    elseif ($_GET[g] == 81) {$dir="g/kungur/files/"; $dir_count="g/kungur/banners/"; $city_for_files='Кунгур'; $city_for_files2='Кунгура'; $cityphonecode='34271'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 82) {$dir="g/sochi/files/"; $dir_count="g/sochi/banners/"; $city_for_files='Сочи'; $city_for_files2='Сочи'; $cityphonecode='8622'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 83) {$dir="g/magadan/files/"; $dir_count="g/magadan/banners/"; $city_for_files='Магадан'; $city_for_files2='Магадана'; $cityphonecode='4132'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 84) {$dir="g/gai/files/"; $dir_count="g/gai/banners/"; $city_for_files='Гай'; $city_for_files2='Гай'; $cityphonecode='35362'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 85) {$dir="g/kasimov/files/"; $dir_count="g/kasimov/banners/"; $city_for_files='Касимов'; $city_for_files2='Касимова'; $cityphonecode='49131'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 86) {$dir="g/berdsk/files/"; $dir_count="g/berdsk/banners/"; $city_for_files='Бердск'; $city_for_files2='Бердска'; $cityphonecode='38341'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 87) {$dir="g/armavir/files/"; $dir_count="g/armavir/banners/"; $city_for_files='Армавир'; $city_for_files2='Армавира'; $cityphonecode='86137'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 88) {$dir="g/staroskol/files/"; $dir_count="g/staroskol/banners/"; $city_for_files='Старый Оскол'; $city_for_files2='Старый Оскол'; $cityphonecode='4725'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 89) {$dir="g/salavat/files/"; $dir_count="g/salavat/banners/"; $city_for_files='Салават'; $city_for_files2='Салавата'; $cityphonecode='34763'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 90) {$dir="g/mendeleevsk/files/"; $dir_count="g/mendeleevsk/banners/"; $city_for_files='Менделеевск'; $city_for_files2='Менделеевска'; $cityphonecode='85549'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 91) {$dir="g/omsk/files/"; $dir_count="g/omsk/banners/"; $city_for_files='Омск'; $city_for_files2='Омска'; $cityphonecode='3812'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 92) {$dir="g/velikii novgorod/files/"; $dir_count="g/velikii novgorod/banners/"; $city_for_files='Великий Новгород'; $city_for_files2='Великого Новгорода'; $cityphonecode='8162'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 93) {$dir="g/astana/files/"; $dir_count="g/astana/banners/"; $city_for_files='Астана'; $city_for_files2='Астаны'; $cityphonecode='3172'; $countryphonecode='Казахстана - 7';}
    elseif ($_GET[g] == 94) {$dir="g/yakutsk/files/"; $dir_count="g/yakutsk/banners/"; $city_for_files='Якутск'; $city_for_files2='Якутска'; $cityphonecode='4112'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 95) {$dir="g/kazan/files/"; $dir_count="g/kazan/banners/"; $city_for_files='Казань'; $city_for_files2='Казани'; $cityphonecode='843'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 96) {$dir="g/iokshar/files/"; $dir_count="g/iokshar/banners/"; $city_for_files='Йошкар-Ола'; $city_for_files2='Йошкар-Ола'; $cityphonecode='8362'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 97) {$dir="g/bogota/files/"; $dir_count="g/bogota/banners/"; $city_for_files='Богота'; $city_for_files2='Богота'; $cityphonecode='1'; $countryphonecode='Колумбии - 57';}
    elseif ($_GET[g] == 98) {$dir="g/zlatoust/files/"; $dir_count="g/zlatoust/banners/"; $city_for_files='Златоуст'; $city_for_files2='Златоуста'; $cityphonecode='1'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 99) {$dir="g/kishtim/files/"; $dir_count="g/kishtim/banners/"; $city_for_files='Кыштым'; $city_for_files2='Кыштыма'; $cityphonecode='35151'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 100) {$dir="g/perm/files/"; $dir_count="g/perm/banners/"; $city_for_files='Пермь'; $city_for_files2='Перми'; $cityphonecode='342'; $countryphonecode='России - 7';}
    elseif ($_GET[g] == 101) {$dir="g/chelyabinsk/files/"; $dir_count="g/chelyabinsk/banners/"; $city_for_files='Челябинск'; $city_for_files2='Челябинска'; $cityphonecode='342'; $countryphonecode='России - 7';}

    это надо прочувствовать, поэтому вставляю полностью

    guest, 21 Января 2009

    Комментарии (19)
  9. Java / Говнокод #430

    −50

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    String[] search_array;
    int index = -1;
    for (int y = 0; y < search_array.length; y++) {
        if (search_array[y].equals("SEARCH_PATTERN") {
            index = y;
            y = 100;
        }
    }

    guest, 20 Января 2009

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

    +18.7

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    $path = "a/b/c/d";
    $sections = array_reverse (explode ("/", $path));
    $sql = "SELECT `t1`.`id` FROM ";
    for ($i = 1; $i <= count ($sections); $i ++)
      $from_tables[] = "`test` `t".$i."`";
    $sql = $sql.implode (", ", $from_tables);
    $sql .= " WHERE ";
    for ($i = 1; $i < count ($sections); $i ++)
      $sql .= "`t".$i."`.`parent_id` = `t".($i+1)."`.`id` AND `t".$i."`.`name` = '".$sections[$i-1]."' AND";
    $sql .= " `t".count ($sections)."`.`parent_id` = '0' AND `t".count ($sections)."`.`name` = '".$sections[count($sections)-1]."'";
    echo $sql;

    guest, 20 Января 2009

    Комментарии (1)
  11. PHP / Говнокод #428

    +22

    1. 1
    2. 2
    3. 3
    set_include_path('.'.PATH_SEPARATOR . './library'
        .PATH_SEPARATOR.'./application/models/'
        .PATH_SEPARATOR.get_include_path());

    "Так и не смог я в тот вечер понять..." что имел в виду автор. Он, видимо, и сам не понял, поэтому сунул библиотеки зенда в несколько папок...

    guest, 20 Января 2009

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