1. Поиск говнокода

    Этот поиск практически ничего не может найти! Но вы всё-таки попытайтесь, вдруг повезет.

    Найдено: 65

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

    +160

    1. 1
    2. 2
    if ($_SESSION["spo_filter_history"]=="Y")
    		$_REQUEST["filter_history"] == "Y";

    Bitrix. sale.personal.order.list
    А я еще удивлялся "какого хуя фильтр не работает?"

    TBoolean, 12 Февраля 2014

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

    +153

    1. 1
    2. 2
    3. 3
    <?if($_POST["is_ajax_post"] != "Y"){?>				
    					<input type="hidden" name="is_ajax_post" id="is_ajax_post" value="Y">    			        
    <? }  ?>

    Форма оформления заказа в компоненте sale.order.ajax. Bitrix. Логика.

    TBoolean, 06 Февраля 2014

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

    +165

    1. 1
    2. 2
    3. 3
    4. 4
    if (($pos = strpos($_SERVER["REQUEST_URI"], "?")) !== false)
    {
    	$params = substr($_SERVER["REQUEST_URI"], $pos+1);
    	parse_str($params, $_GET);

    Bitrix, 404.php

    Посоны не слышали про $_SERVER[QUERY_STRING], зато, сука, неймспейсы знают!

    Boolean, 26 Января 2014

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

    +166

    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 CompareDates($date1, $date2)
    {
    	$s_date1 = $this->CharToDateFunction($date1);
    	$s_date2 = $this->CharToDateFunction($date2);
    	$strSql = "
    		SELECT
    			if($s_date1 > $s_date2, 1,
    				if ($s_date1 < $s_date2, -1,
    					if ($s_date1 = $s_date2, 0, 'x')
    			)) as RES
    		";
    	$z = $this->Query($strSql, false, "FILE: ".__FILE__."<br> LINE: ".__LINE__);
    	$zr = $z->Fetch();
    	return $zr["RES"];
    }

    Bitrix. Функция прекрасно живет как минимум с 10 версии по сей день.

    Homess, 26 Ноября 2013

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

    +53

    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
    <?if($arElement["PROPERTIES"]["POSTAV"]["VALUE_ENUM_ID"]==73){?>
    <?if($arElement["PREVIEW_PICTURE"]["HEIGHT"]<105){?><div width="115px" height="105px"><?}?>
    
      <a href="<?=$arElement["DETAIL_PICTURE"]["SRC"]?>" class="preview" onclick="return false;" onmousedown="window.location.href='<?=$arElement["DETAIL_PAGE_URL"]?>';"><img src="<?=$arElement["PREVIEW_PICTURE"]["SRC"]?>"  width="115" border="0px" alt="<?=$arElement["PREVIEW_PICTURE"]["ALT"]?>" title="<?=$arElement["NAME"]?>"/></a></div>
    <?if($arElement["PREVIEW_PICTURE"]["HEIGHT"]<105){?></div><?}?>
    <?}else{?>
        <a href="<?=$arElement["DETAIL_PICTURE"]["SRC"]?>" class="preview" onclick="return false;" onmousedown="window.location.href='<?=$arElement["DETAIL_PAGE_URL"]?>';"><img src="<?=$arElement["PREVIEW_PICTURE"]["SRC"]?>" width="115" height="105" border="0px" alt="<?=$arElement["PREVIEW_PICTURE"]["ALT"]?>" title="<?=$arElement["NAME"]?>"/></a>
    <?}?>
    	<br>&nbsp;
    					<?endif?></td>
                                              </tr>
                                            </table></td>
    									</tr>
    								</table>
    
                                    </div>
    		  </td>
    		<?$cell++;
    		if($cell%$arParams["LINE_ELEMENT_COUNT"] == 0):?>
    	</tr>
    		<?endif?>
    
    		<?endforeach; // foreach($arResult["ITEMS"] as $arElement):?>
    
    		<?if($cell%$arParams["LINE_ELEMENT_COUNT"] != 0):?>
    			<?while(($cell++)%$arParams["LINE_ELEMENT_COUNT"] != 0):?>
    
    			<?endwhile;?>
    			</tr>
    		<?endif?>
    
    </table></div>
     <?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
    	<br />
    	<?
    	$arResult["NAV_STRING"] = str_replace('|&nbsp;<a href="/e-store/rings/diamond.php?bitrix_include_areas=Y&amp;bitrix_show_mode=configure&amp;login=yes&amp;SHOWALL_1=1">Все</a>','',$arResult["NAV_STRING"]);
    	?>
    	<?=$arResult["NAV_STRING"]?>
    <?endif;?>

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

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

    +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
    ##############################################
    # Bitrix: SiteManager                        #
    # Copyright (c) 2002-2006 Bitrix             #
    # http://www.bitrixsoft.com                  #
    # mailto:[email protected]                #
    ##############################################
    
    if (!class_exists("CCaptcha"))
    {
    	class CCaptcha
    	{
    		var $imageWidth = 180;
    		var $imageHeight = 40;
    // ...etc

    Это Битрикс. Опять. bitrix\modules\main\classes\general\capt cha.php
    Определение нативной капчи.
    В строке 8 создатели сего как бы задаются воспросом «А вдруг еще никто не писал до нас капчи?».
    Или перестраховываются — «а вдруг require() уже вызывался? И что такое require_once(), про который все так много говорят?»
    Добротный, защищенный на все сто, класс капчи. Невозможно сломать, уже просто потому, что невозможно понять...

    velosipedistorg, 01 Февраля 2012

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

    +167

    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
    <?foreach($arResult["ITEMS"] as $arItem):?>
    	<p class="news-item" id="<?=$this->GetEditAreaId($arItem['ID']);?>">
    	<?if($arParams["DISPLAY_PICTURE"]!="N" && is_array($arItem["PREVIEW_PICTURE"])):?>
    		<?if(!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])):?>
    			<p class="align-center"><a href="<?=$arItem["DETAIL_PAGE_URL"]?>"><img class="preview_picture" border="0" src="<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>" alt="<?=$arItem["NAME"]?>"  height="252px" width="189px"  title="<?=$arItem["NAME"]?>" style="float:left" /></a></p>
    		<?else:?>
    			<p class="align-center"><img class="preview_picture" border="0" src="<?=$arItem["PREVIEW_PICTURE"]["SRC"]?>" height="252px" width="189px"  alt="<?=$arItem["NAME"]?>" title="<?=$arItem["NAME"]?>" style="float:left" /></p>
    		<?endif;?>
    	<?endif?>
    		<?if($arParams["DISPLAY_DATE"]!="N" && $arItem["DISPLAY_ACTIVE_FROM"]):?>
    			<span class="news-date-time"><?echo $arItem["DISPLAY_ACTIVE_FROM"]?></span>
    		<?endif?>
    		<?if($arParams["DISPLAY_NAME"]!="N" && $arItem["NAME"]):?>
    			<?if(!$arParams["HIDE_LINK_WHEN_NO_DETAIL"] || ($arItem["DETAIL_TEXT"] && $arResult["USER_HAVE_ACCESS"])):?>
    				<a href="<?echo $arItem["DETAIL_PAGE_URL"]?>"><b><?echo $arItem["NAME"]?></b></a><br />
    			<?else:?>
    			<?endif;?>
    		<?endif;?>
    		<?if($arParams["DISPLAY_PREVIEW_TEXT"]!="N" && $arItem["PREVIEW_TEXT"]):?>
    			<?echo $arItem["PREVIEW_TEXT"];?>
    		<?endif;?>
    		<?if($arParams["DISPLAY_PICTURE"]!="N" && is_array($arItem["PREVIEW_PICTURE"])):?>
    		<?endif?>
    		<?foreach($arItem["FIELDS"] as $code=>$value):?>
    			<p class="Parad"><?=GetMessage("IBLOCK_FIELD_".$code)?>:&nbsp;<?=$value;?></p>
    <?endforeach;$a=0;?>
    
    		<?foreach($arItem["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>
    			<?$b=0;?>
    		<?if(is_array($arProperty["DISPLAY_VALUE"])):?>
    	<?else:?>
    		<? if($a==7) { if($b!=1){ ?>
    			<? $a=$a+1;$b=1;} }?>
    			<? if($a==0) { if($b!=1){ $s=$arProperty["DISPLAY_VALUE"];?>  
    					<?if($sity_shop!=$s) 
    					{?>
    						<?=$arProperty["DISPLAY_VALUE"]; 
    						$i=$i+1;
    						$sity_shop = $s;?><br>
    					<?}?>  
    			<? $a=$a+1;$b=1;} }?>
    			<?if($a==2) { if($arItem["PROPERTIES"]["NEW"]["VALUE"]=='Y') {?>
    								<a href=""><img src="/bitrix/templates/parad/img/other/new-salon.png"/></a>
    			<? $a=$a+1;$b=1; }?> </p> <? }?>
    			<?if($a==5) { if($b!=1){ if($arItem["PROPERTIES"]["MASTERCARD"]["VALUE"]=='Y') {?>
    			<? }}$a=$a+1;$b=1; } ?>
    			<?if($a==6) { if($b!=1){ if($arItem["PROPERTIES"]["VISA"]["VALUE"]=='Y') {?>
    							<? }?>
    			<? }$a=$a+1;$b=1; } ?>
    			<?if($a==1) { if($b!=1){ ?>
    						<a href="<?echo $arItem['DETAIL_PAGE_URL'];?>"><?=$arProperty["DISPLAY_VALUE"];?></a>
    			<? $a=$a+1;$b=1;} }?>
    			<?if($a!=2) { if($b!=1){ ?>
    			<? $a=$a+1;$b=1;} }?>
    			<?endif?>
    	<?endforeach;?>
    <?endforeach;?>

    Шаблончик для битрикса, вторая половина доставляет своей магией чисел.

    hdkeeper, 28 Октября 2011

    Комментарии (24)
  9. PHP / Говнокод #7833

    +164

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    ob_start();
    require($_SERVER['DOCUMENT_ROOT'].'/bitrix/header.php');
    CModule::IncludeModule('st1234hole');
     global $USER;
    
    
    ob_end_clean();
    ob_end_clean();
    ob_end_clean();
    ob_end_clean();
    ob_end_clean();

    А php ведь у нас глухой. Дак ещё и битрикс - говно в говне.
    P.s.: росЯма http://hg.rosyama.ru/file/f84a8ef2623a/api/api.php .

    manyrus, 11 Сентября 2011

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

    +159

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    if (strlen($_POST["NEW_PASSWORD"]) <= 0)
    					$arResult["ERROR"][] = GetMessage("STOF_ERROR_REG_FLAG1");
    
    				if (strlen($_POST["NEW_PASSWORD"]) > 0 && strlen($_POST["NEW_PASSWORD_CONFIRM"]) <= 0)
    					$arResult["ERROR"][] = GetMessage("STOF_ERROR_REG_FLAG1");
    
    				if (strlen($_POST["NEW_PASSWORD"]) > 0
    					&& strlen($_POST["NEW_PASSWORD_CONFIRM"]) > 0
    					&& $_POST["NEW_PASSWORD"] != $_POST["NEW_PASSWORD_CONFIRM"])
    					$arResult["ERROR"][] = GetMessage("STOF_ERROR_REG_PASS");

    Взято из Битрикса /bitrix/components/bitrix/sale.order.ajax/component.php

    Потрясающие идентификаторы мессаджей. Ну а то, что прочитать код без слома глаз нельзя отдельная песня.
    В целом там такого внутри много.

    zima, 29 Августа 2011

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

    +165

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    //This is an optimization. We assume than no step can take more than one year.
      if($time_limit > 0)
       $end_time = time() + $time_limit;
      else
       $end_time = time() + 365*24*3600; // One year

    Источник: исходники битрикса, (/bitrix/modules/iblock/classes/general/cml2.php). Код используется при импорте из 1с.

    leonard, 30 Мая 2011

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