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

    Всего: 2

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

    +150.2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    <?php 
    
    ...
    
    $markers = array("~");
    $newcode  = array("<br>");
    $output = str_replace($markers, $newcode, $source);
    
    ...
    
    ?>

    А вот так канадские кодеры заменяют функцию nl2br() в textarea
    =)

    Senya, 11 Ноября 2009

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

    +150.9

    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
    <?php
    
    ... 
    
    mysql_select_db($database_store, $store);
    $query_rsThisCategoryItems = sprintf("SELECT DISTINCT store_products.product_name, store_products.image_file, store_products.product_id, store_products.product_price, store_products_to_categories.category_id, store_products.sku FROM store_products_to_categories, store_products WHERE store_products_to_categories.category_id=%s AND store_products_to_categories.product_id=store_products.product_id GROUP BY store_products.product_name", GetSQLValueString($cat_rsThisCategoryItems, "int"));
    $rsThisCategoryItems = mysql_query($query_rsThisCategoryItems, $store) or die(mysql_error());
    $row_rsThisCategoryItems = mysql_fetch_assoc($rsThisCategoryItems);
    $totalRows_rsThisCategoryItems = mysql_num_rows($rsThisCategoryItems);
    
    //product query
    
    $colname_rsThisProduct = "1";
    if (isset($_GET['p_id'])) {
      $colname_rsThisProduct = $_GET['p_id'];
    }
    mysql_select_db($database_store, $store);
    $query_rsThisProduct = sprintf("SELECT * FROM store_products WHERE product_id=%s", GetSQLValueString($colname_rsThisProduct, "int"));
    $rsThisProduct = mysql_query($query_rsThisProduct, $store) or die(mysql_error());
    $row_rsThisProduct = mysql_fetch_assoc($rsThisProduct);
    $totalRows_rsThisProduct = mysql_num_rows($rsThisProduct);
    
    
    //cart contents for header summary
    $colname_rsQuickCart = "-1";
    if (isset($_SESSION['sessionid'])) {
      $colname_rsQuickCart = $_SESSION['sessionid'];
    }
    mysql_select_db($database_store, $store);
    $query_rsQuickCart = sprintf("SELECT * FROM store_cart, store_products WHERE store_cart.session_id = %s  AND store_cart.product_id=store_products.product_id", GetSQLValueString($colname_rsQuickCart, "text"));
    $rsQuickCart = mysql_query($query_rsQuickCart, $store) or die(mysql_error());
    $row_rsQuickCart = mysql_fetch_assoc($rsQuickCart);
    $totalRows_rsQuickCart = mysql_num_rows($rsQuickCart);
    
    $colname_rsCartTotal = "-1";
    if (isset($_SESSION['sessionid'])) {
      $colname_rsCartTotal = $_SESSION['sessionid'];
    }
    mysql_select_db($database_store, $store);
    $query_rsCartTotal = sprintf("SELECT SUM(total_price) FROM store_cart WHERE session_id = %s", GetSQLValueString($colname_rsCartTotal, "text"));
    $rsCartTotal = mysql_query($query_rsCartTotal, $store) or die(mysql_error());
    $row_rsCartTotal = mysql_fetch_assoc($rsCartTotal);
    $totalRows_rsCartTotal = mysql_num_rows($rsCartTotal);
    
    ...
    
    ?>

    пришёл на работу.
    Дали до делать вебсайт
    увидел ЭТО....и обиделся на аФФтара О_о

    Senya, 11 Ноября 2009

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