- 1
return str_replace("\t", '', str_replace("\n", '', str_replace('"', '\"', get_partial($partial, $data))));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+149
return str_replace("\t", '', str_replace("\n", '', str_replace('"', '\"', get_partial($partial, $data))));
Это вместо простого
return str_replace(array("\n","\t"), '', get_partial($partial, $data));
+160
"trim(.$resultm[1].)"
−84
my $cat='';
if ($q->param('category'))
{
my @originalCategory = $q->param('category')?$q->param('category'):undef;
$cat='and (';
my $arg;
foreach $arg(@originalCategory)
{
$cat.= '(ngf.category=';
$cat.= $arg;
$cat.= ') or ';
}
chop ($cat);chop ($cat);chop ($cat);chop ($cat);
$cat .= ')';
}
формирование where для выборки по категориям указанных пользователем
+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>';
}
не совсем гк, но улыбнуло
+71
String type = ((Map<String, String>) getParams(request, Arrays.asList("type"))).get("type");
нужно было получить данные, мозг сразу выдал место где их можно взять, руки быстро воплотили это в код и немного погодя мозг начал анализировать то, что получилось :)
+153
function read($fields = null, $id = null) {
$this->validationErrors = array();
if ($id != null) {
$this->id = $id;
}
$id = $this->id;
if (is_array($this->id)) {
$id = $this->id[0];
}
if ($id !== null && $id !== false) {
$this->data = $this->find(array($this->alias.'.'.$this->primaryKey => $id), $fields);
return $this->data;
} else {
return false;
}
}
И ещё cakePHP (самый-самый фреймворк, даже в говнокоде впереди планеты всей).
+153
<form method="POST" id="acceptaction" action="/">
<input type="submit" value="Принять участие" name="startUserEvent" />
<input type="hidden" value="62" name="userid" />
</form>
<div id="result"></div>
jQuery(document).ready(function()
{
jQuery("#acceptaction").submit(function(event)) {
event.preventDefault();
var form = jQuery( this ),
term = form.find( 'input[name="userid"]' ).val(),
url = form.attr( 'action' );
jQuery.post( url, { userid: term },
function( data ) {
var content = jQuery( data ).find( '#content' );
jQuery( "#result" ).empty().append( content );
};
);
};
});
+146
<span id="#spanforum"></span>
Забавно ;)
+147
function checkAllRemarks()
{ // ЧТО ЭТО!?!?!?!?17СЕМНАДЦАТЬ!!!!1111
for (i = 0; i < document.getElementsByTagName("input").length; i++)
{
if (document.getElementsByTagName("input")[i].name.split("|").length>=2)
{
if (document.getElementsByTagName("input")[i].name.split("|")[0]=="CBR")
{
if (document.getElementsByTagName("input")[i].name.split("|")[1].length==36)
{
if (document.getElementsByName("allRemarks")[0].checked == true)
document.getElementsByTagName("input")[i].checked = true;
else
document.getElementsByTagName("input")[i].checked = false;
}
}
}
}
}
+146
Админы!
Я КАКАТЬ ХОЧУ!