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

    Всего: 120

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

    +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
    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
    <?php
    /*---------------------------------------------------------------------------
    *       @Module Name: Clans
    * @Description: ClanWars for LiveStreet
    * @Version: 1.0
    * @Author: trim06
    * @LiveStreet Version: 0.3.1
    * @File Name: Clans.mapper.class.php
    * @License: GNU GPL v2, http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    *----------------------------------------------------------------------------
    */
     
    class Mapper_Clans extends Mapper {
            public function AddClan($ownerId, $clanName, $nameUrl, $clanPeople, $clanDesc, $urlHomePage, $pathAvatar)
      {
                    $sql = 'INSERT INTO '.DB_TABLE_CLANS.'
                            (owner_id,
                            name,
                            name_url,
          people,
          people_count,
          description,
          reg_date,
          avator,
          url_home_page
                            )
                            VALUES(?d, ?, ?, ?, ?d, ?, NOW(), ?, ?)
                    ';
        $clanPeopleCount = count(explode(',', $clanPeople));
                    if($this->oDb->query($sql, $ownerId, $clanName, $nameUrl, $clanPeople, $clanPeopleCount, $clanDesc, $pathAvatar, $urlHomePage))
        {
                        $this->DropInviteClanCreate($ownerId);
                            return true;
                    }               
                    return false;
            }
      
            public function UpdateClan($clanId, $ownerId, $clanPeople, $clanName, $nameUrl, $clanDesc, $urlHomePage, $pathAvatar)
      {
                    $sql = 'UPDATE '.DB_TABLE_CLANS.' 
                            SET 
            name = ?,
            name_url = ?,
            people = ?,
            description = ?,'.
            (($pathAvatar) ? "avator = '".$pathAvatar."'," : '').
            'url_home_page = ?,
            people_count = ?d
                            WHERE
                                    owner_id = ?d AND id = ?d
                    ';
        $clanPeopleCount = count(explode(',', $clanPeople));
                    if ($this->oDb->query($sql, $clanName, $nameUrl, $clanPeople, $clanDesc, $urlHomePage, $clanPeopleCount, $ownerId, $clanId))
        {
                            return true;
                    }               
                    return false;
            }
      public function GetClans($status,&$iCount,$iCurrPage,$iPerPage)
      {
        $sql = 'SELECT * FROM '.DB_TABLE_CLANS.' WHERE status=?d 
    AND id NOT IN (SELECT clan_id
                    FROM '.DB_TABLE_CLANS_BANS.'
                    WHERE ban_active=1
                    GROUP BY clan_id)
    ORDER BY rating DESC LIMIT ?d, ?d';
        $status = ($status=='good') ? 0 : 1;
        if($aRows=$this->oDb->selectPage($iCount, $sql, $status, ($iCurrPage-1)*$iPerPage, $iPerPage))
        {
          return $aRows;
        }
        return null;
      }
    public function GetBannedClans(&$iCount,$iCurrPage,$iPerPage)
      {
        $sql = 'SELECT c.* 
            FROM  
            (SELECT clan_id
                    FROM '.DB_TABLE_CLANS_BANS.'
                    WHERE ban_active=1
                    GROUP BY clan_id) as cb
            JOIN '.DB_TABLE_CLANS.' as c ON c.id=cb.clan_id
            ORDER BY rating 
            DESC LIMIT ?d, ?d';
        if($aRows=$this->oDb->selectPage($iCount, $sql, ($iCurrPage-1)*$iPerPage, $iPerPage))
        {
          return $aRows;
        }
        return null;
      }

    qbasic, 11 Марта 2011

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

    +167

    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
    <?
    function displayData() { 
        global $chanTitle, $chanLink, $chanDesc, $rss, $items, $itemCount, $imgTitle, $imgLink, $imgUrl; 
        global $items, $itemCount; 
    ?>
    <?
    for($i = 0;$i < 1;$i++) { 
        
            if(@$items[$i]['link']<>''){
    ?>
            <? echo  '<h4>'.codirovkaReader(@$items[$i]['title']).'</h4>';  ?>
                    <? echo  '<h5>'.codirovkaReader(@$items[$i]['pubdate']).'</h5>';  ?>
            <? echo codirovkaReader(@$items[$i]['desc']); ?> 
               <? echo '<br><hr size="1">'; ?>
       
    <?      
    } 
    }               
    ?>
    <?
    }
    parseRSS($url); 
    ?>

    qbasic, 09 Марта 2011

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

    +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
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    <?php
    include("db.php");
    $query = "SELECT * FROM dbtest";
    $result = mysql_query($query);
    $fp = fopen("~/.ihmiheiha.conf", "w");
    if (!$fp)
    die("Ты намутил что-то не то... ведь всё работало");
    while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    $ihm=$row[0];
    $ihe=$row[1];
    $iha=$row[2];
    $filed = "tnkf: $ihm, tnkd: $ihe, tnka: $iha";
    fwrite($fp, $filed);
    }
    mysql_close ( $db );
    fclose($fp);
    ?>
    <html>
    <body>
    <form action='del.php' method='post'>
    <?php
    include("db.php");
    $query = "SELECT * FROM dhcpd";
    $result = mysql_query ( $query );
    $n = mysql_num_rows ( $result );
    for ( $i=0; $i<$n; $i++ )
      {
       $row = mysql_fetch_array($result);
       echo "<p><b><input type='checkbox' name='".($i+1)."' value='1'>";
       echo " ".($i+1).". Host: $row[ihm]</b></br>";
       echo "<b>MAC адрес:</b> $row[ihe]<br>";
       echo "<b>IP адрес:</b> $row[iha]</p>";
       }
    if ( $n == 0 ) echo "Никого нет.";
    mysql_close ( $db );
    ?>
    </form>
    <center>
    <div style="float:left">
    <FORM ACTION="add.php">
    <INPUT TYPE="submit" VALUE="Добавить">
    </FORM></div>
    <div style="float:left">
    <FORM ACTION="del.php">
    <INPUT TYPE="submit" VALUE="Удалить">
    </FORM>
    </div>
    <div style="float:left">
    <FORM ACTION="<?php echo $PHP_SELF?>">
    <INPUT TYPE="submit" VALUE="Применить изменения">
    </FORM>
    </div>
    </center>
    </body>
    </html>

    qbasic, 09 Марта 2011

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

    +165

    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
    <?php
    session_start();
    mysql_connect("localhost","root","1234") or die('Problema s podklucheniem');
    mysql_query("SET NAMES 'cp1251'");
    mysql_select_db("test2");
    $qu='select * from Users where login="'.$log.'"';
     $res=mysql_query($qu);
     if(!$res) {echo"AAAAA ebat!!!!!";
         exit();}  
    $user=mysql_fetch_array($res,MYSQL_ASSOC);
     $pas1=md5($pas);
     if ($user['password']!=$pas1) {echo"parol ne tot!!";
         exit();}  
             $s=$user['login'].'|'.$user['password'].'|';
            /*setcookie("use",$s,time()+604800,'/'); 
            $mod=strtok($s, '|');
            echo $mod;
            $mod=strtok('|');
            echo '     '.$mod; */
            $_SESSION['username']=$user['name'];
            $_SESSION['userfname']=$user['fname'];
            echo    $_SESSION['username'].'    '.$_SESSION['userfname'];

    qbasic, 07 Марта 2011

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

    +165

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <? session_start();
      if (isset($_session['username'])) $s=$_session['username'];
         else $s="Beda!!!!" 
    echo $s;
    ?>

    qbasic, 07 Марта 2011

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

    +165

    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
    /*
                    CONNECT
            */
            function connect( $server, $user, $pass )
            {
                    return mysql_connect( $server, $user, $pass );
                    mysql_query("SET NAMES 'utf8'");
            }
     
            /*
                    PCONNECT
            */
            function pconnect( $server, $user, $pass )
            {
                    return mysql_pconnect( $server, $user, $pass );
                    mysql_query("SET NAMES 'utf8'");
            }
     
            /*
                    SELECT DB
            */
            function select_db($database,$link_id)
            {
                    return mysql_select_db($database,$link_id);
                    mysql_query("SET NAMES 'utf8'");
            }

    qbasic, 07 Марта 2011

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

    +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
    function make_category_select($name,$selected='',$not='',$additional='')
            {
                    global $udb,$admin,$evoLANG,$cat_cache;
                    
                    $this->parent_name = $this->parent_name != "" ? $this->parent_name : $evoLANG['noparent'];
            
                    if ($this->onlyoptions != 1)
                    {
                            $a .= "<select name=\"".$name."\" ".$additional.">\n";
                    }
                    
                    $a .=  '<option value=""> '.$this->parent_name." </option>\n";
                    
     
                    $a .= $this->make_cat_options('0',$selected,1,$not);
     
                    if ($this->onlyoptions != 1)
                    {
                            $a .= '</select>';
                    }
     
                    return $a;
            }

    qbasic, 06 Марта 2011

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

    +159

    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
    function make_cat_options($pid='0',$selected='',$depth=1,$not='')
    {
    	global $cat_cache,$udb,$database,$admin;
    	if ( !is_array($cat_cache) )
    	{
    		$sql = $udb->query('SELECT * FROM '.$database['cat'].' ORDER BY orders ASC, cid ASC');
    		while ($row = $udb->fetch_array($sql))
    		{
    			$cat_cache[$row['pid']][$row['cid']] = $row;
    		}
    	}
    	$cache = $cat_cache;
    	$xaccess = explode(",",$not);
    	if(!isset($cache[$pid])) return;
    	while (list($parent,$category) = each($cache[$pid]))
    	{
    		if ( $this->cattpl != '' )
    		{
    			$a .= str_replace( 
    				array('{url}','{description}','{name}'),
    				array( 
    						$this->link_cat( $category[$this->sestype_cat()]),
    						$admin->superhtmlentities($category['description']),
    						str_repeat(' ',$depth-1)." ".$category['name']
    					),
    			
    				$this->cattpl );
    		}
    		else
    		{
    			$category['name'] = $this->hsc == 1 ? $admin->superhtmlentities($category['name']) : $category['name'];
    			unset($sel);
    			if ($category['cid'] == $selected)
    			{
    				$sel = 'selected="selected"';
    			}			       
    			if ( !in_array($category['cid'],$xaccess) )
    			{
    				if ( $category['disabled'] != 1 )
    				{
    					$a .= '<option value="'.($this->cat_name == 1 ? $this->link_cat($category[$this->sestype_cat()]) : $category['cid']).'" '.$sel.'>';
    					if ($depth > 1)
    					{ 
    						$a .= str_repeat("-",$depth-1)." ".$category['name']."</option>"."\n";
    					}
    					else
    					{
    						$a .= $category['name']."</option>";
    					}
    				}
    				else
    				{
    					$a .= '<optgroup label="'. str_repeat("-",$depth-1)." ".$category['name'].'">';
    					$closegroup = 1;
    				}
    			}
    		}
    		$a .= $this->make_cat_options($category['cid'],$selected,$depth+1,$not);
    		if ( $closegroup == 1 )
    		{
    			$a .= "</optgroup>\n";
    		}
    	} 
    	$udb->free_result($sql);
    	return $a;
    }

    qbasic, 06 Марта 2011

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

    +159

    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
    function get_list_templ()
    {
    $list = array();
    $odir = opendir("../templetes");
    while (($rdir = readdir($odir)) != false)
    {
    if ($rdir !== '.' and $rdir !== '..' and !strpos($rdir, '.'))
    {
    echo $rdir.': ';
    $odir2 = opendir("../templetes/$rdir");
    while($rdir2 = readdir($odir2))
    if ($rdir2 !== '.' and $rdir2 != '..' and strpos($rdir2, '.'))
    {
    if ($rdir2 === 'index.php')
    {
    echo $rdir2."<br />";
    } else
    {
    
    echo 'No exits index.php<br />';
    }
    }
    }
    }

    qbasic, 06 Марта 2011

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

    +160

    1. 1
    2. 2
    3. 3
    4. 4
    <input type="text" name="quantity- <?php echo $row['id']; ?>" size="2" style="text-align:center" value="<?php echo $_SESSION['cart'][$row['id']]['quantity']; ?>" id='inp_<? echo $er;?>' onBlur='calculate(this.value, "<?php echo $row['cena'];?>", "bdo_<? echo $er;?>")'/>
    
    <? 
    if ($_SESSION['cart'][$row['id']]['quantity'] != $_POST['quantity-'.$row['id']]) $_SESSION['cart'][$row['id']]['quantity'] = $_POST['quantity-'.$row['id']];

    qbasic, 06 Марта 2011

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