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

    Всего: 3

  2. JavaScript / Говнокод #11496

    +154

    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
    function reNumberAreas(parent)
    {
     for (i=0;i<parent.childNodes.length;i++)
     {
      try
      {
       parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.id = cutNumber(parent.childNodes[0].firstChild.firstChild.firstChild.firstChild.id) + i;
       parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.id = parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.id + "_text";
       parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.src = parent.childNodes[i].firstChild.firstChild.firstChild.firstChild.nextSibling.nextSibling.nextSibling.src.replace(/index=\d+/g,"index=" + i);
      }
      catch (e)
      {
      }
     }
    }

    Форматирование кода сохранено для придания драматичности.

    Areks, 30 Июля 2012

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

    +150.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
    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
    var Scroller = function (scroll_left,scroll_right,visible_part,scroll_part) {
    			this.scroll_right =	jQuery(scroll_left); //scroll to left
    			this.scroll_left =	jQuery(scroll_right); //scroll to right	
    			this.slider = jQuery(scroll_part); //scroll element
    			this.visible_part = jQuery(visible_part);
    			
    			this.width_slider_elements = this.slider.width();
    			this.width_slider_element = this.slider.find('li:eq(0)').width();
    			this.width_visible_part = this.visible_part.width();
    			this.temp_process = true;
    			
    			if(this.width_slider_elements < this.width_visible_part) {temp_process = false;}
    			
    			var self = this;
    			this.scroll_left.click(function()
        			{	
    					if (self.temp_process) {
    						self.temp_process = false;
    						self.slide(true);
    					}
    					return false;
    				});	
    			this.scroll_right.click(function()
    	    		{
    					if (self.temp_process) {
    							self.temp_process = false;
    							self.slide(false);
    					}
    					return false;
    				});
    			 
    			return this;
    		};
    		
    		Scroller.prototype.slide = function (side) {
    					var self = this;
    					var	shift = (self.width_visible_part - self.width_slider_element)/2;
    					var current_shift = Math.abs(self.slider.css('left').replace('px',''));
    				if (side) { //left
    					shift = (current_shift+shift+self.width_visible_part) > self.width_slider_elements ? self.width_slider_elements - current_shift - self.width_visible_part : shift;
    						self.slider.animate({left: '-='+shift+'px'}, 1000, function(){ self.temp_process = true;});
    				} else { //right
    					shift = shift > current_shift ? current_shift : shift;
    					self.slider.animate({left: '+='+shift+'px'}, 1000, function(){ self.temp_process = true;});
    				}	
    				return shift;
    		};

    Areks, 01 Марта 2010

    Комментарии (4)
  4. 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)