- 1
$limit = (isset($this->params['pass'][1]) == 'news')?null:5;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+166
$limit = (isset($this->params['pass'][1]) == 'news')?null:5;
балина, и это работает :D
+165.9
//Shop-Script PREMIUM
// -------------------------INITIALIZATION-----------------------------//
//include core files
include("./cfg/connect.inc.php");
include("./includes/database/".DBMS.".php");
include("./cfg/language_list.php");
include("./core_functions/functions.php");
include("./core_functions/category_functions.php");
include("./core_functions/cart_functions.php");
include("./core_functions/product_functions.php");
include("./core_functions/statistic_functions.php");
include("./core_functions/reg_fields_functions.php" );
include("./core_functions/registration_functions.php" );
include("./core_functions/country_functions.php" );
include("./core_functions/zone_functions.php" );
include("./core_functions/datetime_functions.php" );
include("./core_functions/order_status_functions.php" );
include("./core_functions/order_functions.php" );
include("./core_functions/aux_pages_functions.php" );
include("./core_functions/picture_functions.php" );
include("./core_functions/configurator_functions.php" );
include("./core_functions/option_functions.php" );
include("./core_functions/search_function.php" );
include("./core_functions/discount_functions.php" );
include("./core_functions/custgroup_functions.php" );
include("./core_functions/shipping_functions.php" );
include("./core_functions/payment_functions.php" );
include("./core_functions/tax_function.php" );
include("./core_functions/currency_functions.php" );
include("./core_functions/module_function.php" );
include("./core_functions/crypto/crypto_functions.php");
include("./core_functions/quick_order_function.php" );
include("./core_functions/setting_functions.php" );
include("./core_functions/subscribers_functions.php" );
include("./core_functions/version_function.php" );
include("./core_functions/discussion_functions.php" );
include("./core_functions/order_amount_functions.php" );
include("./core_functions/linkexchange_functions.php" );
include("./core_functions/affiliate_functions.php" );
include('./classes/xml2array.php');
include('./classes/class.virtual.shippingratecalculator.php');
include('./classes/class.virtual.paymentmodule.php');
include('./classes/class.virtual.smsmail.php');
include('./modules/smsmail/class.smsnotify.php');
MagicQuotesRuntimeSetting();
//init Smarty
require 'smarty/smarty.class.php';
500!
Весь сайт работает только на index.php. И грузит систему это безбожно.
Взято из Shop-Script PREMIUM.
+165.7
function sendClicked(F)
{
var binary = document.getElementById("binary");
var binary_file = binary.value;
var binary_len = binary_file.length;
if(binary_file == ""){
binary.focus();
alert('File name can not be empty !');
return false;
}
else {
if(binary_len<=4) {
binary.focus();
alert('File is wrong !');
return false;
}
if(binary_file.charAt(0) != '/') {
if(binary_file.charAt(1) != ':') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
if(binary_file.charAt(binary_len-4) != '.') {
binary.focus();
alert('File is wrong !!');
return false;
}
if(binary_file.charAt(binary_len-3) != 'B') {
if(binary_file.charAt(binary_len-3) != 'b') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
if(binary_file.charAt(binary_len-2) != 'I') {
if(binary_file.charAt(binary_len-2) != 'i') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
if(binary_file.charAt(binary_len-1) != 'N') {
if(binary_file.charAt(binary_len-1) != 'n') {
binary.focus();
alert('File is wrong !!');
return false;
}
}
show_div(true, "progress_div");
progress();
return true;
}
}
</script>
Со странички обновления прошивки DWL-G700AP. Из-за этого говнокода прошивается только из internet explorer.
+165.7
cycle_0001: loop cycle_0001
обнуление ECX
+165.6
<?
/******************************************************************************
Набор функций для фрмирования контента страницы сайт
******************************************************************************/
function GetAnnnounses($dp){
global $shopid,$db,$ll;
$qwe=$db->query("SELECT ap.position,ac.content,ac.name
FROM announce_pages ap,
announce_content ac
WHERE ap.owner=".$shopid."
AND ap.page=".$ll['id']."
AND ap.line".$dp."
AND ac.owner=".$shopid."
AND ac.id=ap.announse
AND ac.publish=1
GROUP BY 1,2
ORDER BY ac.updated");
while($v=$db->fetch_row($qwe)){
$an[$v[0]][] = $v[1]; //content
$at[$v[0]][] = $v[2]; //title
} //while v
if((is_array($an)) && (($ll['announse_before']+$ll['announse_after'])>0)){
$qwe=$db->query("SELECT id,main_shab,template_type,title
FROM templates
WHERE owner=".$shopid."
AND id IN(".$ll['announse_before'].",".$ll['announse_after'].")");
while($v=$db->fetch_row($qwe)){
if($v[1]=='') continue;
$i=($v[0]==$ll['announse_before']) ? 0 : 1;
$cnt=(is_array($an[$i])) ? join("\n",$an[$i]) : $an[$i];
//все объявления блока входят в один шаблон
if($v[2]==0) $an[$i]=str_replace(array("{title}","{content}"),
array($v[3],$cnt),
$v[1]);
//под каждое объявление свой экземпляр шаблона
else{
reset($an[$i]);
while(list($o,$vl)=each($an[$i])) $an[$i][$o]=str_replace(array("{title}","{content}"),
array($at[$i][$o],$vl),
************ ПРОПУЩЮ Г*********** И ДАЛЕЕ ПРОСТО ФИШИН!!!!!!!!!
function getMainContent(&$d,&$post,$shab=1){
global $shopid,$db,$path,$af,$dar,$dfc,$dtc,$ll,$cpc,$dir,$root,$domain,$swp,
$fl,$tv,$ln,$fr,$ud,$m,$u,$fn,$info,$ni,$bd,$ffp,$fn,$uf,$dfa,$dx,$fla,
$st,$ba,$ds,$mid,$mia,$pma,$tm,$mt,$dts,$ft,$sc,$dis,$fcnt,$pub,$auth,
$otp,$ans,$dh,$ds,$nms,$tps,$pgs,$dh,$str,$spr,$bid,$dr,$fdp,$mmm,
$ass,$dss,$clmn,$dclmn,$fn,$at,$aclmn,$fclmn,$da,$da2,$nc,$crs,$aodh,
$pcol,$rc,$vr,$cc,$cnm,$no,$lclmn,$cur,$tmp,$tdl,$cln,$fldc,$ms,$un,$ii,
$oid,$sid,$stb,$msh,$kid,$sqt,$stn,$sss,$tta,$ic,$view,$cid,$pid,$nt,$sord,
$add,$pr,$mas,$gd,$scc,$ppp,$rpr,$sclmn,$sln,$sos,$tov,$lim,$p,$r,$tic,
$ftp,$free,$did,$line,$dstr,$dm,$img,$script,$sid,$parent,$ordinal,$uf,
$cca,$csa,$ccc,$dop,$cba,$cfa,$cft,$cai,$cfd,$cfc,$ccs,$cur,$dtc,$dfc,
$repeat,$rh,$me,$sc,$dis,$tpl,$flt,$iw,$url,$dm,$ddd,$otmp,$fl,$ur,$ug,
$onload,$cl,$dr,$fdp,$pm,$dm,$num,$fmid,$url,$str,$mls,$dm,$pm,$mis,$way,
$pa,$pms,$val,$last,$prop,$url,$is,$us,$uw,$used,$na,$pat,$rep,$un,$sc,$dis,
$dt,$ga,$ds,$nms,$tps,$pgs,$fpg,$dln,$uln,$loc,$dms,$gt,$ni,$spam,$arr,
$fld,$cnt,$fa,$uf,$atf,$dfa,$fib,$equal,$c,$tid,$ttl,$short_ttl,$css,
$add,$oid,$sqt,$stb,$stn,$da,$da2,$pr,$clmn,$mas,$gd,$path,$scc,$tov,$svs,$sva,
$sss,$rpr,$sclmn,$sln,$sos,$ft,$aclmn,$tov,$lim,$ppp,$answ,$rln,$ver,$scom,
$cr,$sc,$cc,$ccn,$rc;
$me = $_SESSION['usr'][$shopid];
switch($post['i']){
case 1: //вносим изменения в свой профайл на сайте
if(!empty($me)){include($path."site/auth/edit_profile.php");}
break;
case 2: //форма запроса на восстановление пароля
if(empty($me)){include($path."site/auth/restore_pwd.php");}
break;
case 3: //аккаунт юзера заблокирован
case 4: //неверный логин/пароль
case 5: //удачная авторизация
case 18: //пароль изменен
include($path."panel/structure/dop_fields/announses/get_mes.php");
$spam = $gt = 1;
$mma = array(3=>9,4=>14,5=>15,18=>22);
$d = get_mes($mma[$post['i']],1);
break;
case 9: //subscribe :: не верно указан email
продолжение говноцмс, причем платная!!!!!!!!!
+165.5
foreach($data as $k=>$v)
{
if(!isset($data[$k]))
{
$data[$k] = $v;
}
}
+165.4
<form style="height:15px ; width:100px"method=post name='ChangeCurrencyForm'>
{literal}
<script language='JavaScript'>
function _changeCurrency()
{
document.ChangeCurrencyForm.submit();
}
</script>
{/literal}
<select name='current_currency' onchange='JavaScript:_changeCurrency()'>
{section name=i loop=$currencies}
{if $log eq "" && $currencies[i].CID eq 2 | $currencies[i].CID eq 3 | $currencies[i].CID eq 4 | $currencies[i].CID eq 5 | $currencies[i].CID eq 6}
{*розница*} {elseif ($log eq "" or $log eq "" or $log eq "tigrakiev") && $currencies[i].CID eq 2 | $currencies[i].CID eq 3 | $currencies[i].CID eq 5 | $currencies[i].CID eq 6}
{*мелкий опт*} {elseif ($log eq "" or $log eq "") && $currencies[i].CID eq 2 | $currencies[i].CID eq 3 | $currencies[i].CID eq 4 | $currencies[i].CID eq 6}
{*опт*} {elseif ($log eq "") && $currencies[i].CID eq 2 | $currencies[i].CID eq 3 | $currencies[i].CID eq 4 | $currencies[i].CID eq 5}
{*плейлист*} {elseif ($log ne "" && $log ne "" && $log ne "" && $log ne "" && $log ne "" && $log ne "" && $log ne "") && $currencies[i].CID eq 2 | $currencies[i].CID eq 3 | $currencies[i].CID eq 4 | $currencies[i].CID eq 5 | $currencies[i].CID eq 6}
{else}
<option value='{$currencies[i].CID}'
{if $currencies[i].CID eq $current_currency}
selected
{/if}
>
{$currencies[i].Name}
</option>
{/if}
{/section}
</select>
+165.4
<script language="JavaScript">
function change_city()
{
document.getElementById("header_18").style.display='none';
document.getElementById("header_18_add").style.display='block';
document.getElementById("header_18_add").id='header_18'; //т.к. стили прописаны для id
}
</script>
</head>
<body>
<div id="mega_scroller">
<div id="mega_scroller">
document.getElementById("header_18_add") .id='header_18'; //т.к. стили прописаны для id
http://www.cinemapark.ru/ - гении делали
+165.4
DoSubmit(){var subt=false;if(!subt){subt=true;document.fmHF.submit();}}
...
<body onload="javascript:DoSubmit();">
мелкомягкие в своем духе..
+165.3
$articles = ServiceArticles::getArticlesList($page->pageID, ARTICLE_TYPE_ARTICLE, 0, 1);
foreach ($articles as $article) $articleID = $article;
$article = new ServiceArticles($articleID);
Обнаружено во время рефизии кода. Блок показа одной новости. Возвращается обычный неассоциативный массив. Нахера foreach вместо $articles[0], даже автор толком объяснить не смог.