1. Лучший говнокод

    В номинации:
    За время:
  2. PHP / Говнокод #9468

    +176

    1. 1
    2. 2
    3. 3
    public function setPIDorSEORedirect($id, $disableVarName = '') {
            ........
    }

    отличное название метода)))

    aleksssmix, 17 Февраля 2012

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

    +158

    1. 1
    2. 2
    3. 3
    public function setExludeSection($string) {
            $this->setExcludeSection($string);
    }

    исправление опечаток)))

    aleksssmix, 17 Февраля 2012

    Комментарии (6)
  4. Куча / Говнокод #9463

    +124

    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
    scheme (i1 i2 i3 i4 i5 i6 i7) major7 (out):
    Local l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17 l18 l19 l20 l21 l22 l23 l24 l25 l26 l27 l28 l29 l30 l31 l32 l33 l34
    (i1 i2 i3 i4) alo (l1)
    (i1 i2 i3 i5) alo (l2)
    (i1 i2 i3 i6) alo (l3)
    (i1 i2 i3 i7) alo (l4)
    (i1 i2 i4 i5) alo (l5)
    (i1 i2 i4 i6) alo (l6)
    (i1 i2 i4 i7) alo (l7)
    (i1 i2 i5 i6) alo (l8)
    (i1 i2 i5 i7) alo (l9)
    (i1 i2 i6 i7) alo (l10)
    (i1 i3 i4 i5) alo (l11)
    (i1 i3 i4 i6) alo (l12)
    (i1 i3 i4 i7) alo (l13)
    (i1 i3 i5 i6) alo (l14)
    (i1 i3 i5 i7) alo (l15)
    (i1 i3 i6 i7) alo (l16)
    (i1 i4 i5 i6) alo (l17)
    (i1 i4 i5 i7) alo (l18)
    (i1 i4 i6 i7) alo (l19)
    (i2 i3 i4 i5) alo (l20)
    (i2 i3 i4 i6) alo (l21)
    (i2 i3 i4 i7) alo (l22)
    (i2 i3 i5 i6) alo (l23)
    (i2 i3 i5 i7) alo (l24)
    (i2 i3 i6 i7) alo (l25)
    (i2 i4 i5 i6) alo (l26)
    (i2 i4 i5 i7) alo (l27)
    (i2 i4 i6 i7) alo (l28)
    (i2 i5 i6 i7) alo (l29)
    (i3 i4 i5 i6) alo (l30)
    (i3 i4 i5 i7) alo (l31)
    (i3 i4 i6 i7) alo (l32)
    (i3 i5 i6 i7) alo (l33)
    (i4 i5 i6 i7) alo (l34)
    (l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17 l18 l19 l20 l21 l22 l23 l24 l25 l26 l27 l28 l29 l30 l31 l32 l33 l34) and34 (out)
    end
    
    scheme (i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34) and34 (out):
    local l1 l2 l3 l4 l5 l6 l7 l8 l9 l10 l11 l12 l13 l14 l15 l16 l17 l18 l19 l20 l21 l22 l23 l24 l25 l26 l27 l28 l29 l30 l31 l32 l33
    (i1 i2) and (l1)
    (l1 i3) and (l2)
    (l2 i4) and (l3)
    (l3 i5) and (l4)
    (l4 i6) and (l5)
    (l5 i7) and (l6)
    (l6 i8) and (l7)
    (l7 i9) and (l8)
    (l8 i10) and (l9)
    (l9 i11) and (l10)
    (l10 i12) and (l11)
    (l11 i12) and (l12)
    (l12 i13) and (l13)
    (l13 i14) and (l14)
    (l14 i15) and (l15)
    (l15 i16) and (l16)
    (l16 i17) and (l17)
    (l17 i18) and (l18)
    (l18 i19) and (l19)
    (l19 i20) and (l20)
    (l20 i21) and (l21)
    (l21 i22) and (l22)
    (l22 i23) and (l23)
    (l23 i24) and (l24)
    (l24 i25) and (l25)
    (l25 i26) and (l26)
    (l26 i27) and (l27)
    (l27 i28) and (l28)
    (l28 i29) and (l29)
    (l29 i30) and (l30)
    (l30 i31) and (l31)
    (l31 i32) and (l32)
    (l32 i33) and (l33)
    (l33 i34) and (out)
    end
    
    scheme (i1 i2 i3 i4) alo (out):
    local l1 l2 l3
    (i1 i2) or (l1)
    (l1 i3) or (l2)
    (l2 i3) or (l3)
    (l3 i4) or (out)
    end

    Восьмибитное "большинство"? НУ ЭТО ЖЕ ОЧЕВИДНО КОКОКОКО

    lolwwut, 17 Февраля 2012

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

    +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
    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 ***_helper_form_alter(&$form, &$form_state, $form_id) {
      if(substr($form_id, -9) == 'node_form') {   //  Make sure this stuff only happens for node edit forms.
      	// make helpful menus items available for editors on season types
      	if(isset($form['#node']->type) && $form['#node']->type == 'season') {
        	$form['field_menu_items'][0]['#description'] = 'Cut and paste the text in the blue box below into field above for menu items.<br />
        	(You must have created and submitted the season first, and the links below should look like "/show-name/season-#/link".)<br />
        	Delete items you don\'t wish to appear: The second section of the code is for items below the dotted line.<br />
        	<div style="margin:15px;border:1px solid #0CA2FF;padding:10px;">
        	<li><a href="/'.$form['#node']->path.'/about">About</a></li&#62<br />
        	<li><a href="/'.$form['#node']->path.'/bios">Bios</a></li><br />
        	<li><a href="/'.$form['#node']->path.'/blogs">Blogs</a></li&#62<br />
        	<li><a href="/'.$form['#node']->path.'/episodes">Episodes</a></li><br />
        	<li><a href="/'.$form['#node']->path.'/games">Games</a></li&#62<br />
        	<li><a href="/'.$form['#node']->path.'/photos">Photos</a></li><br />
        	<li><a href="/'.$form['#node']->path.'/videos">Videos</a></li&#62<br /><br />
        	<!-- Use code below for additional menu items: --><br /><br />
        	</ul><ul class="season-extras"><br />
        	<li><a href="http://games.***.com/">Full URL needed if not on www.***.com</a></li&#62<br />
        	<li><a href="/top-chef/diet-dr-pepper-challenge">Dr. Pepper Challenge</a></li&#62<br />
        	<li><a href="/foodies/recipe-finder">Recipe Finder</a></li&#62<br /><br />
        	<!-- Use code below for the "flyout" navigation: --><br /><br />
        	<li><a href="/tweettracker">Talk</a><br />
              <ul> <br />
                <div class="separator" style="float: left;"><br />
                    <li><a href="/tweettracker">Tweet Tracker</a></li&#62<br />
                    <li><a href="/tweetbattle">Tweet Battles</a></li&#62<br />
                    <li><a href="/iwanttobeahousewife">Just Saying</a></li&#62<br />
                </div><br />
              </ul><br />
          </li><br />
    
        	</div>';
    
      	  }

    Вот такой вот "код" попался на глаза в новом проекте

    Phabyd, 13 Февраля 2012

    Комментарии (6)
  6. Куча / Говнокод #9401

    +80

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    return false;
    }
    
    	// создаём объект где перечислены id новых событий
    	// из них генерируем ссылки которые ведут на хуй, блять, как же меня заебал этот модуль...
    
    if ( t.news.length ) {

    bot-minurast, 13 Февраля 2012

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

    +160

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    $rcn = 0;
    					foreach ($cites as $cite)
    					{
    						$rcn++;
    					}
    					if ($rcn == 0)
    					{
    						// we banned or network error!
    						
    					}

    Проверка не пустоты массива. Пpосто лень читать мануал(& Google too)! Главное что работает!

    increazon, 10 Февраля 2012

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

    +159

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <td><?php echo Product::getProductById($product->getProdId())->getProdTitle(); ?></td>
    <td><?php echo Product::getProductById($product->getProdId())->getSku(); ?></td>
    <td><?php echo $product->getQty(); ?></td>
    <td><?php echo Product::getProductById($product->getProdId())->getProdPrice(); ?></td>
    <td><?php echo Product::getProductById($product->getProdId())->getProdPrice() * $product->getQty(); ?></td>

    aluminium1989, 09 Февраля 2012

    Комментарии (6)
  9. ActionScript / Говнокод #9371

    −130

    1. 1
    var DAYS=new Array("янв.","фев.","март","апр.","май","июнь","июль", "авг.","сент.","окт.","нояб.","дек.")

    kyzi007, 09 Февраля 2012

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

    +150

    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
    function select_district_area_city($selctor1,$selector2,$url,$bind_after_selector="", $bind_after_function="",$url2="", $pref=""){
    	$add_url=(empty($pref)?'""':'"&pref='.$pref.'"');
    	$main_page=is_home() && empty($_GET);
    		?>
    	<script type="text/javascript">
    		$(document).ready(function(){
    			$("<?=$selctor1?>").bind("change",new_chenge);
    			new_chenge();
    			//функция для отображения на карте
    			//alert("44444");
    
    
    			function new_chenge(){
    				params=$("<?=$selctor1?>").val();
    				//;
    				<?=($main_page?'showAddress(params);':'');?>
    				if (params.length > 0){
    					params='<?=$url?>='+params+<?=$add_url?>;
    					$("<?=$selector2?>").load(params,"",function(){
    						hidden_area=$("#<?=$pref?>hidden_area").val();
    						if (hidden_area.length > 0){
    							//$("#for_select_area")
    							$("#<?=$pref?>for_select_area [value='"+hidden_area+"']").attr("selected", "selected");
    							//showAddress_7(hidden_area);
    							<?=($main_page?'showAddress_7(hidden_area);':'');?>
    								<?=$pref?>new_chenge2();
    						}
    						if('<?=$bind_after_selector?>'.length > 0 && '<?=$bind_after_function?>'.length > 0){
    							if ($('<?=$bind_after_selector?>').length > 0){
    								$('<?=$bind_after_selector?>').bind(<?=$bind_after_function?>);
    							}
    						}
    					});
    				}
    			}
    			function <?=$pref?>new_chenge2(){
    				//alert("qqqqqq");
    				params2=$('<?=$bind_after_selector?>').val();
    				$("#<?=$pref?>hidden_area").val(params2);
    				//showAddress_7(params2);
    				<?=($main_page?'showAddress_7(params2);':'');?>
    				hidden_sity=$("#<?=$pref?>hidden_sity").val();
    				params2=params2+"&l1="+$("<?=$selctor1?>").val();
    				params2='<?=$url2?>'+"/?ajax_query&l2="+params2+<?=$add_url?>;
    				$(".<?=$pref?>for_select_city_load").load(params2,"",function(){
    
    					hidden_sity=$("#<?=$pref?>hidden_sity").val();
    					if (hidden_sity.length > 0){
    						$("#<?=$pref?>for_select_sity [value='"+hidden_sity+"']").attr("selected", "selected");
    						//showAddress_13(hidden_sity);
    						<?=($main_page?'showAddress_13(hidden_sity);':'');?>
    					}
    					$('#<?=$pref?>for_select_sity').bind("change",function(){
    						$("#<?=$pref?>hidden_sity").val($('#<?=$pref?>for_select_sity').val());
    						//showAddress_13($('#for_select_sity').val());
    						<?=($main_page?'showAddress_13($("#'.$pref.'for_select_sity").val());':'');?>
    					});
    				});
    			}
    			//////////////////////////////////////////////
    
    		});
    	</script>
    	<?
    	}

    кто поймет что этот кот делает тому медаль за отвагу

    randombot, 07 Февраля 2012

    Комментарии (6)
  11. JavaScript / Говнокод #9339

    +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
    jQuery(document).ready(function() {
     var size = $('#slider li div').size();
     var col = 0;
     var rcol = 0;
     var blocks = '';
     $('#slider li div').each(function(){
      if(col==0){blocks = blocks+'<li>';};
      blocks = blocks+'<div class="item">'+$(this).html()+'</div>';
      col = col + 1;
      rcol = rcol + 1;
      if(col==21){blocks = blocks+"</li>";col = 0;};
      if(rcol==size & rcol!=21){blocks = blocks+'</li>';}
     });
     $('#slider li').remove();
     $('#slider').html(blocks);
     jQuery('.slider').jcarousel({
      vertical: false,
      scroll: 1,
      wrap: 'circular'
     });
    });

    Классический jquery

    OJA, 06 Февраля 2012

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