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

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

    Найдено: 41

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

    +49

    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
    wordpress:
    function __( $text, $domain = 'default' ) {
    	        return translate( $text, $domain );
    }
    
    function translate( $text, $domain = 'default' ) {
    	        $translations = &get_translations_for_domain( $domain );
    	        return apply_filters( 'gettext', $translations->translate( $text ), $text, $domain );
    }
    
    PHP-manual:
    PHP reserves all function names starting with __ as magical. It is recommended that you do not use function names with __ in PHP unless you want some documented magic functionality. 
    
    wordpress:
    /*
    * Don't use translate() directly, use __()
    */

    xcont, 12 Сентября 2012

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

    +53

    1. 1
    2. 2
    3. 3
    $post_slug = explode("/", trim($_SERVER["REQUEST_URI"], " /"));
    $the_query = new WP_Query(array("name" => $post_slug[1],
                                    "post_type" => "conference"));

    И снова WordPress!'

    URL вида http://somesite.ru/conference/pervaya-konferentsiya-anesteziologov/program/

    varg242, 29 Августа 2012

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

    +56

    1. 1
    $where = str_replace("post_status = 'publish'","post_status = 'publish' OR post_status = 'future' OR post_status = 'draft' OR post_status = 'inherit'", $where);

    Wordpress. Govnocode is poetry

    telnet, 10 Августа 2012

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

    +66

    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
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    //header.php
    <div id="search-box">						
                <form action="<?=$_SERVER["REQUEST_URI"]?>" method="get" style="padding:0;margin:0;">
    <?php
    $sql="SELECT * FROM wp_gorod ORDER BY name_gorod ASC ";
    $res=mysql_query($sql);
    $g=array();if($_GET['gorod']!=""){
    	$id=$_GET['gorod'];
    	$_SESSION['gorod_id']=$id;
    	$ig=$_REQUEST['gorod_id'];}
    $ig=$_SESSION['gorod_id'];	
    echo "<select onchange='return this.form.submit()' name='gorod'>\n";	echo "<option value='0'>Выберите город</option>\n";
    while($row=mysql_fetch_array($res)){
    	if($row['id_gorod']==$_SESSION['gorod_id']){
    		echo "<option value='".$row['id_gorod']."' selected='selected'>".$row['name_gorod']."</option>\n";	}else{
    		echo "<option value='".$row['id_gorod']."'>".$row['name_gorod']."</option>\n";
    	}
    }echo "</select>     <font size=\"4\" color=\"#F46F2A\">".$_SESSION['number']."</font>\n";if(isset($_SESSION['gorod_id'])){
    	echo "<br>\n";
    	$sql1="Select * from wp_gorod where id_gorod=".$ig;
    	$r=mysql_query($sql1);
    	$rw=mysql_fetch_array($r);
    	echo "<div class=tel><b> ".$rw['telephone']. "<br /></b></div>\n";
    	echo "<div class=adres align=right>".$rw['adres']."<br/>\n";
    	echo "".$rw['email']."</div>\n";
    }
    ?>
             <noscript><input type="submit" value="View" /></noscript>
             </form></div>
    
    //index.php
    if ($_SERVER['REQUEST_URI'] == '/doneck/') {
    header("Location: /doneck/?gorod=15");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/vinnica/') {
    header("Location: /vinnica/?gorod=13");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/dnepropetrovsk/') {
    header("Location: /dnepropetrovsk/?gorod=14");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/zhitomir/') {
    header("Location: /zhitomir/?gorod=17");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/zaporozhe/') {
    header("Location: /zaporozhe/?gorod=18");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/ivano-frankovsk/') {
    header("Location: /ivano-frankovsk/?gorod=19");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/kiev/') {
    header("Location: /kiev/?gorod=20");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/kirovograd/') {
    header("Location: /kirovograd/?gorod=37");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/lugansk/') {
    header("Location: /lugansk/?gorod=21");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/luck/') {
    header("Location: /luck/?gorod=22");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/lvov/') {
    header("Location: /lvov/?gorod=23");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/nikolaev/') {
    header("Location: /nikolaev/?gorod=24");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/odessa/') {
    header("Location: /odessa/?gorod=25");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/poltava/') {
    header("Location: /poltava/?gorod=26");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/rovno/') {
    header("Location: /rovno/?gorod=27");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/krym/') {
    header("Location: /krym/?gorod=28");
    return;
    }
    if ($_SERVER['REQUEST_URI'] == '/sumy/') {
    header("Location: /sumy/?gorod=29");
    return;
    }

    Чья-то модификация для wordpress.
    1. google скушал 2000 ссылок вида http://адрес-сайта/чпу/?gorod=29 (http://адрес-сайта/чпу/?gorod=26, http://адрес-сайта/чпу/?gorod=25, ...) и понизил сайт в выдаче
    2. sql-инъекций идет на ура. Странно, что никто не воспользовался.

    xcont, 26 Июля 2012

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

    +59

    1. 1
    2. 2
    3. 3
    while (($i <= $additional_limit) && ($i < $available_spaces)) {
        $i++;
       }

    в недрах плагина к wordpress. Прям по-другому минимум двух чисел не найти

    mkusher, 08 Июля 2012

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

    +61

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if (empty($columns)) {
    	$columns = 'eleven';
    } else {
    	// Check the function for a returned variable
            // (от автора) КОГО КОГО МЫ ТАМ ЧЕКАЕМ??
    	$columns = $columns;
    }

    Найдено в достойном шаблоне Skeleton для WordPress
    /(. . )

    blessed, 13 Июня 2012

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

    +150

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <div style="display: none;">
    	<input type="hidden" name="_wpcf7" value="251" />
    	<input type="hidden" name="_wpcf7_version" value="3.1.1" />
    	<input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f251-t1-o1" />
    	<input type="hidden" name="_wpnonce" value="5963830b40" />
    </div>

    Плагин Contact Form 7 для Wordpress

    glutaminefee, 20 Марта 2012

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

    +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
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    function include_wp_head($src)
    {
        $paths = array(
            ".",
            "..",
            "../..",
            "../../..",
            "../../../..",
            "../../../../..",
            "../../../../../..",
            "../../../../../../.."
        );
       
        foreach ($paths as $path) {
            if(file_exists($path . '/' . $src)) {
                return $path . '/' . $src;
            }
        }
    }

    WordPress Form Manager

    ddavydov, 01 Марта 2012

    Комментарии (11)
  10. SQL / Говнокод #9524

    −113

    1. 1
    2. 2
    SELECT comment_ID FROM wp_comments WHERE comment_post_ID = '991' AND ( comment_author = 'autoparkbox' OR comment_author_email = '[email protected]' ) AND comment_content = 'Оказываем помощь при регистрации транспорта для организаций в ГАИ и МРЭО.    
    Ассортимент наших услуг: постановка на учет автомобилей...' LIMIT 1;

    Wordpress ...
    случайно нашёл в slow-логе

    slav0nic, 23 Февраля 2012

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

    +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
    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
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    <?
    include "config/bd.php";
    
    class watermark1
    {
      function create_watermark( $main_img_obj, $text, $font, $r = 128, $g = 128, $b = 128, $alpha_level = 0 )
      {
       $width = imagesx($main_img_obj);
       $height = imagesy($main_img_obj);
       $angle =  -rad2deg(atan2((-$height),($width)));
       $text = " ".$text." ";
       $c = imagecolorallocatealpha($main_img_obj, $r, $g, $b, $alpha_level);
       $size = (($width+$height)/2)*2/strlen($text);
       $box  = imagettfbbox ( $size, $angle, $font, $text );
       $x = $width/2 - abs($box[4] - $box[0])/2;
       $y = $height/2 + abs($box[5] - $box[1])/2;
       imagettftext($main_img_obj,$size ,$angle, $x, $y, $c, $font, $text);
       return $main_img_obj;
      }
    }
    
    
    
    $myrow22 = mysql_query("select * from `content` where id_content=3");
    $row22 = mysql_fetch_array($myrow22);
    include "includes/head1.php";
    include "includes/leftm.php"; 
     
    $category_id = isset($_GET['category_id']) ? (int)$_GET['category_id'] : 1;
    $myrow = mysql_query("SELECT * FROM `gallery` LEFT JOIN `gallery_files` `gf` ON `gallery`.id = gallery_id WHERE category_id = " . $category_id  . " ORDER BY `gf`.id");
     
    $items = array();
    $photos = array();
    while($row = mysql_fetch_array($myrow)) {
    	$items[ $row['gallery_id']] = $row;
    $photos[ $row['gallery_id']][] = $row['filename'];
    }
     
    echo '<div id=content>
    <p><table width=100% >
    <tr>';
    $i = 0;
    foreach ($items as $id => $item) {
            $i++;
            echo '<td>';
    
    
    
    
     
     
    
    	$photo = array_shift($photos[$id]); // только первая картинка
    $photo2='./uploads/text'.$photo;
    
    	$watermark = new watermark1();
    	$type=mime_content_type($photo);
    	
    if (($type != 'image/jpeg')and($type != 'image/png'))
    {
    }
    else
    {
    // определяем расширение переданного файла
    switch ($type)
    {
    case 'image/jpeg':
    $img = imagecreatefromjpg("./uploads/resized_$photo");
    break;
    case 'image/png':
    $img = imagecreatefrompng("./uploads/resized_$photo");
    break;
    }
    
    	$im=$watermark->create_watermark($img,”jeka911.wordpress.com”,'./1.ttf',0,0,255,120);
    	imagejpeg($im,$photo2);
    echo '<a href="infokuhni.php?id=' . $item['gallery_id'] . '" ><img src="'. $photo2 . '" /><br/><br/>';
    	echo '<font face="Georgia, Times New Roman, Times, serif">';	echo  $item['title'] . '</font><br/>';
    		echo '<font face="Times New Roman, Times, serif">Цена: ';	echo $item['price'] . ' рублей</font></a><br/><br>';
     
            echo '</td>';
            if (!($i % 4)) echo '</tr><tr>';
    }
    echo '</tr>
    </table>
    <p></div>';
     
    include "includes/foot.php";
    ?>

    bugaaa, 15 Февраля 2012

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