1. SQL / Говнокод #1583

    −166.2

    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
    SELECT DISTINCT B.TYPE_SID, B.ID BANNER_ID, B.WEIGHT BANNER_WEIGHT,
    B.SHOWS_FOR_VISITOR, B.FIX_CLICK, B.FIX_SHOW, B.KEYWORDS BANNER_KEYWORDS,
    C.ID CONTRACT_ID, C.WEIGHT CONTRACT_WEIGHT, C.KEYWORDS CONTRACT_KEYWORDS
    FROM b_adv_type T
    INNER JOIN b_adv_banner B ON ( B.ACTIVE='Y' and B.TYPE_SID = T.SID
    and B.STATUS_SID = 'PUBLISHED'
    and (B.FOR_NEW_GUEST is null or B.FOR_NEW_GUEST='N')
    and (ifnull(B.MAX_SHOW_COUNT,0)>ifnull(B.SHOW_COUNT,0)
    or ifnull(B.MAX_SHOW_COUNT,0)=0) and (ifnull(B.MAX_CLICK_COUNT,0)>ifnull(B.CLICK_COUNT,0)
    or ifnull(B.MAX_CLICK_COUNT,0)=0) and (ifnull(B.MAX_VISITOR_COUNT,0)>ifnull(B.VISITOR_COUNT,0)
    or ifnull(B.MAX_VISITOR_COUNT,0)=0) and (B.DATE_SHOW_FROM<=now() or B.DATE_SHOW_
    FROM is null or length(B.DATE_SHOW_FROM)<=0) and (B.DATE_SHOW_TO>=now()
    or B.DATE_SHOW_TO is null or length(B.DATE_SHOW_TO)<=0))
    INNER JOIN b_adv_banner_2_site BS ON ( BS.BANNER_ID = B.ID and BS.SITE_ID = 'ru')
    INNER JOIN b_adv_contract C ON ( C.ID = B.CONTRACT_ID and C.ACTIVE='Y'
    and (ifnull(C.MAX_SHOW_COUNT,0)>ifnull(C.SHOW_COUNT,0)
    or ifnull(C.MAX_SHOW_COUNT,0)=0) and (ifnull(C.MAX_CLICK_COUNT,0)>ifnull(C.CLICK_COUNT,0)
    or ifnull(C.MAX_CLICK_COUNT,0)=0)  and (ifnull(C.MAX_VISITOR_COUNT,0)>ifnull(C.VISITOR_COUNT,0)
    or ifnull(C.MAX_VISITOR_COUNT,0)=0) and (C.DATE_SHOW_FROM<=now() or C.DATE_SHOW_
    FROM is null or length(C.DATE_SHOW_FROM)<=0) and (C.DATE_SHOW_TO>=now() or C.DATE_SHOW_TO is null
    or length(C.DATE_SHOW_TO)<=0))
    INNER JOIN b_adv_contract_2_site CS ON ( CS.CONTRACT_ID = B.CONTRACT_ID and CS.SITE_ID = 'ru')
    INNER JOIN b_adv_contract_2_type CT ON ( CT.CONTRACT_ID = C.ID
    and (CT.TYPE_SID = 'ALL' or CT.TYPE_SID = T.SID))
    INNER JOIN b_adv_banner_2_weekday BW ON ( BW.BANNER_ID = B.ID
    and BW.C_WEEKDAY='SUNDAY' and BW.C_HOUR = '11')
    INNER JOIN b_adv_contract_2_weekday CW ON ( CW.CONTRACT_ID = C.ID
    and CW.C_WEEKDAY='SUNDAY' and CW.C_HOUR = '11')
    LEFT JOIN b_adv_banner_2_group UG1 ON ( (UG1.BANNER_ID = B.ID and UG1.GROUP_ID in (2,1,21)) )
    LEFT JOIN b_adv_banner_2_page BP1 ON ( BP1.BANNER_ID = B.ID and BP1.SHOW_ON_PAGE='Y')
    LEFT JOIN b_adv_banner_2_page BP2 ON ( BP2.BANNER_ID = B.ID and BP2.SHOW_ON_PAGE='N'
    and '/e-store/books/index.php?SECTION_ID=145' like concat(BP2.PAGE, '%'))
    LEFT JOIN b_adv_contract_2_page CP1 ON ( CP1.CONTRACT_ID = C.ID and CP1.SHOW_ON_PAGE='Y')
    LEFT JOIN b_adv_contract_2_page CP2 ON ( CP2.CONTRACT_ID = C.ID and CP2.SHOW_ON_PAGE='N'
    and '/e-store/books/index.php?SECTION_ID=145' like concat(CP2.PAGE, '%'))
    LEFT JOIN b_adv_banner_2_stat_adv BA ON BA.BANNER_ID = B.ID
    LEFT JOIN b_adv_banner_2_country BC ON BC.BANNER_ID = B.ID WHERE T.ACTIVE = 'Y'
    and BP2.ID is null and CP2.ID is null
    and (BP1.ID is null or '/e-store/books/index.php?SECTION_ID=145' like concat(BP1.PAGE, '%'))
    and (CP1.ID is null or '/e-store/books/index.php?SECTION_ID=145' like concat(CP1.PAGE, '%'))
    and (BA.STAT_ADV_ID is null or BA.STAT_ADV_ID='0')
    and (BC.COUNTRY_ID is null or BC.COUNTRY_ID='N0')
    and ( (B.SHOW_USER_GROUP = 'Y' and UG1.GROUP_ID is not null)
    or (B.SHOW_USER_GROUP <> 'Y' and UG1.GROUP_ID is null))
    ORDER BY B.TYPE_SID desc, C.ID desc

    SQL-запрос из Битрикса

    http://ekimoff.ru/165/

    endo, 14 Августа 2009

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

    +155.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
    function clean(str, pat){
        var m = len(pat);
        var l="", r = "";
        var t = 0;
        while(str.indexOf(pat)!=-1){
            t = str.indexOf(pat);
            l = str.slice(0, t);
            r = str.slice(t+m);
            str = l+r;
        }
        return str;
    }

    la1, 14 Августа 2009

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

    +156

    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
    <?
    $i=$var = null;
    
    function NullPointerShare(&$vv)
    {
    
    for (;;)
    {
        $i=$vv;
    $i++;
    
    
        if ($i==20)
        {
            $i=null;
                die (NullPointerShare($i));
    
        }else if ($i<20){
    $ix=19;
     die (NullPointerShare($ix));
    	}
    }
    return $vv;
    
    }
    
    die ("--> ".NullPointerShare($var));
    ?>

    Без коментов:)

    notrade, 14 Августа 2009

    Комментарии (2)
  4. C++ / Говнокод #1580

    +20.7

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    .....
    int i;
    .....
    int b=i/2;
    if(i==b*2)//проверка на четность
    {
    .....

    schaos, 14 Августа 2009

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

    +157

    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
    <?php
    // AI для jabber-бота http://coolbot.vndv.com
    // Автор AI: Black.ZerO
    $db = mysql_connect($dbhost, $dbuser, $dbpasswd) or die("MySQL error");
    	mysql_select_db($dbname, $db);
     
    	$result = mysql_query("select * from mozg", $db);
    	$myrow = mysql_fetch_array($result);
     
     
    	$messages['body'] = "Hello";
    	do 
    	{
    	if ($messages['body'] == $myrow[question])
    	{
    		echo "OK";
    		break;
    		}
    			else {
    				echo "false";
    		}
     
    	}
    	while ($myrow = mysql_fetch_array($result));

    AI для jabber-бота http://coolbot.vndv.com

    sviver88, 13 Августа 2009

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

    +155

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $cnt_ = count($array_objects['rate']);
    
    for($i=0; $i<$cnt_; $i++) {
      //...
    }
    
    $DB->query('REPAIR TABLE `' . $rates_table . '` QUICK;');

    Кусок скрипта для импорта данных из XML...

    Eisenhorn, 13 Августа 2009

    Комментарии (11)
  7. C++ / Говнокод #1577

    +3.3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    class boolshit{
    public:
    boolshit(bool shit):_shit(shit){}
    operator bool() const{return _shit;}
    private:
    bool _shit;
    };

    :)

    Ror77, 13 Августа 2009

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

    +152

    1. 1
    2. 2
    3. 3
    // phpBB 3.0.x auto-generated configuration file
    // Do not change anything in this file!
    include_once dirname(dirname (dirname (__FILE__)))."/conf/config.php";

    Мегакод

    meniam, 13 Августа 2009

    Комментарии (13)
  9. VisualBasic / Говнокод #1575

    −114

    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
    Module MyChrModule
        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
        '49 to 57 Chr , 32 space
        Public Function Mychr(ByVal ChrNumber As Long) As String
            If ChrNumber = 1 Then Mychr = "[LMB]"
            If ChrNumber = 2 Then Mychr = "[RMB]"
            If ChrNumber = 4 Then Mychr = "[MMB]" ' MouseMiddleButton ( Scroll button )
            If ChrNumber = 9 Then Mychr = "[Tab]"
            If ChrNumber = 20 Then Mychr = "[CapsLock]"
            If ChrNumber = 160 Then Mychr = "[LeftShift]"
            If ChrNumber = 162 Then Mychr = "[LeftCtrl]"
            If ChrNumber = 192 Then Mychr = "`"
            If ChrNumber = 112 Then Mychr = "[F1]" '112 to 123
            If ChrNumber = 113 Then Mychr = "[F2]"
            If ChrNumber = 114 Then Mychr = "[F3]"
            If ChrNumber = 115 Then Mychr = "[F4]"
            If ChrNumber = 116 Then Mychr = "[F5]"
            If ChrNumber = 117 Then Mychr = "[F6]"
            If ChrNumber = 118 Then Mychr = "[F7]"
            If ChrNumber = 119 Then Mychr = "[F8]"
            If ChrNumber = 120 Then Mychr = "[F9]"
            If ChrNumber = 121 Then Mychr = "[F10]"
            If ChrNumber = 122 Then Mychr = "[F11]"
            If ChrNumber = 123 Then Mychr = "[F12]"
            If ChrNumber = 189 Then Mychr = "-"
            If ChrNumber = 187 Then Mychr = "="
            If ChrNumber = 220 Then Mychr = "\"
            If ChrNumber = 219 Then Mychr = "["
            If ChrNumber = 221 Then Mychr = "]"
            If ChrNumber = 186 Then Mychr = ";"
            If ChrNumber = 220 Then Mychr = "\"
            If ChrNumber = 222 Then Mychr = "'"
            If ChrNumber = 188 Then Mychr = ","
            If ChrNumber = 190 Then Mychr = "."
            If ChrNumber = 191 Then Mychr = "/"
            If ChrNumber = 8 Then Mychr = "[BckSpc]"
            If ChrNumber = 123 Then Mychr = "[F12]"
            If ChrNumber = 13 Then Mychr = "[Enter]"
            If ChrNumber = 161 Then Mychr = "[RightShift]"
            If ChrNumber = 91 Then Mychr = "[LeftLogo]"
            If ChrNumber = 92 Then Mychr = "[RightLogo]"
            If ChrNumber = 93 Then Mychr = "[RMB Key]"
            If ChrNumber = 163 Then Mychr = "[RightCtrl]"
            If ChrNumber = 164 Then Mychr = "[LeftAlt]"
            If ChrNumber = 165 Then Mychr = "[RightAlt]"
            If ChrNumber = 44 Then Mychr = "[Print]"
            If ChrNumber = 19 Then Mychr = "[Pause]"
            If ChrNumber = 45 Then Mychr = "[Insert]"
            If ChrNumber = 36 Then Mychr = "[Home]"
            If ChrNumber = 33 Then Mychr = "[PageUp]"
            If ChrNumber = 46 Then Mychr = "[Delete]"
            If ChrNumber = 35 Then Mychr = "[End]"
            If ChrNumber = 34 Then Mychr = "[PageDown]"
            If ChrNumber = 37 Then Mychr = "[Left]"
            If ChrNumber = 38 Then Mychr = "[Up]"
            If ChrNumber = 39 Then Mychr = "[Right]"
            If ChrNumber = 40 Then Mychr = "[Down]"
            If ChrNumber = 144 Then Mychr = "[NumLock]"
    '...

    Один из модулей кейлогера...

    psina-from-ua, 13 Августа 2009

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

    +153.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
    function filterVar($value)
    {
        if (get_magic_quotes_gpc())
        {
            $value = stripslashes($value);
        }
        
        $value = strip_tags($value); //режем теги.
        $value = preg_replace('%(<[^>]*(>|$)|>)%e', '', $value);
    
        return str_replace(array("\n", "\r"), array(' ', ''), $value);
    }
    
    foreach ($_GET as $reqValue)
    {
        $reqValue = is_array($reqValue) ? array_filter($reqValue, 'filterVar') : filterVar($reqValue);
    }
    
    $_REQUEST = array_merge ($_GET,$_POST);

    это меня вывело из себя

    junqed, 13 Августа 2009

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