- 1
- 2
- 3
<?php
$userTimelog->add($userId, 2, strtotime(date('d.m.Y')));
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146
<?php
$userTimelog->add($userId, 2, strtotime(date('d.m.Y')));
?>
Как можно знать о функции strtotime и не знать о $_SERVER['REQUEST_TIME'] или time()? :D
−136
function iofam(val a)
var fio[3];
fio[1]=""; fio[2]=""; fio[3]="";
a=trimall(a);
while strcountoccur(a," ")>0 do
a=strreplace(a," "," ");
enddo;
i=1;
while (strcountoccur(a," ")>0) and (i<=2) do
fio[i]=left(a,find(a," ")-1);
a=right(a,strlen(a)-1-strlen(fio[i]));
i=i+1;
enddo;
fio[i]=a;
return (left(fio[2],1)+"."+left(fio[3],1)+". "+fio[1]);
endfunction
+161
// Функция определения количества слов в запросе
function kslov($s)
{
for($i=0;$i<=strlen($s)-1;$i++)
{
if(($s[$i]==' ')and(($s[$i+2]==' ')or($s[$i+3]==' '))){$s[$i]='';}
if(($s[$i]==' ')and($s[$i+1]=='')){$s[$i]='';}
if(($s[$i]==' ')and(($s[$i+2]=='')or($s[$i+3]==''))){$s[$i]='';}
if(($s[$i]==' ')and(($s[$i-3]=='')or($s[$i-2]==''))){$s[$i]='';}
}
$mp=explode(' ',$s);
$kp=count($mp);
if($kp>3){$kp=3;}
return $kp;
}
Реальный код...
+160
function createfile1($path,$info){
if(file_exists($path))
{
$fp=fopen($path,'a+');
fputs($fp,$info);
fclose($fp);
}
else
{
$fp=fopen($path,'w+');
fputs($fp,$info);
fclose($fp);
}
}
Функция с говорящим названием и пахнущим содержимым
+159
$time=date("d.m.Y.H.i.s");
$t=explode('.',$time);
$now=mktime($t[3],$t[4],$t[5],$t[1],$t[0],$t[2]);
кручу-верчу, time() хочу
+146
<!--marquee class="red">
С НОВЫМ ГОДОМ !
HAPPY NEW YEAR !
</marquee-->
+161
void convert_bglfile(std::string infile, std::string source_charset, std::string target_charset)
{
std::string outfile;
const char *p = infile.c_str();
const char *p1 = strrchr(p, '.');
if (p1) {
outfile.assign(p, p1-p);
} else {
outfile = infile;
}
...
Из опенсорсного словаря StarDict. Товарисч на форуме написал, что не комилируется - не иклюдился cstring. А там такое :o
+142
function get_row() {
return $this->row;
}
function get_seo_row() {
return $this->seo_row;
}
function get_template() {
return $this->template;
}
function get_paginator() {
return $this->paginator;
}
function get_caption() {
return $this->caption;
}
function get_caption_null() {
return $this->caption_null;
ФункциАнально
+76
if (params[0].toLowerCase().equals("1"))
{
TeleportService.teleportTo(admin, WorldMapType.POETA.getId(), 806, 1242, 119, 0);
PacketSendUtility.sendMessage(admin, "Teleported to Poeta.");
}
else if (params[0].toLowerCase().equals("2"))
{
TeleportService.teleportTo(admin, 320070000, getInstanceId(320070000, admin), 246, 246, 125, 0);
PacketSendUtility.sendMessage(admin, "Teleported to 15-25 PvP arena.");
}
else
PacketSendUtility.sendMessage(admin, "PvP zone not found");
+155
$psd=str_replace(',', '.', trim($csv[5]));
$psd=str_replace('*', '', $psd);
$strs=$psd;
if($strs[(strlen($strs)-1)]==',' || $strs[(strlen($strs)-1)]=='.'){
/*
это пиздец, как я устал