- 1
if (!function_exists('function_exists')) die('o_O');
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+174
if (!function_exists('function_exists')) die('o_O');
существует или нет, вот в чем вопрос
+153
<?php
/*
$Id: specials.php,v 1.1.1.1 2004/03/04 23:42:27 ccwjr Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
CRE Loaded , Open Source E-Commerce Solutions
http://www.creloaded.com
Chain Reaction Works, Inc
Portions: Copyright © 2005 - 2006 Chain Reaction Works, Inc.
Last Modified by $Author$
Last Modifed on : $Date$
Latest Revision : $Revision:$
Released under the GNU General Public License
*/
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = 'G';
} else {
$customer_group_id = $sppc_customer_group_id;
}
$random_product25 = tep_db_query("select distinct
p.products_id,
pd.products_name,
IF(pg.customers_group_price IS NOT NULL,pg.customers_group_price, p.products_price) as products_price,
p.products_tax_class_id,
p.products_image,
s.specials_new_products_price
from " . TABLE_PRODUCTS . " p
left join " . TABLE_PRODUCTS_GROUPS . " pg on p.products_id = pg.products_id and pg.customers_group_id like '%" . $customer_group_id . "%',
" . TABLE_PRODUCTS_DESCRIPTION . " pd,
" . TABLE_SPECIALS . " s
where
p.products_status = '1'
and p.products_id = s.products_id
and pd.products_id = s.products_id
and pd.language_id = '" . (int)$languages_id . "'
and s.status = '1'
and p.products_group_access like '%". $customer_group_id."%'
order by rand(), s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS);
$random_product24_side_row = tep_db_num_rows($random_product25);
if ($random_product24_side_row > 0){
// EOF Separate Price per Customer
//Eversun mod end for sppc and qty price breaks
?>
<!-- d specials //-->
<tr>
<td>
<?php
while ($product_specials22 = tep_db_fetch_array($random_product25)){
$product_specials22_id = $product_specials22['products_id'];
$product_specials22_image = tep_get_products_image($product_specials22['products_id']);
$product_specials22_name = tep_get_products_name($product_specials22['products_id']);
$pf->loadProduct($product_specials22['products_id'],$languages_id);
$special_random_price = $pf->getPriceStringShort();
}
$info_box_contents = array();
$info_box_contents[] = array('text' => '<font color="' . $font_color . '">' . BOX_HEADING_SPECIALS . '</font>');
new infoBoxHeading($info_box_contents, tep_href_link(FILENAME_SPECIALS));
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . tep_image(DIR_WS_IMAGES . $product_specials22_image, $product_specials22_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_specials22_id) . '">' . $product_specials22_name . '</a><br>' . $special_random_price);
new infoBox($info_box_contents);
if (TEMPLATE_INCLUDE_FOOTER =='true'){
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => tep_draw_separator('pixel_trans.gif', '100%', '1')
);
new infoboxFooter($info_box_contents);
}
?>
</td>
</tr>
<!-- d specials_eof //-->
<?php
}
?>
Судя по всему, это говнокод с CRE Loaded. Это кусок дерьма, еще и продается за большие деньги!
+78.5
if (choice==0)
new Browser(null, display, this, this, false);
if (choice==1)
new Browser(null, display, this, this, true);
if (choice==2)
new Browser(null, display, this, this, false);
if (choice==3)
new Browser(null, display, this, this, true);
if (choice==4)
new Browser(null, display, this, this, false);
if (choice==5)
new Browser(null, display, this, this, true);
if (choice==6)
new Browser(null, display, this, this, false);
if (choice==7)
new Browser(null, display, this, this, true);
Сохранить, загрузить, сохранить, загрузить...
+147
<?php
/***************************************************************************
* usercp_activate.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : [email protected]
*
* Id: usercp_activate.php,v 1.6.2.9 2005/09/14 18:14:30 acydburn Exp
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
exit;
}
Рихиты что ж тут еще скажешь...
+158.1
for( $i = 0 ; $i < strlen( $field_amount ); $i++ ) {
$letter = substr( $field_amount, $i, 1 );
if ( $letter == '0' || $letter == '1' || $letter == '2' || $letter == '3' || $letter == '4' || $letter == '5' || $letter == '6' || $letter == '7' || $letter == '8' || $letter == '9' ) {
$amount .= $letter;
}
}
$field_amount = $amount;
Разбирая сорцы биллинговой системы...
+151
procedure TWorld.Update(dTime: Single);
var
i,j: integer;
temp: TVector2f;
begin
for i:=0 to Count-1 do
begin
if Bodyes[i]^.Static then break else
for j:=0 to Bodyes[i]^.Count-1 do
begin
Bodyes[i]^.AccumulateForces[j]:=Gravitation;
temp:=Bodyes[i]^.Position[j];
Bodyes[i]^.Position[j].x:=Bodyes[i]^.Position[j].x+
(Bodyes[i]^.Position[j].x-Bodyes[i]^.OldPosition[j].x)+
Bodyes[i]^.AccumulateForces[j].x*dTime*dTime;
Bodyes[i]^.Position[j].y:=Bodyes[i]^.Position[j].y+
(Bodyes[i]^.Position[j].y-Bodyes[i]^.OldPosition[j].y)+
Bodyes[i]^.AccumulateForces[j].y*dTime*dTime;
Bodyes[i]^.OldPosition[j]:=temp;
end;
end;
end;
Моделирование системы частиц через интегрирование Верлета
+63.9
Procedure CalcStep;
var key : char;
{Calculates the direction}
begin
if keypressed then
begin
key:=readkey;
if key in [#77,#75,#80,#72,#27] then
begin SnakeDr:=key; CalcStep; end;
end
else
case SnakeDr of
#72 : if snake[1].y=1 then snake[1].y:=23 else dec(snake[1].y);
#80 : if snake[1].y=23 then snake[1].y:=1 else inc(snake[1].y);
#75 : if snake[1].x=1 then snake[1].x:=78 else dec(snake[1].x);
#77 : if snake[1].x=78 then snake[1].x:=1 else inc(snake[1].x);
end;
end;
Нашел тут собственное творчество. Судя по всему писал в нетрезвом состоянии, ибо сейчас с трудом понимаю, зачем здесь такая рекурсия? О_о
+152.3
if($_POST[tel]=='')
{
print "<script language=\"javascript\">\n";
print "showmsg('tel');\n";
print "</script>\n";
}
if($_POST[name]=='')
{
print "<script language=\"javascript\">\n";
print "showmsg('name');\n";
print "</script>\n";
}
if(($_POST[name]!='')&&($_POST[tel]!=''))
{
print "<meta http-equiv=\"Refresh\" content=\"0;URL=send.php?name=$_POST[name]&tel=$_POST[tel]\" />\n";
die();
}
Разбираю один движок инет-магазина. Первое что я понял - автор идиот. Второе - он совершенно ничего не знает об elseif'ах
+148
if (row[0]["IsAdmin"].ToString() == "True")
{
return true;
}
else
{
return false;
}
+150
if (a) b = true; else b = false;
В реале видел. Тупил минут 5, пытаясь понять внутренний смысл этой конструкции