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

    Всего: 7

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

    +4

    1. 1
    var options = [<?php echo implode(',', range(App\Service\Service::CONSTANT_MIN, App\Service\Service::CONSTANT_MAX)); ?>];

    Diwms, 11 Августа 2016

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

    +160

    1. 1
    2. 2
    3. 3
    class WPEditableComments{
    
    	function WPEditableComments(){$this->__construct();}

    Нашел в одном из плагинов wp. Чел думает об обратной совместимости ога

    Diwms, 07 Мая 2014

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

    +155

    1. 1
    2. 2
    $(element).width($(element).width());
    $(element).height($(element).height());

    Просто нет слов.

    Diwms, 10 Января 2014

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

    +151

    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
    <?php
    class MainController extends ModuleAdminController {
    	public $defaultAction = 'admin';
    	
    	public function actionCreate() {
    		$this->redirect('admin');
    	}
    	
    	public function actionDelete($id) {
    		$this->redirect('admin');
    	}
    	
    	public function actionView($id) {
    		$this->redirect('admin');
    	}
    }

    Модули в Yii такие коварные :(

    Diwms, 15 Февраля 2013

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

    +55

    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
    <option <? if(isset($_POST['day']) and $_POST['day']=="01") echo "selected";  ?>   value="01">1</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="02") echo "selected";  ?>  value="02">2</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="03") echo "selected";  ?>  value="03">3</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="04") echo "selected";  ?>  value="04">4</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="05") echo "selected";  ?>  value="05">5</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="06") echo "selected";  ?>  value="06">6</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="07") echo "selected";  ?>  value="07">7</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="08") echo "selected";  ?>  value="08">8</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="09") echo "selected";  ?>  value="09">9</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="10") echo "selected";  ?>  value="10">10</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="11") echo "selected";  ?>  value="11">11</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="12") echo "selected";  ?>  value="12">12</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="13") echo "selected";  ?>  value="13">13</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="14") echo "selected";  ?>  value="14">14</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="15") echo "selected";  ?>  value="15">15</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="16") echo "selected";  ?>  value="16">16</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="17") echo "selected";  ?>  value="17">17</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="18") echo "selected";  ?>  value="18">18</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="19") echo "selected";  ?>  value="19">19</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="20") echo "selected";  ?> value="20">20</option>
                  <option  <? if(isset($_POST['day']) and $_POST['day']=="21") echo "selected";  ?> value="21">21</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="22") echo "selected";  ?>  value="22">22</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="23") echo "selected";  ?>  value="23">23</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="24") echo "selected";  ?>  value="24">24</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="25") echo "selected";  ?>  value="25">25</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="26") echo "selected";  ?>  value="26">26</option>
                  <option  <? if(isset($_POST['day']) and $_POST['day']=="27") echo "selected";  ?> value="27">27</option>
                  <option  <? if(isset($_POST['day']) and $_POST['day']=="28") echo "selected";  ?> value="28">28</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="29") echo "selected";  ?>  value="29">29</option>
                  <option <? if(isset($_POST['day']) and $_POST['day']=="30") echo "selected";  ?>  value="30">30</option>
                  <option  <? if(isset($_POST['day']) and $_POST['day']=="31") echo "selected";  ?> value="31">31</option>

    вЫводим дни в селекте )) А как ты выводишь дни в селекте? %)

    Diwms, 13 Сентября 2012

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

    +145

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    //O_o
    echo dirname(__DIR__);
    ?>

    Diwms, 16 Ноября 2011

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

    +174

    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
    function viewCSS() {
      header("Content-type: text/css");
      echo "*, body {\n";
      echo "  margin: 0;\n";
      echo "  padding: 0;\n";
      echo "  position: static;\n";
      echo "  background: transparent;\n";
      echo "  color:#000;\n";
      echo "  font:100% \"Lucida Grande\", Arial, Helvetica, Verdana, sans-serif;\n";
      echo "  line-height:1.2em;\n";
      echo "}\n";
      echo "html, body {\n";
      echo "  height: 100%\n";
      echo "}\n";
      echo "#wrapper {\n";
      echo "  position:relative;\n";
      echo "  min-height:100%;\n";
      echo "  width: 760px;\n";
      echo "  margin: 0 auto -60px;\n";
      echo "  text-align:left;\n";
      echo "  border-left:1px black solid;\n";
      echo "  border-right:1px black solid;\n";
      echo "}\n";
      echo "#header {\n";
      echo "  background: #CCC url('/images/header.jpg') top center no-repeat;\n";
      echo "  margin:0 auto;\n";
      echo "  height:245px;\n";
      echo "  border-bottom:1px black solid;\n";
      echo "  overflow:none;\n";
      echo "  }\n";
      echo "#navigation {\n";
      echo "  width:200px;\n";
      echo "  background:#fff;\n";
      echo "  float:right;\n";
      echo "  border:1px black solid;\n";
      echo "  padding:20px;\n";
      echo "  margin-top:20px;\n";
      echo "  margin-right:20px;\n";
      echo "  margin-left:20px;\n";
      echo "}\n";
      echo "#navigation ul {\n";
      echo "  list-style-type:none;\n";
      echo "}\n";
      echo "  #tags,#recent_comments{\n";
      echo "  float:left;\n";
      echo "  margin-left:20px;\n";
      echo "  text-align:center;\n";
      echo "}\n";
      echo "#recent_comments a{\n";
      echo " border-bottom:1px black dashed;\n";
      echo "}\n";
      echo "#recent_comments p{\n";
      echo "  font-size:80%;\n";
      echo "  line-height:1.4em;\n";
      echo "  margin-bottom:-5px;\n";
      echo "}\n";
      echo "#tags a{\n";
      echo "  text-decoration:none;\n";
      echo "}\n";
      echo "#tags span           { padding:5px; float:left;     }\n";
      echo "#tags span.first a   { color:#000; font-size:2.6em; }\n";
      echo "#tags span.second a  { color:#111; font-size:2.4em; }\n";
      echo "#tags span.third a   { color:#222; font-size:2.2em; }\n";
      echo "#tags span.fourth a  { color:#333; font-size:2em;   }\n";
      echo "#tags span.fifth a   { color:#444; font-size:1.8em; }\n";
      echo "#tags span.sixth a   { color:#555; font-size:1.6em; }\n";
      echo "#tags span.seventh a { color:#666; font-size:1.4em; }\n";
      echo "#tags span.eighth a  { color:#777; font-size:1.2em; }\n";
      echo "#tags span.ninth a   { color:#888; font-size:1em;   }\n";
      echo "#tags span.tenth a   { color:#999; font-size:0.8em; }\n";
      echo "p.post_preview_date {\n";
      echo "  font-style:italic;\n";
      echo "}\n";
      echo "#content {\n";
      echo "  text-align: justify;\n";
      echo "  padding-bottom:130px;\n";
      echo "}\n";
      echo "#footer {\n";
      echo "  position:relative;\n";
      echo "  margin:0 auto;\n";
      echo "  width:760px;\n";
      echo "  height:60px;\n";
      echo "  padding-top:30px;\n";
      echo "  background: #FFF url('/images/footer.jpg') top center no-repeat;\n";
      echo "  font-size:80%;\n";
      echo "  text-align:center;\n";
      echo "  line-height:0.7em;\n";
      echo "  border-top:1px black solid;\n";
      echo "}\n";
      echo "#footer a, #content a {\n";
      echo "  text-decoration:none;\n";
      echo "  color: #222;\n";
      echo "}\n";
      echo "#footer a:visited, #content a:visited {\n";
      echo "  color: #222;\n";
      echo "}\n";
      echo "#footer a:hover, #content a:hover {\n";
      echo "  color: #333;\n";
      echo "}\n";

    Ну как? :)

    Diwms, 31 Октября 2011

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