- 1
 
echo 'some string'."\n";
                                    Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 25
+160
echo 'some string'."\n";
                                    )))
+164
function boolConvert($value){
        if(strtolower($value)=='true')
            return 1;
        if(strtolower($value)=='false')
            return 0;
        return $value;
    }
                                    
+156
checkValidPage:function(){
	    var c=false;
	    var d=false;
	    try{
		var a=document.getElementsByTagName('input');
		if(a.length!=0)
		    for(var i in a)
		    {
			if(!c && a[i].type=='checkbox')
			    c=true;
			if(!d && a[i].name=='delsel')
			    d=true;
			if(c && d)
			    return true;
		    }
	    }catch(e){}
	    return false;
	},
                                    
+128
$w=isset($_POST['w'])?(int)$_POST['w']:time();
    $p=$w-(24*3600)*7;
    $n=$w+(24*3600)*7;
	mysql_query("set @start=date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d'),
		@end=date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')");
    
	$ste=mysql_fetch_assoc(mysql_query('select @start as s,@end as e'));
	 if($_SESSION['userinfo']['login']=='Stormsfb') echo "date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d') <br>date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')<br>".
							"select *,unix_timestamp(d) as u,
							date_format(d,'%e %b') as dm,
							date_format(d,'%m%d') as md,
							date_format(d,'%d.%m.%y') as mdf from users where 
                    date_format(d, '%m%d') between 
                    ".($_POST['month']!='false'?
					date('m',$w).'01 and '.date('mt',$w):
					($ste['s']>$ste['e']?' @start and 1231
					or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'weekday(d)':'date_format(d,"%m%d")');
	$q=mysql_query("select *,unix_timestamp(d) as u,
							date_format(d,'%e %b') as dm,
							date_format(d,'%m%d') as md,
							date_format(d,'%d.%m') as mdf from users where 
                    date_format(d, '%m%d') between 
                    ".($_POST['month']!='false'?
					date('m',$w).'01 and '.date('mt',$w):
					($ste['s']>$ste['e']?' @start and 1231
					or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'md':'date_format(d,"%m%d")'),_LINK_) or die(mysql_error(_LINK_)); // || $ste['s']>$ste['e']
					/*
					это пиздец
					"select *,unix_timestamp(d) as u,
							date_format(d,'%e %b') as dm,
							date_format(d,'%m%d') as md,
							date_format(d,'%d.%m') as mdf from users where 
                    date_format(d, '%m%d') between 
                    ".($_POST['month']!='false'?
					date('m',$w).'01 and '.date('mt',$w):
					($ste['s']>$ste['e']?' @start and 1231
					union select *,unix_timestamp(d) as u,
							date_format(d,"%e %b") as dm,
							date_format(d,"%m%d") as md,
							date_format(d,"%d.%m") as mdf from users where 
                    date_format(d, "%m%d") 
					between '.date('m',$n).'01 and @end ':' @start and @end '))." order by date_format(d, '%m%d')"
					*/
                                    после нас хоть трава не расти!
+154
if(!empty($r['icq'])) 
            {
                $c.='<tr>
                    <td><img src="/template/buttons/icq.png" title="icq" alt="icq"></td>
                    <!-- а может ну его нахуй?<td><a href="/service/icq/icq" > написать в icq</a></td>-->
                    <td>'.$r['icq'].'</a></td>
                </tr>';
            }
                                    не совсем гк, но улыбнуло
+147
function timesec($str) 
{ 
$h = date("H", strtotime($str)); 
$i = date("i", strtotime($str)); 
$s = date("s", strtotime($str)); 
$m = date("m", strtotime($str)); 
$d = date("d", strtotime($str)); 
$y = date("Y", strtotime($str)); 
return mktime($h, $i, $s, $m, $d, $y); 
}
                                    
+163
function shab()
{
  global $title;                            
  global $description;
  global $keywords;
  global $content;                                         
  global $patch;
  global $page_names;
  global $pn;
  global $id;
  include_once $patch.'/head.php'; // почему-то вспомнился логотип башоргру cat /dev/ass > /dev/head
  echo $title.'</title>'."\n";
  echo '<meta name="description" content="'.$description.'">'."\n";
  echo '<meta name="keywords" content="'.$keywords.'">'."\n";
  include_once $patch.'/shapka.php'; // wtf!?
  echo $content."<br>\n";
  if(in_array($pn,$page_names))
  {                                   
      include $patch.'/form.php';
  }
  $ua=mysql_real_escape_string(trim($_SERVER['HTTP_USER_AGENT']));
  $ip=mysql_real_escape_string(trim($_SERVER['REMOTE_ADDR'])); // вебкил не пройдет
  mysql_query("update content set views=views+1 where id='$id'");
  mysql_query("insert into views_content set id='$id', ip='$ip', t=NOW() + INTERVAL 1 HOUR, d=NOW() + INTERVAL 1 HOUR, ua='$ua'");
  $q=mysql_query("select views,t,d from content where id='$id'");
  while($r=mysql_fetch_array($q))
  {
     echo '<br><span style="font-color:#808080; font-size:8pt; float:right;">Просмотров: '.$r['views'].'<br>
     '.$r['d'].'<font color="#ca3200"> / </font>'.$r['t']."<br>\n"; //d и t это дата и время кто не понял :D	
  } 
  echo '<a style="font-color:#ca3200; font-size:10pt;" href="index.php">все статьи</a></span>';
  include_once $patch.'/footer.php';
}
                                    это вам не смарти, тут всё просто и понятно, а главное быстро. shab() и дело в шляпе.
+122
private bool validDir(DirectoryInfo dir)
{
	return dir.Attributes == FileAttributes.Directory &&
	dir.Attributes != FileAttributes.Hidden &&
	dir.Attributes != FileAttributes.NotContentIndexed &&
	dir.Name != "Windows";
}
                                    
+131
<div class="add_from_list"> 
<input type="text" name="Количество товара" value="1" id="lol"> шт. 
<script>
function hz(id,val)
{
var str=id.split('-');
var n='';
for(var i=0;i<3;i++) n+=str[i]+'-';
n+=val;
document.getElementById(id).id=n;
}
</script>
<a href="javascript:return false;" id="good-7307-272,80-1" class="addCart" onclick="hz(this.id,document.getElementById('lol').value);" >Добавить товар</a> 
</div>
                                    
+165
function sorti()
    {
    	if($_GET['where']=='desc'?$where='asc':$where='desc');
    	return 'where='.$where;
    }