- 1
- 2
- 3
- 4
public function __destruct()
{
unset($this);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+164
public function __destruct()
{
unset($this);
}
+164
$result = array(
'clips' => $clips,
'block_title' => $title,
'clips_count' => sizeof($clips),
);
$this->view->assign('clips', $result['clips']);
$this->view->assign('block_title', $result['block_title']);
$this->view->assign('clips_count', $result['clips_count']);
Оптимизируя читабельность :)
+164
var fffuuuuuu = jQuery.browser.msie && parseInt(jQuery.browser.version) < 7 ? true : false
+164
switch ($_REQUEST['period'])
{
case 7: $period_checked_1='checked="checked"';break;
case 14: $period_checked_2='checked="checked"';break;
case 30: $period_checked_3='checked="checked"';break;
case 90: $period_checked_4='checked="checked"';break;
case 180: $period_checked_5='checked="checked"';break;
case 360: $period_checked_6='checked="checked"';break;
case 720: $period_checked_7='checked="checked"';break;
case 'all_period': $period_checked_8='checked="checked"';break;
}
// следующий код повторяется через каждые 20 строк 5 раз
/**НАСТРОЙКИ**/
$num=25; //количество записей на странице
$page = $_GET['page'];
$posts=stats::count_prod($brand);
$total = intval(($posts - 1) / $num) + 1;
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
$end=$page * $num;
/*************/
выдержки из "спагетти-кода" нашего нового программиста, которого вчера уволили.
теперь приходится копаться в этом говне
+164
$('.button').bind('click', function(){
t = $(this);
$('.vote-vk').attr('title', t.attr('title')).attr('summary', t.attr('summary')).attr('url', t.attr('url')).attr('image', t.attr('image'));
$('.vote-twitter').attr('title', t.attr('title')).attr('summary', t.attr('summary')).attr('url', t.attr('url')).attr('image', t.attr('image'));
$('.vote-fb').attr('title', t.attr('title')).attr('summary', t.attr('summary')).attr('url', t.attr('url')).attr('image', t.attr('image'));
});
http://memecombat.ru/
+164
$('#menu_block').each…
Дальше не смотрел.
+164
if (VDIC_web_form_address.match(regWFAcustom))
{
URLDecode(VDIC_web_form_address,'YES');
TEMP_VDIC_web_form_address = decoded;
TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, '');
}
else
{
web_form_vars =
"&lead_id=" + document.vicidial_form.lead_id.value +
"&vendor_id=" + document.vicidial_form.vendor_lead_code.value +
"&list_id=" + document.vicidial_form.list_id.value +
"&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value +
"&phone_code=" + document.vicidial_form.phone_code.value +
"&phone_number=" + document.vicidial_form.phone_number.value +
"&title=" + document.vicidial_form.title.value +
"&first_name=" + document.vicidial_form.first_name.value +
"&middle_initial=" + document.vicidial_form.middle_initial.value +
"&last_name=" + document.vicidial_form.last_name.value +
"&address1=" + document.vicidial_form.address1.value +
"&address2=" + document.vicidial_form.address2.value +
"&address3=" + document.vicidial_form.address3.value +
"&city=" + document.vicidial_form.city.value +
"&state=" + document.vicidial_form.state.value +
"&province=" + document.vicidial_form.province.value +
"&postal_code=" + document.vicidial_form.postal_code.value +
"&country_code=" + document.vicidial_form.country_code.value +
"&gender=" + document.vicidial_form.gender.value +
"&date_of_birth=" + document.vicidial_form.date_of_birth.value +
"&alt_phone=" + document.vicidial_form.alt_phone.value +
"&email=" + document.vicidial_form.email.value +
"&security_phrase=" + document.vicidial_form.security_phrase.value +
"&comments=" + document.vicidial_form.comments.value +
"&user=" + user +
"&pass=" + pass +
"&campaign=" + campaign +
"&phone_login=" + phone_login +
"&original_phone_login=" + original_phone_login +
"&phone_pass=" + phone_pass +
"&fronter=" + fronter +
"&closer=" + user +
"&group=" + group +
"&channel_group=" + group +
"&SQLdate=" + SQLdate +
"&epoch=" + UnixTime +
"&uniqueid=" + document.vicidial_form.uniqueid.value +
"&customer_zap_channel=" + lastcustchannel +
"&customer_server_ip=" + lastcustserverip +
"&server_ip=" + server_ip +
// ...еще строчек 30...
"&user_custom_five=" + VU_custom_five + '' +
"&preset_number_a=" + CalL_XC_a_NuMber + '' +
"&preset_number_b=" + CalL_XC_b_NuMber + '' +
"&preset_number_c=" + CalL_XC_c_NuMber + '' +
"&preset_number_d=" + CalL_XC_d_NuMber + '' +
"&preset_number_e=" + CalL_XC_e_NuMber + '' +
"&preset_dtmf_a=" + CalL_XC_a_Dtmf + '' +
"&preset_dtmf_b=" + CalL_XC_b_Dtmf + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
web_form_vars = web_form_vars.replace(regWF, '');
var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig");
web_form_vars = web_form_vars.replace(regWFspace, '+');
web_form_vars = web_form_vars.replace(regWF, '');
var regWFAvars = new RegExp("\\?","ig");
if (VDIC_web_form_address.match(regWFAvars))
{web_form_vars = '&' + web_form_vars}
else
{web_form_vars = '?' + web_form_vars}
TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars;
var regWFAqavars = new RegExp("\\?&","ig");
var regWFAaavars = new RegExp("&&","ig");
TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAqavars, '?');
TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAaavars, '&');
}
+164
function AuthorizeUser()
{
global $USER;
if ( ( $USER->IsAuthorized() && $USER->GetID() == $this->GetUserID()) || $USER->IsAdmin())
{
return true;
}
else if ($this->AuthorizeByIP())
{
return true;
}
else if (1==2)
{
return true;
}
return false;
}
А вдруг?
+164
/**
* @class Session
* @brief Класс для управления безопасностью на сайте.
* тут еще многа инфы
*/
// Отрывки из классы
public static function auth($email, $password)
{
$result = 0;
$email = strtolower($email);
$dbh = DB::select("SELECT id, is_active, confirm_code FROM ".TB_USERS."
WHERE email='".$email."' AND password='".md5($email.$password)."' LIMIT 1");
...
// Замечу что $email и $password получены при помощи мега крутой функции http://govnokod.ru/5901
public static function get($mode = 0, $role = 0)
{
$result = false;
list ($session_id, $user_id) = self::getcookie();
if(!empty($session_id))
{
self::$id = $session_id;
$dbh = DB::select("SELECT u.email, u.role FROM ".TB_SESSION." AS s LEFT JOIN ".TB_USERS." AS u ON s.user_id=u.id
WHERE s.id='".$session_id."' AND s.user_id=".$user_id.($role > 0 ? " AND u.role&".$role : "")." LIMIT 1");
...
protected static function getcookie()
{
$parts = explode(BOUND, (isset($_COOKIE[self::$name]) ? $_COOKIE[self::$name] : ""));
if(sizeof($parts) != 2)
{
$parts = array("", 0);
}
else
{
$parts[0] = encode($parts[0]);
$parts[1] = (int)$parts[1];
}
return $parts;
}
// А вот и encode
function encode($value, $html_encode = true)
{
$value = trim((string)$value);
if(empty($value)) return false;
if($html_encode)
{
$value = htmlspecialchars($value, ENT_QUOTES);
}
$search = array('/"/', "/'/", "/\\\\"/", "/\\\\'/", "/<\?/", "/\?>/");
$replace = array(""", "'", """, "'", "<?", "?>");
return preg_replace($search, $replace, $value);
}
Улыбнула третья строка.
+164
$list_n_price[] = $n_price;
?>
<? } ?>
<?
for ($n_ar = 0; (count($list) - $n_ar) >= 4; $n_ar +=4) {
это человек писал ? 0_о