|
Ok!
|
|
|
Ok!
|
---|---|---|---|---|
186 | if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443){ $protocol = 'https://'; }else{ $protocol = 'http://'; } $url = $protocol.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; $urlend = strrpos($url, '?', -1); // Находим и удаляем все параметры (номер страницы, параметры фильтра и тд.) if($urlend != false){ $url = substr($url, 0, $urlend); } if(mb_substr($url, -1) == '/'){ // Тут оставляем, если ссылки на сайте не заканчиваются на /, либо удаляем, если заканчиваются на /. $url = substr($url, 0, -1); } echo '<link rel="canonical" href="'.$url.'"/>'; | php, canonical | 32090 | php link rel canonical |
185 | net user User_name * | пароль, сменить, cmd | 120 | Чтобы сменить пароль юзера в винде надо 5 раз нажать Shift, вызвать перезагрузку, открыть любую прогу дать sethc.exe другое имя и переименовать cmd.exe в sethc.exe. Перезагрузиться и 5 Shift вызвать cmd. Там задать эту команду, чтобы сбросить пароль Юзера |
184 | <span class="mc-stars" style="display:none"> <span class="mc-star" data-origin="star_o" data-color="#ffaf02" data-star="1" data-hover=""> <svg width="24" height="24" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ffaf02"></path></svg></span><span class="mc-star" data-origin="star_o" data-color="#ffaf02" data-star="2" data-hover=""> <svg width="24" height="24" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ffaf02"></path></svg></span><span class="mc-star" data-origin="star_o" data-color="#ffaf02" data-star="3" data-hover=""> <svg width="24" height="24" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ffaf02"></path></svg></span><span class="mc-star" data-origin="star_o" data-color="#ffaf02" data-star="4" data-hover=""> <svg width="24" height="24" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ffaf02"></path></svg></span><span class="mc-star" data-origin="star_o" data-color="#ffaf02" data-star="5" data-hover=""> <svg width="24" height="24" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ffaf02"></path></svg></span></span> | рейтинг, 5 звезд | 130900 | рейтинг в 5 пустых звезд |
183 | if (mob_detect()) { $APPLICATION->AddHeadString("<style>.wrap center img {margin-bottom: 2em;}</style>"); } | битрикс, header, строка | 9800 | Добавить произвольную строку в заголовок Битрикс |
182 | <? $today = new DateTime(); $begin = new DateTime('January 01'); $ny1 = new DateTime('December 20'); $ny2 = new DateTime('January 8'); $spring = new DateTime('March 01'); $summer = new DateTime('June 01'); $fall = new DateTime('September 01'); $winter = new DateTime('December 01'); switch (true) { case $today >= $ny1 || $today < $ny2: echo 'Новогоднее настроение'; break; case ($today >= $winter || $today >= $begin) && $today < $spring: echo 'Зимнее настроение'; break; case $today >= $spring && $today < $summer: echo 'Весеннее настроение'; break; case $today >= $summer && $today < $fall: echo 'Летнее настроение'; break; case $today >= $fall && $today < $winter: echo 'Осеннее настроение'; break; default: break; } ?> | зимнее, весеннее | 100 | зимнее или весеннее |
181 | SELECT * FROM shoutbox WHERE CONCAT(name, foo, bar, baz) LIKE '%$search%' | поиск, mysql, по колонкам | 340900 | Поиск по нескольким колонкам |
180 | https://marketplace.1c-bitrix.ru/solutions/bitrix.liveapi/ | модуль, битрикс, API | 100 | Ссылка на Живое описание API Битрикс. Механизм сканирует все модули Битрикс и выводит все методы этих модулей. Можно посмотреть, какие возможности у каждого модуля! |
179 | $connection = BitrixMainApplication::getConnection(); $sqlHelper = $connection->getSqlHelper(); $recordset = $connection->query("SELECT * FROM dbname"); while ($record = $recordset->fetch()){ ... } | d7 активация, битрикс | 1300 | Активировать в7 на конкретной странице |
178 | [checkbox* checkbox-41 id:agree-2 class:agree label_first use_label_element "Да"] | согласие, чекбокс | 34090 | Чекбокс согласия в contact forms 7 |
177 | <script type="text/javascript">$(document).ready(function () { var div = $("#rec241218811").find(".t-video-lazyload"); var iframe = div.find('iframe'); var height = div.width() * 0.5625; div.height(height); iframe.height(height); $('.t223').bind('displayChanged', function () { height = div.width() * 0.5625; div.height(height); iframe.height(height); }); $(window).bind('scroll', t_throttle(function () { height = div.width() * 0.5625; div.height(height); iframe.height(height); }, 200)); });</script> | lazyload, youtube | 90890 | Лэйзилоуд для ютьюб роликов на страницу |
176 | В htaccess добавить <IfModule mod_headers.c> <FilesMatch ".(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> | cors, allow origin | 100600 | No Access-Control-Allow-Origin header при подключении шрифтов |
175 | <script> document.addEventListener('touchstart', this.callPassedFuntion, {passive: false}); </script> | passive, false | 120 | Про passive false |
174 | function find_closed() { //clearTimeout(typingTimer); //typingTimer = setTimeout(doneTyping, doneTypingInterval); var found; var tr = jQuery('.pricing tr'); var pos = jQuery('body, html').scrollTop(); var s = jQuery('#searchfield').val(); //var add = jQuery('.prices').first().position().top; var old, i, cont; if(s.length > 2) { old = jQuery('.found_color').parents('td'); jQuery.each(old, function(){ cont = jQuery(this).text(); old.text(cont); }); jQuery('tr').removeClass('found'); for (i = 0; i < tr.length; i++) { if (tr.eq(i).text().toLowerCase().indexOf(s.toLowerCase()) > -1) { tr.eq(i).addClass('opened found'); var text = tr.eq(i).children('td:first-child').text().replace(s, '<span class=found_color>' + s + '</span>'); //console.log(text); tr.eq(i).children('td:first-child').html(text); found = 1; }else{ //tr.eq(i).remove(); tr.eq(i).removeClass('opened'); tr.eq(i).removeClass('found'); } } if(jQuery('.found').length){ var E = setTimeout(function(){ pos += jQuery('.found').first().parents('table').position().top; jQuery('body, html').animate({scrollTop: pos}, 300, 'swing'); console.log(pos); },300); } if (found < 1) { jQuery('.not-found').text('Не найдено на этой странице. Поищите через общий поиск') } } } | найти в скрытом аккордионе | 12300 | find_closed с подстветкой |
173 | <?$arText = explode('#MY_COMPONENT#',$arResult['DETAIL_TEXT']); for($i=0;$i<count($arText);$i++) { echo $arText[$i]; if ($i>0) $APPLICATION->IncludeComponent('my:my_component',''); }?> | код в статью битрикс | 435 | Вставка кода в статью Битрикс |
172 | <span style="color: #999999; font-size: 10px;">Вы можете <a href="https://shop.lamaree.ru/disable_email/index.php?e=' . $su_email . '&s=' . $su_id . '" rel="noopener" style="text-decoration: underline; color: #0068A5;" target="_blank" title="отписаться">отписаться</a> от рассылки</span> | отписка от рассылки | 120 | отписка от рассылки ламаре |
171 | http://example.com/?_ym_debug=1 | метрика, counter test, проверка | 12300 | Проверка счетчиков и событий метрики в консоли |
170 | /bitrix/admin/perfmon_table.php?PAGEN_1=1&SIZEN_1=20&lang=ru&table_name=b_event&by=DATE_INSERT&order=desc | битрикс, отправленные письма | 11020 | Список отправленных писем в Битрикс |
169 | /* javascript url кодирует сорсы всех картинок */ var arr = document.querySelectorAll('img') arr.forEach(function(item, i, arr) { var uri = arr[i].src; var encoded = encodeURI(uri); arr[i].src = encoded; }); | urlencode, имена картинок | 10090 | url кодировать все файлы картинок javascript |
168 | add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { //unset($fields['billing']['billing_first_name']);// имя unset($fields['billing']['billing_last_name']);// фамилия unset($fields['billing']['billing_company']); // компания unset($fields['billing']['billing_address_1']);// unset($fields['billing']['billing_address_2']);// unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); //unset($fields['billing']['billing_phone']); //unset($fields['order']['order_comments']); //unset($fields['billing']['billing_email']); //unset($fields['account']['account_username']); //unset($fields['account']['account_password']); //unset($fields['account']['account_password-2']); unset($fields['billing']['billing_company']);// компания unset($fields['billing']['billing_postcode']);// индекс return $fields; } | woocommerce, лишние поля | 3400 | Удалить лишние поля для оформления заказа на woocommerce |
167 | document.addEventListener("DOMContentLoaded", function (event) { setTimeout(function() { document.querySelectorAll('*').forEach.call( document.querySelectorAll('img[data-src]'), function (img) { img.setAttribute('src', img.getAttribute('data-src')); img.onload = function () { img.removeAttribute('data-src'); }; }); },200); }); | отложенная, загрузка | 120 | Отложенная загрузка изображений |