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

    Всего: 5

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

    +160

    1. 1
    2. 2
    3. 3
    {if $smarty.foreach.categories.iteration == 2 || $smarty.foreach.categories.iteration == 4 || $smarty.foreach.categories.iteration == 6 || $smarty.foreach.categories.iteration == 8 || $smarty.foreach.categories.iteration == 10 || $smarty.foreach.categories.iteration == 12  || $smarty.foreach.categories.iteration == 14  || $smarty.foreach.categories.iteration == 16}
          <div class="clear"></div>
    {/if}

    Smarty

    uadeveloper, 26 Декабря 2013

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

    +79

    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
    if ($foto1 != "") {
                                            $fotourl = $foto1;
                                    } else {
                                            if ($foto2 != "") {
                                                    $fotourl = $foto2;
                                            } else {
                                                    if ($foto3 != "") {
                                                            $fotourl = $foto3;
                                                    } else {
                                                            if ($foto4 != "") {
                                                                    $fotourl = $foto4;
                                                            } else {
                                                                    if ($foto5 != "") {
                                                                            $fotourl = $foto5;
                                                                    } else {
                                                                            if ($foto6 != "") {
                                                                                    $fotourl = $foto6;
                                                                            } else {
                                                                                    if ($foto7 != "") {
                                                                                            $fotourl = $foto7;
                                                                                    } else {
                                                                                            if ($foto8 != "") {
                                                                                                    $fotourl = $foto8;
                                                                                            } else {
                                                                                                    if ($foto9 != "") {
                                                                                                            $fotourl = $foto9;
                                                                                                    } else {
                                                                                                            if ($foto10 != "") {
                                                                                                                    $fotourl = $foto10;
                                                                                                            } else {
                                                                                                                    if ($foto11 != "") {
                                                                                                                            $fotourl = $foto11;
                                                                                                                    } else {
                                                                                                                            if ($foto12 != "") {
                                                                                                                                    $fotourl = $foto12;
                                                                                                                            } else {
                                                                                                                                    if ($foto13 != "") {
                                                                                                                                            $fotourl = $foto13;
                                                                                                                                    } else {
                                                                                                                                            if ($foto14 != "") {
                                                                                                                                                    $fotourl = $foto14;
                                                                                                                                            } else {
                                                                                                                                                     // продолжение 
                                                                                                                                            }
                                                                                                                                    }
                                                                                                                            }
                                                                                                                    }
                                                                                                            }
                                                                                                    }
                                                                                            }
                                                                                    }
                                                                            }
                                                                    }
                                                            }
                                                    }
                                            }
                                    }

    Дали допилить сайт

    uadeveloper, 03 Февраля 2013

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

    +52

    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
    foreach ($sxe->categories->category as $category) {
    			$cid = $category['id'];
    			if ($clear == 0) {
    				$query = "SELECT `id` FROM `" . PREF . "category` WHERE `id`='" . $cid . "' LIMIT 1;";
    				$result = mysql_query($query);
    				if (mysql_num_rows($result) == 0) {
    					$parent = $category['parentId'];
    					$name = quote_smart($category);
    					$query = "INSERT IGNORE INTO `" . PREF . "category` VALUES('$cid','$parent','$name','1', 0);";
    					mysql_query($query);
    				}
    			} else {
    				$parent = $category['parentId'];
    				$name = quote_smart($category);
    				$query = "INSERT IGNORE INTO `" . PREF . "category` VALUES('$cid','$parent','$name','1');";
    				mysql_query($query);
    			}
    			$cat_i++;
    		}

    uadeveloper, 05 Октября 2012

    Комментарии (8)
  5. SQL / Говнокод #8112

    −853

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    SELECT a.*,r.rating_count,r.rating_sum,cc.params AS catparams,cc.title AS cattle,cc.alias AS category_alias FROM gn_content AS a INNER JOIN gn_categories AS cc ON cc.id = a.catid LEFT JOIN gn_content_rating AS r ON r.content_id = a.id WHERE a.state = 1 AND cc.published = 1 
    
                    AND ( a.publish_up = '2011-10-07 21:02:32' OR a.publish_up <= '2011-10-07 18:02:38' ) 
    
                    AND ( a.publish_down = '2011-10-07 21:02:32' OR a.publish_down >= '2011-10-07 18:02:38' ) 
    
                    AND (cc.id = 105 OR cc.id = 106 OR cc.id = 107 OR cc.id = 108 OR cc.id = 109 OR cc.id = 110 OR cc.id = 111 OR cc.id = 106 OR cc.id = 107 OR cc.id = 108 OR cc.id = 109 OR cc.id = 110 OR cc.id = 111) 
                    ORDER BY a.created DESC

    Это код модуля adinews2 для joomla

    Используются всегда только 2 даты: начало, конец

    uadeveloper, 07 Октября 2011

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

    +164

    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
    if($result){
    				list($Title_block, $Sections, $Description,$Moderators) = mysql_fetch_row($result)
    				//$row = mysql_fetch_assoc($result)
    				echo "<form>\n";
    					echo "\t<table border='4' cellspacing='1' cellpadding='1' width='1000' height='60'>\n";
    						echo "\t\t<tr>\n";
    							echo "\t\t\t<td colspan='5' bgcolor='gray' align='leftmargin'>$Title_block</td>\n";
    						echo "\t\t</tr>\n";
    				do{
    					echo "\t\t<tr>\n";
    						echo "\t\t\t<td bgcolor='#A0A0A0'></td>\n";
    						echo "\t\t\t<td bgcolor='#A0A0A0' width='500'>Форум</td>\n";
    						echo "\t\t\t<td bgcolor='#A0A0A0'>Тем</td>\n";
    						echo "\t\t\t<td bgcolor='#A0A0A0'>Сообщений</td>\n";
    						echo "\t\t\t<td bgcolor='#A0A0A0'>Последних сообщений</td>\n";
    					echo "\t\t</tr>\n";
    					echo "\t\t<tr>\n";
    						echo "\t\t\t<td bgcolor='##D0D0D0'><img src='mus.png'></td>\n";
    						echo "\t\t\t<td bgcolor='#D0D0D0' width='500' class='row4'>\n";
    							echo "\t\t\t\t<b><a href='Click' style='color:black;'>$Sections</a></b>\n";
    							echo "\t\t\t\t<br />$Description<br />Модераторы: $Moderators</td>\n";
    						echo "\t\t\t<td bgcolor='#D0D0D0'></td>\n";
    						echo "\t\t\t<td bgcolor='#D0D0D0'></td>\n";
    						echo "\t\t\t<td bgcolor='#D0D0D0'></td>\n";
    					echo "\t\t</tr>\n";
    				}while(list($Title_block, $Sections, $Description,$Moderators) = mysql_fetch_row($result));
    					echo "\t</table>\n";
    				echo "</form>\n";

    Часть одного самописного форума

    uadeveloper, 06 Сентября 2010

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