1. PHP / Говнокод #18879

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <?php
    
    if ($this->user->is_phone == 1 OR $this->user->is_phone == true OR $this->user->is_phone == 'true') {
        $this->smarty->assign('is_phone', 1);
    } elseif ($this->user->is_phone == 0 OR $this->user->is_phone == false OR $this->user->is_phone == 'false') {
        $this->smarty->assign('is_phone', 0);
    }

    шедевр

    $is_phone принимает значения 0, 1 или null

    m0003r, 16 Октября 2015

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

    +7

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if($status=="active"){}else
    	{
    		echo "Account isn't active.'";
            die;
    	}

    Я думаю, в комментариях не нуждается.

    __init__, 16 Октября 2015

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

    +1

    1. 1
    define("MANAGER_SAIL", 13);

    Менеджер-парус, что непонятного?

    Super_Oleg, 15 Октября 2015

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

    +1

    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
    <?php
    
            if ($fields['emailhide'] == "true" OR $fields['emailhide'] == true OR $fields['emailhide'] == 1) {
                $newEmail = $values['fid2'][0]['val'];
                $cond = 1;
                $this->smarty->assign('is_phone', 1);
            } elseif ($fields['emailhide'] == "false" OR $fields['emailhide'] == false OR $fields['emailhide'] == 0) {
                $newEmail = $fields['email'];
                $cond = 0;
                $this->smarty->assign('is_phone', 0);
            }
            if ($this->user->is_phone == 1 OR $this->user->is_phone == true OR $this->user->is_phone == 'true') {
                $this->smarty->assign('is_phone', 1);
            } elseif ($this->user->is_phone == 0 OR $this->user->is_phone == false OR $this->user->is_phone == 'false') {
                $this->smarty->assign('is_phone', 0);

    Продолжение предыдущего ( #18863 )

    m0003r, 15 Октября 2015

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

    +17

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    ......
    $password = hash("sha256", $password);
    ......
    elseif(strlen($password) < 5)
        error("Пароль слишком короткий.");
    ......

    Necronth, 14 Октября 2015

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

    +11

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <?php
    
    if($emailhide == 1 OR $emailhide == true OR $emailhide == 'true'){
            ...
    }

    m0003r, 14 Октября 2015

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

    +1

    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
    public function save() {
    		if (!empty(self::$single)) {
    			if (isset(self::$single['id'])) {
    				$id = self::$single['id'];
    				unset(self::$single['id']);
    				$arraySetters = [];
    				foreach (self::$single as $key => $value) {
    					$arraySetters[] = '`'.$key.'` = \''.$value.'\'';
    				}
    				self::$single['id'] = $id;
    				self::$exec = static::$db->prepare('UPDATE '.self::$table.' SET '.implode(', ', $arraySetters).' WHERE `id` = '.$id.' LIMIT 1');
    				return self::$exec->execute();
    			} else {
    				$arrayKeys = [];
    				$arrayValues = [];
    				foreach (self::$single as $key => $value) {
    					$arrayKeys[] = '`'.$key.'`';
    					$arrayValues[] = '\''.$value.'\'';
    				}
    				self::$exec = static::$db->prepare('INSERT INTO '.self::$table.' ('.implode(', ', $arrayKeys).') VALUES ('.implode(', ', $arrayValues).')');
    				if ($status = self::$exec->execute()) {
    					self::$single['id'] = static::$db->lastInsertId();
    				}
    				return $status;
    			}
    		}
    		return false;
    	}

    HiNeX, 12 Октября 2015

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

    +6

    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
    echo '<!DOCTYPE html> ';
    ?>
    <<?='h'.'t'.'m'.'l'?>>
    <<?='h'.'e'.'a'.'d'?>>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title><?php echo htmlspecialchars($content['meta_title'])?></title>
    <meta name="keywords" content="<?php echo htmlspecialchars($content['meta_keys'])?>">
    <meta name="description" content="<?php echo htmlspecialchars($content['meta_desc'])?>">
    <link rel='icon' href='/favicon.jpg' type='image/x-icon' /> 
    <link rel='shortcut icon' href='/favicon.jpg' type='image/x-icon'/>
    <link rel="stylesheet" type="text/css" href="<?=TEMP_FOLDER?>css/slide_show.css">
    <? if(file_exists(ROOT_DIR.'favicon.ico')) echo '<link rel="shortcut icon" href="'.SITE_URL.'favicon.ico" type="image/x-icon" />';?>
    <base href="<?php echo SITE_URL?>">
    <?require('css.php')?>
    <?require('javascripts.php')?>
    <?require('celi.php')?>
    <?/*<script src="http://ie.microsoft.com/testdrive/HTML5/CompatInspector/inspector.js"></script>*/?>
    </<?='h'.'e'.'a'.'d'?>>
    <?php flush();
    	   
    		$query = "SELECT pid FROM ".TABLE_SITEMENU." WHERE id = ";
    		$lvl = Site_Sitemenu::gI()->get_levels($_GET['id'], $param = 'pid', $query);
    
    ?>

    не доложил в прошлый раз

    LesterTeheMolester, 12 Октября 2015

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

    +1

    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
    $content = array(
        'html' => '',
        'meta_title' => $sitename,
        'meta_keys' => $sitename,
        'meta_desc' => $sitename,
        'left_menu' => '',
        'path' => ''
    );
    
    if ($_GET['module'] == 'page')
        $_GET['module'] = 'site';
    
    if (!isset($_GET['module'])) {
        $_GET['module'] = 'site';
    }
    
    l('modules');
    
    /* подключение текущего модуля, все остальные грузятся через __autoload() в includes/function.php */
    $file = ROOT_DIR . 'modules/' . $_GET['module'] . '/i.php';
    if (file_exists($file)) {
        //l('load_module '. $file);
        require($file);
    } else {
        echo 'Файл modules/' . $_GET['module'] . '/i.php не найден';
    }
    
    
    if (empty($content['path']) || $content['path'] == '')
        $site->_404();
    
    if (!empty($content['html'])) {
        $content['html'] = fix_content($content['html']);
    }

    почти на уровне 1 != 1

    LesterTeheMolester, 12 Октября 2015

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

    +5

    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
    echo '<!DOCTYPE html> ';
    ?>
    <<?='h'.'t'.'m'.'l'?>>
    <<?='h'.'e'.'a'.'d'?>>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title><?php echo htmlspecialchars($content['meta_title'])?></title>
    <meta name="keywords" content="<?php echo htmlspecialchars($content['meta_keys'])?>">
    <meta name="description" content="<?php echo htmlspecialchars($content['meta_desc'])?>">
    <link rel='icon' href='/favicon.jpg' type='image/x-icon' /> 
    
    ...
    
    
    </<?='b'.'o'.'d'.'y'?>>
    </<?='h'.'t'.'m'.'l'?>>

    ору

    LesterTeheMolester, 12 Октября 2015

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