- 1
- 2
//-----Если жмут submit(кнопку)-----//
if(isset($_REQUEST['reg']))
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+2
//-----Если жмут submit(кнопку)-----//
if(isset($_REQUEST['reg']))
Really ? :D
+5
$sql = mysql_query("SELECT * FROM `news` ORDER BY `id` DESC LIMIT 1");
while($sql1 = mysql_fetch_assoc($sql))
{
echo ''.smile(bb($sql1['text'])).'<br />
Добавил: '.nick($sql1['avtor']).'<br />
<a href="/news/comment'.$sql1['id'].'">Комментарии:</a> ('.mysql_result(mysql_query('select count(`id`) from `news_com` where `news` = "'.$sql1['id'].'"'),0).')';
if($user['id']) {
echo '<br /><a href="?news='.$sql1['id'].'">Скрыть новость</a>';}
if(isset($_GET['news']))
{
$news= trim(intval($_GET['news']));
mysql_query("UPDATE `users` SET `news` = '".$news."' WHERE `id` = '".$user['id']."'");
header('Location: '.$HOME.'');
}
}
Исходники супер сильной cms 2016 ! Встречайте StrongCMS! Версия движка 1.1. Скачать можно на strongcms.ru :)
+1
header.php
<?$APPLICATION->IncludeComponent(
"lenal:lenal.menu",
"mobile",
array(
"VIEW_MODE" => "LINE",
"SHOW_PARENT_NAME" => "Y",
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "39",
"SECTION_ID" => $_REQUEST["SECTION_ID"],
"SECTION_CODE" => "",
"SECTION_URL" => "",
"COUNT_ELEMENTS" => "N",
"TOP_DEPTH" => "1",
"SECTION_FIELDS" => array(
0 => "",
1 => "",
),
"SECTION_USER_FIELDS" => array(
0 => "UF_MOST_POPULAR",
1 => "",
),
"ADD_SECTIONS_CHAIN" => "Y",
"CACHE_TYPE" => "A",
"CACHE_TIME" => "36000000",
"CACHE_GROUPS" => "Y",
"COMPONENT_TEMPLATE" => "ds_main_menu",
"MAX_COUNT" => "12",
"MAX_ACTIONS" => "4",
"MAX_POPULAR" => "5"
),
false
);?>
/**************************************************************/
component.php
if(!isset($arParams["CACHE_TIME"]))
$arParams["CACHE_TIME"] = 36000000;
if($this->StartResultCache(false, ($arParams["CACHE_GROUPS"]==="N"? false: $USER->GetGroups())))
{
if(!\Bitrix\Main\Loader::includeModule("iblock"))
{
$this->AbortResultCache();
ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
/**************************************************************/
В параметрах стоит "SECTION_ID" => $_REQUEST["SECTION_ID"] и единственным условием сброса кеша ("CACHE_TIME" => "36000000") является отсутствие одного из основных модулей.
Результат: по 99 460 файлов кеша на каждый сайт. И это - простое МЕНЮ.
Производство компания Lenal, платформа 1С-Битрикс
0
header.php
<?$APPLICATION->IncludeComponent(
"lenal:lenal.menu",
"mobile",
array(
"VIEW_MODE" => "LINE",
"SHOW_PARENT_NAME" => "Y",
"IBLOCK_TYPE" => "catalog",
"IBLOCK_ID" => "39",
"SECTION_ID" => $_REQUEST["SECTION_ID"],
"SECTION_CODE" => "",
..................................................
component.php
if(!isset($arParams["CACHE_TIME"]))
$arParams["CACHE_TIME"] = 36000000;
if($this->StartResultCache(false, ($arParams["CACHE_GROUPS"]==="N"? false: $USER->GetGroups())))
{
/*
* Lenal вы гребаные идиоты, у вас в параметрах стоит "SECTION_ID" => $_REQUEST["SECTION_ID"] и
* единственным условием у вас сброса кеша ("CACHE_TIME" => "36000000"!!!!!! бля)
* ВОТ ЭТО?! Отсутствие модуля iblock ?!?
* Чтоб вы всю жизнь на жевачку работали, придурки!
*
* 100 000 файлов кеша на ОДНО МЕНЮ ОДНОГО САЙТА!
*
* Дегенераты.
*
*/
if(!\Bitrix\Main\Loader::includeModule("iblock"))
{
$this->AbortResultCache();
ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
return;
}
/*********************
Компонент меню на публичной части от компании Lenal (платформа 1С-Битрикс)
+3
public function payredirectAction() {
// Здесь еще какие-то манипуляции с $url
// и отключение view
echo "<script>window.location.href='" . $url . "';</script>";
}
Индусский редирект
Код на Zend_Framework 1.12
+6
$query_list_builder = array(
'1000' => " and account = $account_id and creator = $creator_id",
'0100' => " and account = $account_id and salepoint = $salepoint_id and creator <> $creator_id ",
'0010' => " and account = $account_id and creator <> $creator_id and salepoint <> $salepoint_id ",
'0001' => " and account IN ($watchlist) and creator <> $creator_id and salepoint <> $salepoint_id and account <> $account_id ",
'1100' => " and salepoint = $salepoint_id or creator = $creator_id and account = $account_id ",
'1010' => " and account = $account_id and salepoint <> $salepoint_id or creator = $creator_id ",
'1001' => " and account IN ($watchlist) and account <> $account_id or creator = $creator_id ",
'1110' => " and account = $account_id or creator = $creator_id and salepoint = $salepoint_id ",
'1101' => " and account IN ($watchlist) and account <> $account_id or creator = $creator_id or salepoint = $salepoint_id ",
'1111' => " and account IN ($watchlist) or account = $account_id or creator = $creator_id or salepoint = $salepoint_id ",
'0000' => " and creator <> $creator_id and salepoint <> $salepoint_id and account NOT IN ($watchlist) ",
'0011' => " and account IN ($watchlist) and salepoint <> $salepoint_id and creator <> $creator_id ",
'0111' => " and account IN ($watchlist) and creator <> $creator_id ",
'0110' => " and account = $account_id and creator <> $creator_id ",
'0101' => " and account IN ($watchlist) and account <> $account_id or salepoint = $salepoint_id and creator <> $creator_id ",
'1011' => " and account IN ($watchlist) and salepoint <> $salepoint_id or creator = $creator_id ",
);
+2
$do_while = DateTime::createFromFormat('d.m.Y H:i:s', $rowRequest['start_date'].":00");
$do_while = $do_while->format('U');
$do_while +=0;
list($hour , $minute ) = explode(":", "24:00");$hour +=0;$minute +=0;
$do_while +=($hour*3600 + $minute*60);
$time = date('d.m.Y H:i',$do_while);
+1
$string_of_query = "select * from gisgmp.f_gisgmp_bills" . $tableName . "8mod(null, 1, UnknownValidUntil);
if ($ValidUntil == null)
$string_of_query = str_replace("UnknownValidUntil", "null", $string_of_query);
else
$string_of_query = str_replace("UnknownValidUntil", "'$ValidUntil'", $string_of_query);
+2
$this->a[$this->c[$this->m]] = my_substr($this->t, $prev[2], ($v[0] - $prev[2]));
Кусочек кустарного говношаблонизатора.
Без комментариев. В обоих смыслах.
+6
switch ($m->type) {
case 'photo':
echo sprintf('<div class="fb_photo %s"><a %s href="%s"><div style="background-image: url(\'%s\');"><b>%s</b><br>%s%s<div class="status">%s <img src="%s" /> %s <img src="%s" /></div></div></div>', ($showProfilePic ? 'padding65' : ''), (isset($_GET['nonavbar']) ? 'target="_top"' : 'target="_blank"'), $m->link . (isset($_GET['nonavbar']) ? '&openwithnavigation=1' : ''), str_replace("_s", "_n", $m->picture), $m->from->name, (!empty($m->message) ? $m->message.'<br>' : ''), ago($m->created_time, $timezone), isset($m->likes) && isset($m->likes->count) ? $m->likes->count : '', isset($m->likes) && isset($m->likes->count) ? buildUri('images/icons/like.png') : '', isset($m->comments) && isset($m->comments->count) ? $m->comments->count : '', isset($m->comments) && isset($m->comments->count) ? buildUri('images/icons/comment.png') : '');
break;
case 'video':
case 'link':
echo sprintf('<div class="fb_link %s"><a %s href="%s"><div style="width: 100%%; padding: 30px; box-sizing: border-box;border-bottom:1px solid #ccc;border-top:1px solid #ccc;"><img style="max-width: none; width:100px;" src="%s" /><div style="width: 100%%"><b>%s</b><br>%s</div></div><div style="position:absolute; right: 10px; bottom: 10px;" class="status">%s <img style="display: inline-block" src="%s" /> %s <img style="display: inline-block" src="%s" /></div></a></div>', ($showProfilePic ? 'padding65' : ''), (isset($_GET['nonavbar']) ? 'target="_top"' : 'target="_blank"'), $m->link . (isset($_GET['nonavbar']) ? '&openwithnavigation=1' : ''), $m->picture, $m->name, $m->message, ago($m->created_time, $timezone), isset($m->likes) && isset($m->likes->count) ? $m->likes->count : '', isset($m->likes) && isset($m->likes->count) ? buildUri('images/icons/like.png') : '', isset($m->comments) && isset($m->comments->count) ? $m->comments->count : '', isset($m->comments) && isset($m->comments->count) ? buildUri('images/icons/comment.png') : '');
//echo sprintf('<div class="fb_link"><a href="%s"><div><img src="%s" /><b>%s</b><br>%s<div class="status">%s likes, %s comments</div></div></div></div>', $m->link, str_replace("_s", "_n", $m->picture), $m->from->name, $m->message, $m->likes->count, $m->comments->count);
break;
case 'status':
echo sprintf('<div class="fb_link %s"><a %s href="%s"><div style="width: 100%%; padding: 30px; box-sizing: border-box;border-bottom:1px solid #ccc;border-top:1px solid #ccc;"><img style="max-width: none; width:100px;" src="%s" /><div style="width: 100%%"><b>%s</b><br>%s</div></div><div style="position:absolute; right: 10px; bottom: 10px;" class="status">%s <img style="display: inline-block" src="%s" /> %s <img style="display: inline-block" src="%s" /></div></a></div>', ($showProfilePic ? 'padding65' : ''), '', '', $m->picture, $m->name, $m->message, ago($m->created_time, $timezone), isset($m->likes) && isset($m->likes->count) ? $m->likes->count : '', isset($m->likes) && isset($m->likes->count) ? buildUri('images/icons/like.png') : '', isset($m->comments) && isset($m->comments->count) ? $m->comments->count : '', isset($m->comments) && isset($m->comments->count) ? buildUri('images/icons/comment.png') : '');
break;
default:
//echo 'TODO: ' . $m->type;
//var_dump($m);
break;
}
Верстка.
Уровень - бог.