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

    +150.4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    $req = mysql_query("SELECT `id`, `name`, `datereg` FROM `users` ORDER BY `datereg` DESC LIMIT 1");
    while ($arr = mysql_fetch_array($req))
    {
    echo'К нам присоединился - '.$arr['name'].'';
    }

    Долго думал зачем цикл, но это не для моего ума наверно

    guest, 04 Мая 2009

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

    +154.4

    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
    $req = mysql_query("SELECT * FROM `users` ORDER BY `datereg` DESC;");
    ------
    $count = mysql_num_rows($req); 
    $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
    $start = $page * 10 - 10;
    if ($count < $start + 10)
    {
    $end = $count;
    } else
    {
    $end = $start + 10;
    }
    while ($arr = mysql_fetch_array($req))
    {
    if ($i >= $start && $i < $end)
    {
    тут вывод 
    }
    ++$i;
    }

    john cms вывод по десять из таблицы users

    guest, 04 Мая 2009

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

    +149

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    mysql_connect($hostname, $user, $password);
    mysql_select_db("weblogs");
    $query = "select '2' +'2' union select '5' + '5'";
    $res = mysql_query($query);
    $row = mysql_fetch_array($res);
    
    print_r($row);

    guest, 02 Мая 2009

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

    +148

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <?php if ($curauth->user_status == "Фотограф" && $curauth->konkurs) { echo "
    	<div class=\"bio-left\"><h1>Участие в конкурсах:</h1></div>
    	<div class=\"bio-right\">";
    	echo $curauth->konkurs;
    	echo "</div><div class=\"c-left\"></div>"; } } ?>

    guest, 02 Мая 2009

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

    +143

    1. 1
    ''''''''''''''''''''">LK""":;''''''''''''''''''''''''''">LK""":;''''''

    ''''''''''''''''''''">LK""":;''''''

    guest, 02 Мая 2009

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

    +152

    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
    // Это форма в профиле
    
    <?php   
    	if ( $profileuser->user_status == "Фотограф" ){
    	echo "<tr>
    	<th><label for='konkurs'>Участие в выставках и фотоконкурсах:</label></th>
    	<td><textarea rows='3' cols='30' id='konkurs' name='konkurs' />"; echo $profileuser->konkurs; echo"</textarea></td>
    	</tr>"; } 
    ?>
    
    // Это author.php. Т.е. вывод из того поля на сайт
    
    	<?php if ($curauth->user_status == "Фотограф" && $curauth->konkurs) { echo "
    	<div class=\"bio-left\"><h1>Участие в конкурсах:</h1></div>
    	<div class=\"bio-right\">";
        $array = explode("\r\n", $curauth->konkurs);
    	foreach($array as $link){
    		if(preg_match("/^(http:\/\/{1})((\w+\.){1,})\w{2,}$/i", $link)){
    			echo "<a href=\"$link\">$link</a><br>";	
    		} echo "</div>";
    	} }?>

    guest, 02 Мая 2009

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

    +154

    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
    /*
     *
     *
     *
     */
    
    if(!isset($_POST["links"])){
    	echo '<form action="links.php" method="post">
    <p>Ссылки:</p>
    <p><textarea rows="10" cols="45" name="links"></textarea></p>
    <p><input type="submit" value="Отправить"></p>
    </form>';
    } else {
    	$array = explode("\r\n", $_POST["links"]);
    	foreach($array as $link){
    		if(preg_match("/^(http:\/\/{1})((\w+\.){1,})\w{2,}$/i", $link)){
    			echo "<a href=\"$link\">$link</a><br>";	
    		}
    	}
    }
    ?>

    guest, 02 Мая 2009

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

    +153

    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
    function horiz($flag=0) {
    for ($x=0;$x<$width;$x++) { 
       $cc=imagecolorat($im, $x, $height/2);
    		if($cc!=$bg){
    			for ($y=$height/2;$y<$height;$y++) { 
                               $cc2=imagecolorat($im, $x-1-$flag, $y);
                               if ($cc!=$bg) {
                                 $flag++;
                                 horiz(-1);
                               }
                            }
    
    		}
    }
    }

    guest, 01 Мая 2009

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

    +151

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    // top
    for($iy=0; $iy<$imh; $iy++){
    	for($ix=0; $ix<$imw; $ix+=4){
    		$ndx=imagecolorat($im, $ix, $iy);
    		if($ndx!=$bg){
    			$ymin=$iy;
    			break 2;
    		}
    	}
    }

    guest, 01 Мая 2009

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

    +153

    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
    function showFormEdit($id="",$sMsg="", $p_iPageIndex="")
    	{
    		global $oGlobal;
    		eval( $oGlobal->getGlobalVars() );
    		$oGlobal->importUserClass( "rubik.CMoneyOXConfig");
    		RImporter::importRubikClass("ext.xpbox.RHtmlImageUploadForm");
    		RImporter::importRubikClass("ext.xpbox.RHtmlUploadForm");
    		RImporter::importRubikClass("ext.xpbox.RDbComboboxHtml");
    		$oGlobal->importUserClass("rubik.CRubikHelper");
    		$oModel = $this->m_oModel;
    		$dirHelper= CMoneyOXConfig::getInstance();
    		$sBlast = "Manage Download";
    		$assetPath	=	ASSET_PATH;
    		$helper = new CRubikHelper();
    		$x_title				= htmlentities( @$_POST['x_title'], ENT_QUOTES );
    		$x_type					= @$_POST['x_type'];
    		$x_status				= @$_POST['x_status'];
    		$x_date 				= @$_POST['x_date'];
    		if(!empty($id))
    		{
    			$result = $oModel->getDownloadbyID($id);
    			$record = $result->recordSet;
    			$row = $record[0];
    			$sBlast = "Edit Download";
    			$title = $row['title'];
    			$date= date("Y-m-d ",strtotime($row['date']));
    			if($row['publish']) $sYes= " checked=\"true\"";
    			else $sNo= " checked=\"true\"";
    			//create upload image form
    			$picUpload = new RHtmlImageUploadForm("x_picture",$dirHelper->downloadImageDir,$row['preview_image']);
    			$htmlPicture = $picUpload->createUploadFormHtml(50);
    
    			//create upload file form
    			$fileUpload = new RHtmlUploadForm("x_file",$dirHelper->downloadFileDir,$row['download_image'],".zip,.rar");
    			$htmlFile = $fileUpload->createUploadFormHtml(50);
    
    			//create combobox type
    			$sql = "select id,name from download_setting order by id";
    			$categoryTypeHtml = new RDbComboboxHtml($sql,"id", "name", "type",$row['type']);
    			$cbxType = $categoryTypeHtml->createCombobox();
    
    			$thumb = $helper->getThumbName($row['preview_image'],$dirHelper->downloadThumbDir);
    			$thumb = ABS_PATH.$thumb;
    			$thumb = str_replace("administrator/","",$thumb);
    			$thumbHtml = "<img src=\"{$thumb}\" alt=\"\" class=\"borderimg1\"/><br />
    							<input type=\"checkbox\" name=\"remove\" id=\"x_remove\" value=\"remove\" border=\"0\" /> 
    							Remove Photo";
    
    		}
    			
    		@eval( "\$tpl= \"".getTemplate( "edit.back", COMP_PATH . "templates/back" )."\";" );
    		$sys_sCompContent .= $tpl;
    		return $tpl;
    	}

    Индусы жгут по полной, вот код написанный въетнамцами хех

    14MB в gz, полный ппц, тошнит до сих пор

    guest, 01 Мая 2009

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