|
Ok!
|
|
|
Ok!
|
---|---|---|---|---|
142 | array("LOGIC"=>"OR","NAME"=>$q,"PREVIEW_TEXT"=>$q, "PROPERTY_CML2_ARTIKUL"=>$q), | фильтр с логикой, логика, битрикс, bitrix, logic | 500 | Фильтр с логикой в Битрикс |
192 | <meta itemprop="uploadDate" content="'.date("Y-m-d H:i:s", filemtime(__FILE__)).'"/> | meta, uploadDate | 500 | Правильное указание uploadDate для мета видео |
238 | "SECTION_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["section"], | bitrix, catalog.section.list | 500 | Путь секции для catalog.section.list |
25 | SELECT CONVERT(CONVERT(message USING BINARY) USING cp1251) AS cp1251, CONVERT(CONVERT(message USING BINARY) USING utf8) AS utf8 FROM b_event_message bem WHERE CONVERT(message USING BINARY) RLIKE CONCAT('[', UNHEX('80'), '-', UNHEX('FF'), ']') | sql, script, detect wrong encoding | 506 | Обнаружить не так кодированную ячейку в таблице mysql |
103 | $data = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $data); var_dump(unserialize($data)); | replace, serialized | 510 | recalculating the length of the elements in serialized array |
105 | <a id="ajaxaction=add&ajaxaddid=<?=$ar_fields['ID'];?>" rel="nofollow" class="catalog-item-buy input-basket-submit" href="?action=ADD2BASKET&id=<?=$ar_fields['ID'];?>">В корзину</a> | bitrix, в корзину | 560 | Код кнопки добавления в корзину итрикс |
108 | $row['cat_url'] = sb_check_chpu('', '', $row['cat_title'], 'sb_categs', 'cat_url', 'cat_id'); | чпу, сбилдер, sbuilder | 560 | Получить адрес категории в SBuilder |
193 | RedirectMatch 301 /(.*)/$ /$1.html | редирект, html | 560 | Редирект с папки на файл .html |
53 | remove_image_size('large'); remove_image_size('medium'); add_filter( 'wp_calculate_image_srcset_meta', '__return_null' ); Другое решение, сработало в другом месте add_filter( 'max_srcset_image_width', create_function( '', 'return 1;' ) ); | srcset, отменить srcset, wp | 590 | Отменить srcset в Вордпрессе |
59 | $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; | protocol, https | 650 | Определить протокол |
255 | class Foo extends \stdClass // to fix Deprecated: Creation of dynamic property | php, deprecation, dynamic | 650 | Исправление ошибки создания динамически свойства в php8.2 |
52 | add_filter( 'jpeg_quality', function ( $arg ) { return 100; } ); | качество jpg, wp, jpg quality | 670 | Отменить кадрирование в вордпресс, установить качество 100: |
254 | document.addEventListener("DOMContentLoaded", ()=>{ document.querySelector("#get_data_by_inn").addEventListener("click", ()=> { (async function get_jur_data() { let url = "https://' . $_SERVER['HTTP_HOST'] .'/test/inn.json"; fetch(url, { headers: { Authentication: "secret" }}) .then((response) => { return response.json(); }) .then((data) => { console.log(data); }); })() }); }); | json, fetch, js | 670 | Запрос json через javascript |
104 | width: expression(((document.documentElement.clientWidth || document.body.clientWidth) < 1050)? "1050px" : "100%"); | expression, css | 690 | Применение expression в css |
24 | $rs_Section = CIBlockSection::GetList( array('DEPTH_LEVEL' => 'desc'), $ar_Filter, false, array('ID', 'NAME', 'IBLOCK_SECTION_ID', 'DEPTH_LEVEL', 'SORT') ); $ar_SectionList = array(); $ar_DepthLavel = array(); while($ar_Section = $rs_Section->GetNext(true, false)) { $ar_SectionList[$ar_Section['ID']] = $ar_Section; $ar_DepthLavel[] = $ar_Section['DEPTH_LEVEL']; } $ar_DepthLavelResult = array_unique($ar_DepthLavel); rsort($ar_DepthLavelResult); $i_MaxDepthLevel = $ar_DepthLavelResult[0]; for( $i = $i_MaxDepthLevel; $i > 1; $i-- ) { foreach ( $ar_SectionList as $i_SectionID => $ar_Value ) { if( $ar_Value['DEPTH_LEVEL'] == $i ) { $ar_SectionList[$ar_Value['IBLOCK_SECTION_ID']]['SUB_SECTION'][] = $ar_Value; unset( $ar_SectionList[$i_SectionID] ); } } } function __sectionSort($a, $b) { if ($a['SORT'] == $b['SORT']) { return 0; } return ($a['SORT'] < $b['SORT']) ? -1 : 1; } usort($ar_SectionList, "__sectionSort"); | битрикс, массив, перебор | 780 | Перебор массива Битрикс в виде дерева |
110 | echo GetCountryByID ( GetCountryIdByCode("NL") ); | битрикс, страна | 780 | Вывести название страны по ее коду |
58 | UPDATE table_name SET `column_name` = LOWER( `column_name` ) | замена, mysql, строчные, нижний регистр | 907 | Приведение, замена записей mysql к нижнему регистру |
57 | require_once("wp-load.php"); | wp, native functions, include | 980 | All important WordPress file that I needed to include in my custom PHP file was "wp-load.php" |
117 | SELECT * FROM news UNION SELECT * FROM news1 WHERE date = \'03.12.2015\' GROUP BY region ORDER BY id DESC | union, mysql | 980 | Объединить в один запрос выборку из двух баз с одинаковой структурой |
253 | $iterator = CIBlockElement::GetList( array("ID"=>"DESC"), array('IBLOCK_ID' => 26, '=ACTIVE' => 'Y', 'IBLOCK_SECTION_ID', ['LOGIC' => 'OR', 'PREVIEW_TEXT' => false, 'DETAIL_TEXT' => false]), false, false, array('ID', 'NAME', 'CODE', 'IBLOCK_SECTION_ID') ); while($item = $iterator->Fetch()) { $was_id = 0; $nav = CIBlockSection::GetNavChain(false, $item['IBLOCK_SECTION_ID'], array(), false); $url = ""; while($nav->Fetch()){ if($was_id != $item['ID']){ $url_length = count($nav->arResult); $url .= $nav->arResult[$url_length - 1]['CODE'] . "/"; echo $item['ID'] . ';"' . $item['NAME'] . '";"https://lamaree.ru/catalog/' . $url . $item['CODE'] . '/"' . " "; $was_id = $item['ID']; } } } | url, bitrix, catalog | 980 | Выбрать из каталога Битрикс товары без описаний с URL |