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

    Всего: 3

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

    +54

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    $postitle = str_replace (' ', '-', $title);
    				$postitle = str_replace ('/', '', $postitle);
    				$postitle = str_replace ('\\', '', $postitle);
    				$postitle = str_replace (':', '', $postitle);
    				$postitle = str_replace ('<', '', $postitle);
    				$postitle = str_replace ('>', '', $postitle);
    				$postitle = str_replace ('*', '', $postitle);
    				$postitle = str_replace ('?', '', $postitle);
    				$postitle = str_replace ('|', '', $postitle);
    				$postitle = str_replace ('"', '', $postitle);
    				$postitle = preg_replace ('#\[.*?\]#isu', '', $postitle);

    aleksey, 14 Ноября 2012

    Комментарии (4)
  3. SQL / Говнокод #5930

    −860

    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
    SELECT i.id AS i__id, i.title AS i__title, i.description AS i__description, i.meta_title AS i__meta_title, i.meta_keywords AS i__meta_keywords, i.meta_description AS i__meta_description, i.lang AS i__lang FROM item_translation i WHERE (i.id IN ('8845'))
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Акция' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Акция' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Розница' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Оптом' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Безнал' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Дилер' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'Кредит' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT p.id AS p__id, p.item_id AS p__item_id, p.type AS p__type, p.currency AS p__currency, p.value AS p__value, p.date AS p__date FROM price p WHERE (p.item_id = '8845' AND p.type = 'A') ORDER BY p.date DESC LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'В корзину' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection
    #
    
    SELECT t.id AS t__id, t.source AS t__source, t.target AS t__target, t.lang AS t__lang FROM translation t WHERE (t.source = 'В корзину' AND t.lang = 'ru') LIMIT 1
    0.00s, "doctrine" connection

    Это часть запросов которые выполняются для генерации главной страницы для одного интернет магазина. И таких запросов: 360 :-)

    aleksey, 09 Марта 2011

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

    +162

    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
    if (isset($items['1994-2008'])) {
    	$temp = $items['1994-2008'];
    	unset($items['1994-2008']);
    	$items['1994-2009'] = $temp;
    }
    
    ....
    
    $items = $archive+$results;
    arsort($items);
    $items = array_slice($items, 0, 4);
    foreach ($items as $key=>$arr) {
    	$content['items'][]=$arr;
    }

    $archive и $results - два массива :-)

    aleksey, 26 Ноября 2010

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