(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
121
img.svg {
    clip-path: inset(0px 11px 0px 11px);
}
clip-path3460Обрезка картинок
41
RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} ^(?:www.)?(.*)$ [NC]
RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301]
redirect, редирект3500Редирект с http на https + с www на non-www
50
<script>
jQuery('.order-form-submit').click(function send_order(){
gtag('event', 'purchase', {
  "transaction_id": <?=rand(1,1000)?>,
  "affiliation": "La Maree Buy",
  "value": {TOVAR_SUM},
  "currency": "RUR",
  "tax": 1.18,
  "shipping": 350,
  "items": <?=json_encode( $GLOBALS['item'], JSON_UNESCAPED_UNICODE ); ?>
});
});
</script>
gtag, js, аналитика, purchase4899Скрипт добавки товара в Аналитику gtag js
32
function find_closed() {
    var tr = $('tr');
    if($('#searchfield').val() != "") {
        for (var i = 0; i < tr.length; i++) {
            if (tr.eq(i).text().toLowerCase().indexOf($('#searchfield').val().toLowerCase()) > -1) {
                tr.eq(i).addClass('opened');
                /*tr.eq(i).css({'background': '#A8E9FF'});*/
                var found = 1;
            }else{
				tr.eq(i).removeClass('opened');
			}
            
        }
		if (found < 1) {
                $('.not-found').text('Не найдено')
            }
    }
}
javascript, поиск в таблице5400JS функция ищет соответствие в словах скрытых строк таблицы. Если найдет — открывает строку, нет — закрывает
124
А я помню вот до сих пор.
J3QQ4-H7H2V-2HCH4-M3HK8-6M8VW
для меня прям как стих из молодости
виндоус код, windows code5600Вдруг пригодится
128
$current_time = strtotime("now");
$sunrise = strtotime("09:00");
$sunset = strtotime("21:00");
if ($current_time > $sunrise && $current_time < $sunset && date('w') > 0 && date('w') < 6)
{
	?><a href="https://wa.me/<?=(mob_detect())?"+":""?>74951233121" target="_blank" class="chat_social_item chat_social_wh"></a><?
          }
          else
          {
              ?><div style="display: none" id="wa_wi" data-info="<?=$current_time . ' ' . $sunrise . ' ' . $sunset?>">С 09:00 до 21:00</div><?
          }
whatsupp5600whatsupp widget
153
print vsprintf("%04d-%02d-%02d", explode('-', '1988-8-1')); выведет 1988-08-01
печать даты, php5900Печать даты в php
49
$fp = fopen('tovary.xml',"r");
$arr = file_get_contents('tovary.xml');
$gruops = [];
fclose($fp);
#[2] => Окрашивание волос
#[33] => Перманентная краска
$details['category'] = "Перманентная краска";
$s = new SimpleXMLElement($arr);
$groups = [];
foreach($s->Классификатор->Группы->Группа as $g) {
	$naim     = $g->Наименование;
	$tid      = $g->Ид;
	$groups[] = [ $tid[0] . "", $naim[0] . "" ];
	foreach ( $g->Группы->Группа as $gr_parent ) {
		$naim     = $gr_parent->Наименование;
		$tid      = $gr_parent->Ид;
		$groups[] = [ $tid[0] . "", $naim[0] . "" ];
	}
}
foreach($groups as $gr){
	if($gr[1] == $details['category']){
		echo $gr[0];
	}
}
битрикс, парсинг, xml, товары, каталог7090Парсить группы (категории) товаров в xml экспорте товаров Битрикс
86
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
https, www8700Любой редирект на https + www
232
if(preg_match('/[A-Z]/', $_SERVER['REQUEST_URI'])){
	LocalRedirect(strtolower($_SERVER['REQUEST_URI']), 0, "301 Moved permanently"); 
}
bitrix, редирект, localredirect9000Битрикс редирект в обход htaccess с заглавных букв в УРЛ на маленькие
236
//ADD SECTION CANONICAL URL
$canonicalScheme = CMain::IsHTTPS() ? "https" : "http";
$APPLICATION->AddHeadString('<link rel="canonical" href="' . $canonicalScheme . '://' . SITE_SERVER_NAME . $arCurSection["PATH"][$arCurSection["ID"]]["SECTION_PAGE_URL"] . '" />', true);
bitrix, section9008ADD SECTION CANONICAL URL
141
<?="<p>".implode("<p>", explode("|",$arResult['DETAIL_TEXT']))?>
разбить, explode9080Если нужно разбить текст по символу и вывести объединенный по другому символу
231
$scheme = CMain::IsHTTPS() ? "https" : "http";
https, bitrix9090Определить https в Битрикс
60
<meta name="viewport" content="width=device-width, initial-scale=1">
viewport, meta, метатег9800Метатег viewport
135
SELECT * FROM int_posts p, int_postmeta m WHERE p.post_title LIKE '%Чикина%' AND p.post_type = 'page' AND (p.post_status = 'publish' OR p.post_status = 'private') AND p.ID = m.post_id
wp, sql, часть названия9800SQL запрос WP выборки записи (страницы) по слову из названия
138
var dayArr1 = $('.order-form input[name="user_f_9_2"]').val().split('.');
        var dFor1 = dayArr1[1] + '-' + dayArr1[0] + '-' + '20' + dayArr1[2];
covert date, js date9800Конвертировать дату в яваскрипт формат
183
if (mob_detect()) {
    $APPLICATION->AddHeadString("<style>.wrap center img {margin-bottom: 2em;}</style>");
}
битрикс, header, строка9800Добавить произвольную строку в заголовок Битрикс
46
$filename = 'files/' . $ident . '.xml';
    $ctype="application/force-download";
    header("Pragma: public"); // required
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private",false); // required for certain browsers
    header("Content-Type: $ctype");
    // change, added quotes to allow spaces in filenames, by Rajkumar Singh
    header("Content-Disposition: attachment; filename="".basename($filename)."";" );
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: ".filesize($filename));
    readfile("$filename");
download file, php10030Сформировать файл и передать его на загрузку в браузер
230
grep двух слов в строке
grep '77.50.63.90' lamaree.ru.access.log | grep '.default/ajax.php'
grep, 2 words10080Поиск двух слов в строке через grep linux
266
/**
 * Clean Head
 */
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wp_shortlink_wp_head');
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
remove_action('wp_head', 'rest_output_link_wp_head', 10);
remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
remove_action('wp_head', 'wp_resource_hints', 2);
remove_action('template_redirect', 'rest_output_link_header', 11, 0);


add_filter('the_generator', '__return_empty_string'); // Убираем версию WordPress

remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); // Короткая ссылка, ссылка без ЧПУ <link rel='shortlink'
wp, clean head10090WP clean header
1 2 3 4 5 6 7 8 9 10 11 12 13 14