- 1
- 2
- 3
- 4
- 5
- 6
- 7
if (isset($_POST['email']))
{
$email = $_POST['email'];
if ($email == '') {
unset($email);
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 42
+170
if (isset($_POST['email']))
{
$email = $_POST['email'];
if ($email == '') {
unset($email);
}
}
все предусмотрел...
+164
$this->db->Query("DELETE FROM `u_proposal`
WHERE `id` = '%d' AND `user` = '%d'", $item, $this->user->id);
$this->db->Query("DELETE FROM `p_options`
LEFT JOIN `u_proposal` ON `p_options`.`portfolio` = `u_proposal`.`id`
WHERE `p_options`.`portfolio` = '%d' AND `p_options`.`type` = 'project' AND `u_proposal`.`user` = '%d'", $item, $this->user->id);
3 часа еб**ся не мог понять почему записи из p_options не удаляются ))
+145
function ruslat ($string) # Задаём функцию перекодировки кириллицы в транслит.
{
$string = ereg_replace("ж","zh",$string);
$string = ereg_replace("ё","yo",$string);
$string = ereg_replace("й","i",$string);
$string = ereg_replace("ю","yu",$string);
$string = ereg_replace("ь","'",$string);
$string = ereg_replace("ч","ch",$string);
$string = ereg_replace("щ","sh",$string);
$string = ereg_replace("ц","c",$string);
$string = ereg_replace("у","u",$string);
$string = ereg_replace("к","k",$string);
$string = ereg_replace("е","e",$string);
$string = ereg_replace("н","n",$string);
$string = ereg_replace("г","g",$string);
$string = ereg_replace("ш","sh",$string);
$string = ereg_replace("з","z",$string);
$string = ereg_replace("х","h",$string);
$string = ereg_replace("ъ","''",$string);
$string = ereg_replace("ф","f",$string);
$string = ereg_replace("ы","y",$string);
$string = ereg_replace("в","v",$string);
$string = ereg_replace("а","a",$string);
$string = ereg_replace("п","p",$string);
$string = ereg_replace("р","r",$string);
$string = ereg_replace("о","o",$string);
$string = ereg_replace("л","l",$string);
$string = ereg_replace("д","d",$string);
$string = ereg_replace("э","yе",$string);
$string = ereg_replace("я","jа",$string);
$string = ereg_replace("с","s",$string);
$string = ereg_replace("м","m",$string);
$string = ereg_replace("и","i",$string);
$string = ereg_replace("т","t",$string);
$string = ereg_replace("б","b",$string);
$string = ereg_replace("Ё","yo",$string);
$string = ereg_replace("Й","I",$string);
$string = ereg_replace("Ю","YU",$string);
$string = ereg_replace("Ч","CH",$string);
$string = ereg_replace("Ь","'",$string);
$string = ereg_replace("Щ","SH'",$string);
$string = ereg_replace("Ц","C",$string);
$string = ereg_replace("У","U",$string);
$string = ereg_replace("К","K",$string);
$string = ereg_replace("Е","E",$string);
$string = ereg_replace("Н","N",$string);
$string = ereg_replace("Г","G",$string);
$string = ereg_replace("Ш","SH",$string);
$string = ereg_replace("З","Z",$string);
$string = ereg_replace("Х","H",$string);
$string = ereg_replace("Ъ","''",$string);
$string = ereg_replace("Ф","F",$string);
$string = ereg_replace("Ы","Y",$string);
$string = ereg_replace("В","V",$string);
$string = ereg_replace("А","A",$string);
$string = ereg_replace("П","P",$string);
$string = ereg_replace("Р","R",$string);
$string = ereg_replace("О","O",$string);
$string = ereg_replace("Л","L",$string);
$string = ereg_replace("Д","D",$string);
$string = ereg_replace("Ж","Zh",$string);
$string = ereg_replace("Э","Ye",$string);
$string = ereg_replace("Я","Ja",$string);
$string = ereg_replace("С","S",$string);
$string = ereg_replace("М","M",$string);
$string = ereg_replace("И","I",$string);
$string = ereg_replace("Т","T",$string);
$string = ereg_replace("Б","B",$string);
return $string;
}
+163
$year = date("Y");
$month = date("m");
$day = date("d");
if ($month == 9 or $month == 10 or $month == 11)
{
$month_new = $month + 1;
echo $year.'-'.$month_new.'-'.$day;
}
else
{
if ($month == 12) {$year_new = $year + 1;
$year_new = $year + 1;
$month_new = 1;
echo $year_new.'-0'.$month_new.'-'.$day; }
else {
$month_new = $month + 1;
echo $year.'-0'.$month_new.'-'.$day;}
}
не удержался )
+163
// what version of MySQL
$mysql = $db->query_first("SELECT VERSION() AS version");
$mysql = $mysql['version'];
// Post count
$posts = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "post");
$posts = $posts['total'];
// User Count
$users = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "user");
$users = $users['total'];
// Forum Count
$forums = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "forum");
$forums = $forums['total'];
// Usergroup Count
$usergroups = $db->query_first("SELECT COUNT(*) AS total FROM " . TABLE_PREFIX . "usergroup");
$usergroups = $usergroups['total'];
// First Forum Post
$firstpost = $db->query_first("SELECT MIN(dateline) AS firstpost FROM " . TABLE_PREFIX . "post");
$firstpost = $firstpost['firstpost'];
// Last upgrade performed
$lastupgrade = $db->query_first("SELECT MAX(dateline) AS lastdate FROM " . TABLE_PREFIX . "upgradelog");
$lastupgrade = $lastupgrade['lastdate'];
от туда же
плять... сюда надо весь форум постить
нахер архив сношу к еб**ям
+162
if ($_POST['do'] == 'kill')
{
// update users who are in this usergroup to be in the registered usergroup
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET displaygroupid = 0 WHERE displaygroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("UPDATE " . TABLE_PREFIX . "useractivation SET usergroupid = 2 WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("UPDATE " . TABLE_PREFIX . "subscription SET nusergroupid = -1 WHERE nusergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("UPDATE " . TABLE_PREFIX . "subscriptionlog SET pusergroupid = 2 WHERE pusergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("UPDATE " . TABLE_PREFIX . "userban SET usergroupid = 2 WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("UPDATE " . TABLE_PREFIX . "userban SET displaygroupid = 0 WHERE displaygroupid = " . $vbulletin->GPC['usergroupid']);
// now get on with deleting stuff...
$db->query_write("DELETE FROM " . TABLE_PREFIX . "usergroup WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "forumpermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "ranks WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "usergrouprequest WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "userpromotion WHERE usergroupid = " . $vbulletin->GPC['usergroupid'] . " OR joinusergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "imagecategorypermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "attachmentpermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
$db->query_write("DELETE FROM " . TABLE_PREFIX . "prefixpermission WHERE usergroupid = " . $vbulletin->GPC['usergroupid']);
vBulletin 4.0.4
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
+158
if ($_GET[action] == "avatar") {
if ($info = $_GET[info]) {
if ($info[avatar]) {
echo $info[avatar];
} else {
header("Content-type: image/png");
$im = imagecreatetruecolor(80, 80);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 80, 80, $white);
$font = "fonts/avatar.ttf";
$text = "HET";
imagettftext($im, 20, 0, 15, 40, $grey, $font, $text);
imagettftext($im, 20, 0, 14, 39, $black, $font, $text);
$text = "ABATAPA";
imagettftext($im, 14, 0, 5, 55, $grey, $font, $text);
imagettftext($im, 14, 0, 4, 54, $black, $font, $text);
imagepng($im);
imagedestroy($im);
}
} else {
header("Content-type: image/png");
$im = imagecreatetruecolor(80, 80);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 80, 80, $white);
$font = "fonts/avatar.ttf";
$text = "HET";
imagettftext($im, 20, 0, 15, 40, $grey, $font, $text);
imagettftext($im, 20, 0, 14, 39, $black, $font, $text);
$text = "ABATAPA";
imagettftext($im, 14, 0, 5, 55, $grey, $font, $text);
imagettftext($im, 14, 0, 4, 54, $black, $font, $text);
imagepng($im);
imagedestroy($im);
}
}
Вот такое говнецо встретилось))
+167
$new = preg_replace("/((\[{1}[^\[\]]+\]{1})|(\[{1}\]{1}))/", "", $a);
метод тыка.... зато работеат
+164
$str="T:/home//localhost///MyScripts/////";
$pos=strpos($str,"//");
while($pos!=false)
{
$str=str_replace("//","/",$str);
$pos=strpos($str,"//");
}
функция удаляет повторяющиеся слэши в строке
+172
<ul>
<li><a href="/" title="<?php echo $this->lang->topMenu->home->title;?>"><?php echo $this->lang->topMenu->home->name;?></a></li>
<li><a id="searchShow" title="<?php echo $this->lang->topMenu->search->title;?>"><?php echo $this->lang->topMenu->search->name;?></a></li>
<li><a id="chatShow" title="<?php echo $this->lang->topMenu->chat->title;?>"><?php echo $this->lang->topMenu->chat->name;?></a></li>
<li><a href="/designers.htm" title="<?php echo $this->lang->topMenu->designers->title;?>"><?php echo $this->lang->topMenu->designers->name;?></a></li>
<li><a href="/developers.htm" title="<?php echo $this->lang->topMenu->developers->title;?>"><?php echo $this->lang->topMenu->developers->name;?></a></li>
<li><a href="/login.htm" title="<?php echo $this->lang->topMenu->login->title;?>"><?php echo $this->lang->topMenu->login->name;?></a></li>
<li><a id="registerShow" href="/register.window.htm" title="<?php echo $this->lang->topMenu->register->title;?>"><?php echo $this->lang->topMenu->register->name;?></a></li>
<li><a href="/fadeback.htm" title="<?php echo $this->lang->topMenu->fadeback->title;?>"><?php echo $this->lang->topMenu->fadeback->name;?></a></li>
</ul>
ООП )