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

    +149.1

    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
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
    <head>
    <?php 
    	$menu = & JSite::getMenu();
    	$flag = ($menu->getActive() == $menu->getDefault()); 
    	$option = JRequest::getVar('option', null); 
    ?>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
    <link rel="stylesheet" href="templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
    <!--[if lte IE 7]>
    <script language="JavaScript" type="text/javascript" src="?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/DD_belatedPNG.js"></script>
    <script language="JavaScript" type="text/javascript">
    DD_belatedPNG.fix('.icon a, .phone, .menu a, .header '); 
    </script>
    <![endif]-->
    </head>
    
    <body >
    	<div class="wrapper">
    		<div class="header">
    			<ul class="icon">
    				<li class="<?php  if ($flag)  {?>active<?php }?>"><a href="#" class="home"><span></span></a></li>
    				<li><a href="#" class="sitemap"><span></span></a></li>
    				<li><a href="#" class="search"><span></span></a></li>
    			</ul>
    			<h3 class="phone">
    				Тел. 8 (044) 561 66 22
    			</h3>
    			<div class="menu-wrap">
    				<jdoc:include type="modules" name="menu" style="none" />
    			</div>
    			<div class="why">
    				<h1>Преимущества работы с нами</h1>
    				<ul>
    					<li>1) Умеренные цены</li>
    					<li>2) Использование высококлассных материалов</li>
    					<li>3) Кротчайшие сроки выполнение работ</li>
    					<li>4) Лучший спектр услуг в городе</li>
    					<li>5) Гаранатия до 3х лет</li>
    				</ul>
    			</div>
    		</div>
    		<div class="content">
    		<?php  if ($flag)  {?>
    			<div class="scroller">
    				<h3>Наши работы</h3>
    				<div class="scroll">
    					<div class="scroll-visible">
    						<ul>
    							<jdoc:include type="modules" name="slider" style="none" />
    						</ul>
    					</div>
    					<a href="#" class="scroll-right"></a>
    					<a href="#" class="scroll-left"></a>
    				</div>
    			</div>
    			<div class="text-module">
    					<jdoc:include type="modules" name="main-text" style="none" />
    			</div>
    		<?php }else{?>
    			<jdoc:include type="component" />
    		<?php }?>
    		</div>
    		<div class="bottom-modules">
    			<div class="bottom-modules-item item-left"><jdoc:include type="modules" name="user1" style="xhtml" /></div>
    			<div class="bottom-modules-item item-right"><jdoc:include type="modules" name="user3" style="xhtml" /></div>
    			<div class="bottom-modules-item item-center"><jdoc:include type="modules" name="user2" style="xhtml" /></div>
    		</div>
    		<div class="footer-space"></div>
    	</div>
    	<div class="footer">
    		<span class="copyright">
    			© 2009<br />
    			Все права защищены
    		</span>
    		<span class="design"></span>
    	</div>
    </body>
    </html>

    Areks, 19 Февраля 2010

    Комментарии (9)
  2. Си / Говнокод #2637

    +99.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
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    #include <iostream>
    
    int *sfirst_function(void);
    int *isecond_function(void);
    
    int * sfirst_function(void)
    {
    	int ilocal_to_first=11;
    	return &ilocal_to_first; // Возвращаем указатель на переменную, размещенную в стеке
    } 
    
    int *isecond_function(void)
    {
    	int ilocal_to_second=44;
    	return &ilocal_to_second; // ну и тут
    }
    void main()
    {
    	int *pi=sfirst_function();
    	printf("First Function = %d\n",*pi);
    	int *si= isecond_function();
    	printf("Second Function = %d\n",*si);
    }

    Найдено на античате, в топике "помощь с лабораторными"
    В этом конкретном примере, конечно, допустим возврат адреса локальной переменной, а вот в более крупном проекте автор столкнулся бы с нефиговой проблемой =)

    RankoR, 18 Февраля 2010

    Комментарии (25)
  3. C# / Говнокод #2636

    +145.4

    1. 1
    ViewState["Action"] = result.client == "merchantName" ? false : true;

    nettrash, 18 Февраля 2010

    Комментарии (19)
  4. JavaScript / Говнокод #2635

    +159.3

    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
    var res_html = "";
      for (var i = 0; i < title_section.length; i++)
      {
      	if (title_section[i].id == sel) {
        res_html += '<div class="'+prefix+'section_title" onmouseover="section_sel(this,\''+ prefix +'\')" onmouseout="section_unsel(this,\''+ prefix +'\')"' +
    										'onclick="section_choise(this,'+'\''+url+'\'' + ')"' +
    										'id='+'"'+title_section[i].id+'" '	
    										+'style='+'"font-weight: bold"'+'>'+
    										'<span class="'+ prefix +'dashed_anchor">' + title_section[i].name + '</span>&nbsp;';
       // res_html += '(' + number_section[i] + ')';
        res_html += '</div>';
    	}
    	else{
    		res_html += '<div class="'+prefix+'section_title" onmouseover="section_sel(this,\''+ prefix +'\')" onmouseout="section_unsel(this,\''+ prefix +'\')"' +
    										'onclick="section_choise(this,'+'\''+url+'\'' + ')"' +
    										'id='+'"'+title_section[i].id+'" '	
    										+'>'+
    										'<span class="'+ prefix +'dashed_anchor">' + title_section[i].name + '</span>&nbsp;';
       // res_html += '(' + number_section[i] + ')';
        res_html += '</div>';
    	}
    	}
      
      document.getElementById(prefix + "sections").innerHTML += res_html;
      document.getElementById(prefix + "sections").innerHTML += '<a href='+'"?id=all"'+'><div class="'+prefix+'all_sections"><img src="media/img/01/arrow.jpg" alt=""/>' +
            '<span style="color:black">Все разделы</span>&nbsp;</div></a>';
    
      document.getElementById(prefix + "column_sections").style.width = (max_length + 7) + "ex";
    /*  document.getElementById(prefix + "green_sector").style.height = (document.getElementById(prefix + "column_other").offsetHeight - 14) + "px";*/
    }

    Яваскрипт от местного умельца:)

    HollyGeek, 18 Февраля 2010

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

    +167.8

    1. 1
    date_in.date_ >= '".date("Y")."-".date("m")."-".date("d")."'

    кусок SQL запроса...

    Torch13, 18 Февраля 2010

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

    +151.5

    1. 1
    @$go = (string)$_HTTP_REQUEST_VARS['go'];

    Private Detective, 18 Февраля 2010

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

    +160.9

    1. 1
    2. 2
    3. 3
    4. 4
    static function &getdbHandler(){
    		global $DB_tree;
    		return $DB_tree;
    }

    Shop-Script поражает....

    metalalisa, 18 Февраля 2010

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

    +157.6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $('.i18n').each(function() {
    
    	//здесь заменяем для всех i18n на значение поля по умолчанию среди полей его класса
    	$('.' + $(this).attr('id').substr(0, parseInt(($(this).attr('id')).length - <?php echo strlen(c('locale.default')) ?>))).val($('#' + $(this).attr('id').substr(0, parseInt(($(this).attr('id')).length - <?php echo strlen(c('locale.default')) ?>)) + '_<?php echo c('locale.default') ?>').val());
    });

    stereojazz, 18 Февраля 2010

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

    +133.3

    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
    <target name="test-boolean">
    		<condition property="if-true" value="true" else="false">
    			<!-- 
    				Попробуйте попереключайте true / false 
    				и посмотрите на результат - вам однозначно понравится :) 
    			-->
    			<istrue value="false"/>
    		</condition>
    		<antcall target="test-boolean-true"/>
    		<antcall target="test-boolean-false"/>
    	</target>
    	
    	<target name="test-boolean-true" if="if-true">
    		<echo>The condition evaluates to "true"</echo>
    	</target>
    	
    	<target name="test-boolean-false" unless="if-true">
    		<echo>The condition evaluates to "false"</echo>
    	</target>

    Язык - Ant, для тех, кто не в курсе. Я думаю, можно спокойно зачислить в говноязыки.

    wvxvw, 18 Февраля 2010

    Комментарии (5)
  10. JavaScript / Говнокод #2629

    +168.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    var rus = new String("йцукенгшщзфывапролдячсмитьЙЦУКЕНГШЩЗФЫВАПРОЛДЯЧСМИТЬ");
    var eng = new String("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM");
    for (var i in rus) {
    	reg = new RegExp(rus[i], 'g');
    	pass = pass.replace(reg, eng[i]);
    }

    Конвертация русских чаров в английские в соответствии с расположением на клаве. Зачем - не суть важно. Регулярки! Десятки их! Полсотни итераций для простой замены русских букв на английские!

    ixth, 17 Февраля 2010

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