• Как позиционировать кнопки carousel?

    @magic_healthy_hair Автор вопроса
    В том то и дело что все работает, изображения становятся кирпичиками, пока не включаешь carousel , сразу же все картинки в разброс идут

    скрипт подключаю вот так

    <link rel="stylesheet" href="templates/f/owl-carousel/css/owl.carousel.css"/>
    <link rel="stylesheet" href="templates/f/owl-carousel/css/owl.theme.default.css"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="templates/f/owl-carousel/js/owl.carousel.js"></script>
    
    <div class="owl-carousel owl-theme">
    <div class="hbkbk">
        <a href="#">
    	<div class="item sjdfnlsfd" style="background-image: url(/s/img/recommend/st.jpg);">
    		<h2 class="shortcutqq" >#</h2>
    		</div></a></div>
    		</div>
    <script>
    $(document).ready(function(){
      $(".owl-carousel").owlCarousel();
    });
    
    $(".owl-carousel").owlCarousel({
    nav:false,
    autoplay : true,
    autoplayTimeout : 7000,
    loop:true,
    margin:5,
    items:7,
    dots: false,
    stagePadding: 50,
    responsive:{
            0:{
                items:1,
                nav:true
            },
            600:{
                items:3,
                nav:false
            },
            1000:{
                items:5,
                nav:true,
                loop:false
            }
        }
    });
    </script>
  • Как позиционировать кнопки carousel?

    @magic_healthy_hair Автор вопроса
    спасибо большое, но я пока прикручивал это, появилась ошибка вот такая

    Uncaught TypeError: $(...).imagesLoaded is not a function
    at HTMLDocument. ((index):1827)
    at c (index.js:23)
    at Object.fireWith [as resolveWith] (index.js:23)
    at Function.ready (index.js:23)
    at HTMLDocument.q (index.js:23)

    из-за нее сбивается многое на странице
    в чем может быть проблема не подскажете?
    если убрать js carousel, то все становится на место, пробовал менять расположение кода, не помогло
  • Как добавить ссылку текущей страницы?

    @magic_healthy_hair Автор вопроса
    Сергей Ванюшин, почему-то description не передается даже если просто текст написать..

    <script type="text/javascript">(function() {
      if (window.pluso)if (typeof window.pluso.start == "function") return;
      if (window.ifpluso==undefined) { window.ifpluso = 1;
        var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
        s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
        s.src = ('https:' == window.location.protocol ? 'https' : 'http')  + '://share.pluso.ru/pluso-like.js';
        var h=d[g]('body')[0];
        h.appendChild(s);
      }})();
      var pluso_div = querySelector('div.pluso');
    pluso_div.setAttribute('data-url', '{$details_url}', 'data-title', '{$listing.title}', 'data-description', '{$listing.description_formatted}');
    </script>
  • Как добавить ссылку текущей страницы?

    @magic_healthy_hair Автор вопроса
    Сергей Ванюшин,
    А если ссылка вот так выводится через smarty {$url} ? возможно ли ее как-то передать?
  • Как добавить ссылку текущей страницы?

    @magic_healthy_hair Автор вопроса
    не совсем понятно куда именно вставить это ,можете пожалуйста уточнить

    var pluso_div = querySelector('div.pluso');
    pluso_div.setAttribute('data-url', 'http://custom-url');


    <script type="text/javascript">(function() {
      if (window.pluso)if (typeof window.pluso.start == "function") return;
      if (window.ifpluso==undefined) { window.ifpluso = 1;
        var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
        s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
        s.src = ('https:' == window.location.protocol ? 'https' : 'http')  + '://share.pluso.ru/pluso-like.js';
        var h=d[g]('body')[0];
        h.appendChild(s);
      }})();</script>
  • Удалить содержимое одного файла txt из другого?

    @magic_healthy_hair Автор вопроса
    dollar, у меня есть скрипт который удаляет только один email за раз, как сделать так чтобы удалял список из textarea например не могу понять

    <?php
      \error_reporting(0); // запрещаем вывод сообщений о возможных ошибках
      
      function test_mail($char) { // функция, проверяющая реальность адреса
        return (boolean) \preg_match('/[\w\d\._-]+@[\w\d\._-]+\.[\w\d]{2,}/u', $char);
      }
    
      function find_mail($maillist, $email) { // функция, проверяющая наличие адреса в базе
        $result = FALSE;
        foreach ($maillist as $key => $part) {
          if ($email == \trim($part)) {
            $result = $key; // возвращаем порядковый номер адреса, если он найден
            break;
          }
        }
        return $result;
      }
      
      function add_mail($file, $email) {
        \file_put_contents($file, "$email\n", FILE_APPEND);
      }
      
      function remove_mail($file, $maillist, $key) {
        unset($maillist[$key]);
        \file_put_contents($file, \implode('', $maillist));
      }
      
      $message = ''; // здесь будет сообщение о результате действия  
      if (!empty($_POST)) { // если форма отправлена
        $fromemail = 'admin'; // адрес администратора для отправки ошибок
        $email = \trim(\strtolower(\htmlentities($_POST['email']))); // очищаем введённый адрес
        $file = "maillist.txt"; // файл, содержащий адреса
        
        if (\file_exists($file)) { // файл существует
          $maillist = \file($file);
          if (!empty($email) && test_mail($email)) { // email не пустой и правильный
            $key = find_mail($maillist, $email); // номер адреса в базе или FALSE, если такого нет
            if (isset($_POST['subscribe'])) { // запрошена подписка на рассылку
              if ($key === FALSE) { // email нет в базе
                add_mail($file, $email);
                $message = "E-mail: $email добавлен в базу рассылки.";
              } else { // email уже есть в базе
                $message = "E-mail: $email уже есть в базе рассылки.";
              }
            } elseif (isset($_POST['unsubscribe'])) { // запрошена отписка от рассылки
              if ($key === FALSE) { // email нет в базе
                $message = "E-mail: $email не найден в базе рассылки.";
              } else {
                remove_mail($file, $maillist, $key);
                $message = "E-mail: $email удален из базы рассылки.";
              }
            }
          } else { // email пустой или неправильный
            $message = "E-mail: $email не сушествует.";
          }
        } else { // файл не существует
          $message = "Не найден файл $file ! Пожалуйста <A HREF=\"mailto:$fromemail\">сообщите</a> мне об ошибке.";
        }
      }
      
      \header('Content-Type: text/html; charset=utf-8;');
    ?>
    
      <p><?=$message?></p>
      <form method="post">
        <fieldset>
          <legend>Отписаться от рассылки</legend>
          <label for="email">Введите e-mail:</label>
    ________________
    
          !!!!!<textarea type="text" id="email" name="email" size="30" required></textarea>!!!!!
    _______________
          <input type="submit" name="unsubscribe" value="Отписаться">
        </fieldset>
      </form>
  • Удалить содержимое одного файла txt из другого?

    @magic_healthy_hair Автор вопроса
    dollar, а есть какие-то готовые скрипты для данной задачи не подскажите?
  • Удалить содержимое одного файла txt из другого?

    @magic_healthy_hair Автор вопроса
    файлы txt , не csv ,просто email по одному в строке
  • Удалить содержимое одного файла txt из другого?

    @magic_healthy_hair Автор вопроса
    А как ей пользоваться ? там ничего не понятно, может вы когда-то выполняли данную задачу в этой программе, подскажите последовательность действий?
  • Как сделать живой поиск из select2?

    @magic_healthy_hair Автор вопроса
    прикрутил chosen , но теперь получается так, у меня 2 поля select, одно регион, второе город, после выбора региона из первого select , подгружаются города во второй select, но почему-то первый select работает так как надо , т.е начинаешь вводить регион , выбираешь из списка, а вот второй select с городами уже не работает
    вот код
    что тут не так?
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    	<script src="https://.site/auto/chosen.jquery.js"></script>
    	<script>
    	$('.chosen-select').chosen();
    	</script>


    <select name="{$v.depending.caption1}" class="chosen-select" id="{$v.depending.caption1}" onchange="selDepending(1, '{$v.depending.caption1}', '{$v.depending.caption2}', '{$v.depending.id}', {if isset($category) && $category}{$category}{else}0{/if}, {if $v.other_val}1{else}0{/if}, '{$lng.general.other}', {if $v.all_val}1{else}0{/if}, '{$lng.general.all}', '{$live_site}', '')" {if in_array($v.depending.caption1, $gmaps_unique)}onblur="autoLocator_{$gmaps_fields[$v.depending.caption1]}();"{/if} {if isset($edit) && $edit && !$v.editable}readonly{/if}>
    		<option value="">{$v.depending.top_str1}</option>
    		{if $v.other_val}<option value="-1" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1] && !in_array($tmp[$v.depending.caption1], $v.depending.elements)}selected="selected"{/if}>{$lng.general.other}</option>{/if}
    		{if $v.all_val}<option value="all" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]=="all"}selected="selected"{/if}>{$lng.general.all}</option>{/if}
    		{foreach from=$v.depending.elements item=t}
    		<option value="{$t.name}" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]==$t.name} selected="selected"{/if}>{$t.name}</option>
    		{/foreach}
    	</select>
    	<input type="hidden" name="dep_id_{$v.depending.caption1}" id="dep_id_{$v.depending.caption1}" value="" />
    	{if $v.other_val}
    	{if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1] && !in_array($tmp[$v.depending.caption1], $v.depending.elements)}
    	<span id="span_{$v.depending.caption1}_other_val">&nbsp;<input type="text" name="{$v.depending.caption1}_other_val" value="{$tmp[$v.depending.caption1]}"></span>
    	{else}
    	<span id="span_{$v.depending.caption1}_other_val" style="display: none;">&nbsp;<input type="text" name="{$v.depending.caption1}_other_val"/></span>
    	{/if}
    	{/if}
    	
    	</div>{* end fel *}
    
    	<div class="fel">
    	
    	<label for="{$v.depending.caption2}">{$v.depending.name2}{if $v.depending.required2==1}<span class="mandatory"> *</span>{/if}{if $v.info_message}&nbsp;<a href="javascript:;" class="info_icon tooltip" title="{$v.info_message}" >i</a>{/if}</label>
    
    	<select disabled='disabled' class="chosen-select" name="{$v.depending.caption2}" id="{$v.depending.caption2}" {if $v.depending.no>2}onchange="selDepending(2, '{$v.depending.caption2}', '{$v.depending.caption3}', '{$v.depending.id}', 0, {if $v.other_val}1{else}0{/if}, '{$lng.general.other}', {if $v.all_val}1{else}0{/if}, '{$lng.general.all}', '{$live_site}', 'dep_id_{$v.depending.caption1}')"{else}{if $v.other_val}onchange="checkOther(this.form.{$v.depending.caption2}, '{$v.depending.caption2}')"{/if}{/if} {if in_array($v.depending.caption2, $gmaps_unique)}onblur="autoLocator_{$gmaps_fields[$v.depending.caption2]}();"{/if} >
    		<option value="">{$v.depending.top_str2}</option>
    	</select>
    	<input type="hidden" name="dep_id_{$v.depending.caption2}" id="dep_id_{$v.depending.caption2}" value="" />
    	{if $v.other_val}
    	<span id="span_{$v.depending.caption2}_other_val" style="margin-left: 10px; display: none;">&nbsp;
    	<input type="text" name="{$v.depending.caption2}_other_val" id="{$v.depending.caption2}_other_val" value="{if isset($tmp[$v.depending.caption2])}{$tmp[$v.depending.caption2]}{/if}"/>
    	</span>
    	{/if}
    {if $v.depending.no>=3}
  • Как сделать живой поиск из select2?

    @magic_healthy_hair Автор вопроса
    Вот как этот кусок

    <select name="{$v.depending.caption1}" class="mselect catselect" id="{$v.depending.caption1}" onchange="selDepending(1, '{$v.depending.caption1}', '{$v.depending.caption2}', '{$v.depending.id}', {if isset($category) && $category}{$category}{else}0{/if}, {if $v.other_val}1{else}0{/if}, '{$lng.general.other}', {if $v.all_val}1{else}0{/if}, '{$lng.general.all}', '{$live_site}', '')" {if in_array($v.depending.caption1, $gmaps_unique)}onblur="autoLocator_{$gmaps_fields[$v.depending.caption1]}();"{/if} {if isset($edit) && $edit && !$v.editable}readonly{/if}>
        <option value="">{$v.depending.top_str1}</option>
        {if $v.other_val}<option value="-1" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1] && !in_array($tmp[$v.depending.caption1], $v.depending.elements)}selected="selected"{/if}>{$lng.general.other}</option>{/if}
        {if $v.all_val}<option value="all" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]=="all"}selected="selected"{/if}>{$lng.general.all}</option>{/if}
        {foreach from=$v.depending.elements item=t}
        <option value="{$t.name}" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]==$t.name} selected="selected"{/if}>{$t.name}</option>
        {/foreach}
      </select>


    Сделать таким как у них здесь

    https://select2.org/dropdown#dropdown-placement

    Просто у меня почему-то появляется input рядом с select и весь список регионов
    вот скрин

    5bb2655e017f5924151689.png
  • Как сделать живой поиск из select2?

    @magic_healthy_hair Автор вопроса
    Вы не могли бы примерно показать как это реализовать в данном случае?
  • Почему не работает скрипт?

    @magic_healthy_hair Автор вопроса
    slo_nik, Да в гугле нашел, надо просто по-быстрому такую вещь найти было чтобы человек мог отписаться или подписаться)

    вот такое нашел

    [08/Sep/2018:18:18:04 +0300] "GET /mail/ras.php HTTP/1.0" 200 376 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    [08/Sep/2018:18:18:06 +0300] "GET /mail/ras.php HTTP/1.0" 200 376 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    [08/Sep/2018:18:18:08 +0300] "GET /mail/ras.php HTTP/1.0" 200 376 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    [08/Sep/2018:18:18:09 +0300] "GET /mail/ras.php HTTP/1.0" 200 376 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    194.150.255.148 - - [08/Se
  • Бесконечная прокрутка скролла от начала к концу?

    @magic_healthy_hair Автор вопроса
    Вы не могли бы пожалуйста написать пример подключения ?
    В папке которую скачал с сайта куча файлов разных , какой именно подключать?
    owlcarousel скачал