This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //1.Пересечение | |
| function cross(arr1=[],arr2=[]) { | |
| let answ = [] | |
| for ( let i = 0; i < arr1.length; i++ ) { | |
| for ( let j = 0; j < arr2.length; j++ ) { | |
| if (arr1[i] === arr2[j] && !answ.includes(arr1[i]) ) | |
| answ.push(arr1[i]); | |
| } | |
| } | |
| return answ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function search1(length=0,arr=[],x=0) { | |
| if (length > 1000 || Math.abs(x) > 1000 ) return false; | |
| for ( let i = 0; i < length; i++ ) { | |
| if (Math.abs(arr[i]) > 1000) return false; | |
| } | |
| for ( let i = 0; i < length; i++ ) { | |
| if (arr[i] === x) return 'YES'; | |
| } | |
| return 'NO'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('model.php'); | |
| $page = new PageGenerator(); | |
| if ( isset($_GET['min-row']) && isset($_GET['max-row']) ) | |
| $page->write_tobd_fromcsv($_GET['min-row'],$_GET['max-row']); | |
| if ( isset($_GET['brand']) ) | |
| $page->create_new_brand_page($_GET['brand'],$_GET['image'],$_GET['mader'],$_GET['site'],$_GET['shipment'],$_GET['content']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| *@ | |
| Методы: | |
| simple - перебор и присвоение свойств: наименование - значение | |
| universal - полный поиск свойства: наименование - значение | |
| autoFields - полный поиск свойства для шаблона: ключ - значение | |
| taskAdminFAQNewTopic | |
| taskCustomerFAQNewTopic | |
| Доступные поля: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'widgets_init', function(){ register_widget( 'Wit_Widget_Mader_and_Price_Filter' ); }); | |
| wp_enqueue_script( 'wit_filter_script', get_template_directory_uri() . '/inc/wit-filter.js', [], "1.0.0", true ); | |
| wp_localize_script( 'wit_filter_script', 'wit_filter_vars', array( | |
| 'wit_filter_ajax_url' => admin_url( 'admin-ajax.php' ), | |
| )); | |
| add_action('wp_ajax_wit_filter', 'activate_wit_filter'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( $_SERVER["HTTP_X_FORWARDED_PROTO"] === "http" ) { | |
| header("HTTP/1.1 301 Moved Permanently"); | |
| header("Location: https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); | |
| } | |
| #apache | |
| Options +FollowSymLinks | |
| RewriteEngine On | |
| #RewriteCond %{HTTP_HOST} !^www\.{HTTP_HOST}\.ru$ [NC] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ( ! defined( 'ABSPATH' ) ) {exit;} | |
| if ( ! class_exists( 'wit_theme_options' ) ) { | |
| class wit_theme_options { | |
| public function __construct() { | |
| if ( is_admin() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).ready(function() { | |
| /* | |
| jQuery("#quest-content input[type=radio]").change(function() { | |
| jQuery(".original-quest").remove(); | |
| if(this.value=="original") { | |
| jQuery(this).after('<input class="original-quest" type="text">'); | |
| } | |
| }); | |
| var elem = jQuery("#quest-form input[type=radio]"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form name="mes_form" method="POST" enctype="multipart/form-data"> | |
| <fieldset id="mes_data"> | |
| <input type="text" name="mes_name" placeholder="Ваше имя" class="message-input" /> | |
| <input type="text" name="mes_email" placeholder="Ваш адрес почты" class="message-input" /> | |
| <input type="hidden" name="mes_check" /> | |
| <textarea name="mes_text" placeholder="Ваше сообщение" class="message-input"></textarea> | |
| </fieldset> | |
| <fieldset id="mes_inputs"> | |
| <input type="file" name="mes_files[]" id="message-files" placeholder="Файлы для загрузки" class="message-input" size="0" multiple/> | |
| <input type="submit" name="mes_submit" value="Отправить" id="message-submit" class="message-input" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ajax_get_json(url, callback) { | |
| var xhttp = new XMLHttpRequest(); | |
| xhttp.onreadystatechange = function() { | |
| if (this.readyState == 4 && this.status == 200) { | |
| const data = JSON.parse(this.responseText); | |
| callback(data); | |
| } | |
| }; | |
| xhttp.open("GET", url, true); | |
| xhttp.send(); |