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

    Всего: 42

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

    +170

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if (isset($_POST['email'])) 
    {
       $email = $_POST['email'];
       if ($email == '') {
          unset($email);
       }
    }

    все предусмотрел...

    Sulik78, 25 Февраля 2011

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

    +164

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $this->db->Query("DELETE FROM `u_proposal`
    				WHERE `id` = '%d' AND `user` = '%d'", $item, $this->user->id);
    $this->db->Query("DELETE FROM `p_options`
    				LEFT JOIN `u_proposal` ON `p_options`.`portfolio` = `u_proposal`.`id`
    				WHERE `p_options`.`portfolio` = '%d' AND `p_options`.`type` = 'project' AND `u_proposal`.`user` = '%d'", $item, $this->user->id);

    3 часа еб**ся не мог понять почему записи из p_options не удаляются ))

    Sulik78, 25 Февраля 2011

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

    +145

    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
    function ruslat ($string) # Задаём функцию перекодировки кириллицы в транслит.
    {
    $string = ereg_replace("ж","zh",$string);
    $string = ereg_replace("ё","yo",$string);
    $string = ereg_replace("й","i",$string);
    $string = ereg_replace("ю","yu",$string);
    $string = ereg_replace("ь","'",$string);
    $string = ereg_replace("ч","ch",$string);
    $string = ereg_replace("щ","sh",$string);
    $string = ereg_replace("ц","c",$string);
    $string = ereg_replace("у","u",$string);
    $string = ereg_replace("к","k",$string);
    $string = ereg_replace("е","e",$string);
    $string = ereg_replace("н","n",$string);
    $string = ereg_replace("г","g",$string);
    $string = ereg_replace("ш","sh",$string);
    $string = ereg_replace("з","z",$string);
    $string = ereg_replace("х","h",$string);
    $string = ereg_replace("ъ","''",$string);
    $string = ereg_replace("ф","f",$string);
    $string = ereg_replace("ы","y",$string);
    $string = ereg_replace("в","v",$string);
    $string = ereg_replace("а","a",$string);
    $string = ereg_replace("п","p",$string);
    $string = ereg_replace("р","r",$string);
    $string = ereg_replace("о","o",$string);
    $string = ereg_replace("л","l",$string);
    $string = ereg_replace("д","d",$string);
    $string = ereg_replace("э","yе",$string);
    $string = ereg_replace("я","jа",$string);
    $string = ereg_replace("с","s",$string);
    $string = ereg_replace("м","m",$string);
    $string = ereg_replace("и","i",$string);
    $string = ereg_replace("т","t",$string);
    $string = ereg_replace("б","b",$string);
    $string = ereg_replace("Ё","yo",$string);
    $string = ereg_replace("Й","I",$string);
    $string = ereg_replace("Ю","YU",$string);
    $string = ereg_replace("Ч","CH",$string);
    $string = ereg_replace("Ь","'",$string);
    $string = ereg_replace("Щ","SH'",$string);
    $string = ereg_replace("Ц","C",$string);
    $string = ereg_replace("У","U",$string);
    $string = ereg_replace("К","K",$string);
    $string = ereg_replace("Е","E",$string);
    $string = ereg_replace("Н","N",$string);
    $string = ereg_replace("Г","G",$string);
    $string = ereg_replace("Ш","SH",$string);
    $string = ereg_replace("З","Z",$string);
    $string = ereg_replace("Х","H",$string);
    $string = ereg_replace("Ъ","''",$string);
    $string = ereg_replace("Ф","F",$string);
    $string = ereg_replace("Ы","Y",$string);
    $string = ereg_replace("В","V",$string);
    $string = ereg_replace("А","A",$string);
    $string = ereg_replace("П","P",$string);
    $string = ereg_replace("Р","R",$string);
    $string = ereg_replace("О","O",$string);
    $string = ereg_replace("Л","L",$string);
    $string = ereg_replace("Д","D",$string);
    $string = ereg_replace("Ж","Zh",$string);
    $string = ereg_replace("Э","Ye",$string);
    $string = ereg_replace("Я","Ja",$string);
    $string = ereg_replace("С","S",$string);
    $string = ereg_replace("М","M",$string);
    $string = ereg_replace("И","I",$string);
    $string = ereg_replace("Т","T",$string);
    $string = ereg_replace("Б","B",$string);
    return $string;
    }

    Sulik78, 23 Февраля 2011

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

    +163

    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
    $year = date("Y");
    $month = date("m");
    $day = date("d"); 
    
    if ($month == 9 or $month == 10 or $month == 11)
    {
    $month_new = $month + 1;
    echo $year.'-'.$month_new.'-'.$day;  
    }
    else 
    {
    
    if ($month == 12) {$year_new = $year + 1; 
    $year_new = $year + 1;
    $month_new = 1; 
    echo $year_new.'-0'.$month_new.'-'.$day;  }
    else {
    $month_new = $month + 1;
    echo $year.'-0'.$month_new.'-'.$day;} 
    }

    не удержался )

    Sulik78, 22 Февраля 2011

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

    +163

    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
    // what version of MySQL
    	$mysql = $db->query_first("SELECT VERSION() AS version");
    	$mysql = $mysql['version'];
    
    	// Post count
    	$posts = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "post");
    	$posts = $posts['total'];
    
    	// User Count
    	$users = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "user");
    	$users = $users['total'];
    
    	// Forum Count
    	$forums = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "forum");
    	$forums = $forums['total'];
    
    	// Usergroup Count
    	$usergroups = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "usergroup");
    	$usergroups = $usergroups['total'];
    
    	// First Forum Post
    	$firstpost = $db->query_first("SELECT MIN(dateline) AS firstpost FROM " . TABLE_PREFIX . "post");
    	$firstpost = $firstpost['firstpost'];
    
    	// Last upgrade performed
    	$lastupgrade = $db->query_first("SELECT MAX(dateline) AS lastdate FROM " . TABLE_PREFIX . "upgradelog");
    	$lastupgrade = $lastupgrade['lastdate'];

    от туда же
    плять... сюда надо весь форум постить
    нахер архив сношу к еб**ям

    Sulik78, 21 Февраля 2011

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

    +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
    20. 20
    if ($_POST['do'] == 'kill')
    {
    	// update users who are in this usergroup to be in the registered usergroup
    	$db->query_write("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("UPDATE " . TABLE_PREFIX . "user SET displaygroupid = 0 WHERE displaygroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = 2 WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("UPDATE " . TABLE_PREFIX . "subscription SET nusergroupid = -1 WHERE nusergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("UPDATE " . TABLE_PREFIX . "subscriptionlog SET pusergroupid = 2 WHERE pusergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("UPDATE " . TABLE_PREFIX . "userban SET usergroupid = 2 WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("UPDATE " . TABLE_PREFIX . "userban SET displaygroupid = 0 WHERE displaygroupid = " . $vbulletin->GPC['usergroupid']);
    
    	// now get on with deleting stuff...
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "forumpermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "ranks WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "usergrouprequest WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "userpromotion WHERE usergroupid = " . $vbulletin->GPC['usergroupid'] . " OR joinusergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "imagecategorypermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "attachmentpermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
    	$db->query_write("DELETE FROM " . TABLE_PREFIX . "prefixpermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);

    vBulletin 4.0.4
    || # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||

    Sulik78, 21 Февраля 2011

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

    +158

    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
    if ($_GET[action] == "avatar") {
    
    
    	if ($info = $_GET[info]) {
    
    			if ($info[avatar]) {
    				echo $info[avatar];
    			} else {
    					header("Content-type: image/png");
    
    					$im = imagecreatetruecolor(80, 80);
    					$white = imagecolorallocate($im, 255, 255, 255);
    					$grey = imagecolorallocate($im, 128, 128, 128);
    					$black = imagecolorallocate($im, 0, 0, 0);
    					imagefilledrectangle($im, 0, 0, 80, 80, $white);
    					$font = "fonts/avatar.ttf";
    
    					$text = "HET";
    					imagettftext($im, 20, 0, 15, 40, $grey, $font, $text);
    					imagettftext($im, 20, 0, 14, 39, $black, $font, $text);
    					$text = "ABATAPA";
    					imagettftext($im, 14, 0, 5, 55, $grey, $font, $text);
    					imagettftext($im, 14, 0, 4, 54, $black, $font, $text);
    					imagepng($im);
    					imagedestroy($im);
    			}
    	} else {
    					header("Content-type: image/png");
    
    					$im = imagecreatetruecolor(80, 80);
    					$white = imagecolorallocate($im, 255, 255, 255);
    					$grey = imagecolorallocate($im, 128, 128, 128);
    					$black = imagecolorallocate($im, 0, 0, 0);
    					imagefilledrectangle($im, 0, 0, 80, 80, $white);
    					$font = "fonts/avatar.ttf";
    
    					$text = "HET";
    					imagettftext($im, 20, 0, 15, 40, $grey, $font, $text);
    					imagettftext($im, 20, 0, 14, 39, $black, $font, $text);
    					$text = "ABATAPA";
    					imagettftext($im, 14, 0, 5, 55, $grey, $font, $text);
    					imagettftext($im, 14, 0, 4, 54, $black, $font, $text);
    					imagepng($im);
    					imagedestroy($im);	
    	}
    
    }

    Вот такое говнецо встретилось))

    Sulik78, 19 Февраля 2011

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

    +167

    1. 1
    $new = preg_replace("/((\[{1}[^\[\]]+\]{1})|(\[{1}\]{1}))/", "", $a);

    метод тыка.... зато работеат

    Sulik78, 18 Февраля 2011

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

    +164

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    $str="T:/home//localhost///MyScripts/////";
    $pos=strpos($str,"//");
    while($pos!=false)
    {
        $str=str_replace("//","/",$str);
        $pos=strpos($str,"//");
    }

    функция удаляет повторяющиеся слэши в строке

    Sulik78, 17 Февраля 2011

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

    +172

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    <ul>
    		<li><a href="/" title="<?php echo $this->lang->topMenu->home->title;?>"><?php echo $this->lang->topMenu->home->name;?></a></li>
    		<li><a id="searchShow" title="<?php echo $this->lang->topMenu->search->title;?>"><?php echo $this->lang->topMenu->search->name;?></a></li>
    		<li><a id="chatShow" title="<?php echo $this->lang->topMenu->chat->title;?>"><?php echo $this->lang->topMenu->chat->name;?></a></li>
    		<li><a href="/designers.htm" title="<?php echo $this->lang->topMenu->designers->title;?>"><?php echo $this->lang->topMenu->designers->name;?></a></li>
    		<li><a href="/developers.htm" title="<?php echo $this->lang->topMenu->developers->title;?>"><?php echo $this->lang->topMenu->developers->name;?></a></li>
    		<li><a href="/login.htm" title="<?php echo $this->lang->topMenu->login->title;?>"><?php echo $this->lang->topMenu->login->name;?></a></li>
    		<li><a id="registerShow" href="/register.window.htm" title="<?php echo $this->lang->topMenu->register->title;?>"><?php echo $this->lang->topMenu->register->name;?></a></li>
    		<li><a href="/fadeback.htm" title="<?php echo $this->lang->topMenu->fadeback->title;?>"><?php echo $this->lang->topMenu->fadeback->name;?></a></li>
    	</ul>

    ООП )

    Sulik78, 05 Февраля 2011

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