This file contains 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 | |
/** | |
* Create a web friendly URL slug from a string. | |
* | |
* Although supported, transliteration is discouraged because | |
* 1) most web browsers support UTF-8 characters in URLs | |
* 2) transliteration causes a loss of information | |
* | |
* @author Sean Murphy <sean@iamseanmurphy.com> | |
* @copyright Copyright 2012 Sean Murphy. All rights reserved. |
This file contains 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
$url = "https://online.moysklad.ru/api/remap/1.1/report/stock/all?&limit=100&offset=".$offset; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_USERPWD, "api@media-group : pass"); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
$array = json_decode($result, true); | |
This file contains 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
//include MODX API | |
define('MODX_API_MODE', true); | |
require_once($_SERVER['DOCUMENT_ROOT'].'/index.php'); | |
$modx=new modX(); | |
$modx->initialize('web'); | |
$q = $modx->newQuery('modResource'); | |
$q->limit('500','0'); //($limit,$offset) | |
$modx->addDerivativeCriteria('modResource', $q);// | |
$docs = $modx->getIterator('modResource', $q); |
This file contains 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 | |
//include MODX API | |
define('MODX_API_MODE', true); | |
require_once($_SERVER['DOCUMENT_ROOT'].'/index.php'); | |
$modx=new modX(); | |
$modx->initialize('web'); | |
function debug($arr){ | |
echo '<pre>'; | |
var_dump($arr); |
This file contains 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 translit($str) { | |
$rus = array(' ','А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'); | |
$lat = array('_', 'a', 'b', 'v', 'g', 'd', 'e', 'e', 'gh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'sch', 'y', 'y', 'y', 'e', 'yu', 'ya', 'a', 'b', 'v', 'g', 'd', 'e', 'e', 'gh', 'z', 'i', 'y', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 't', 'u', 'f', 'h', 'c', 'ch', 'sh', 'sch', 'y', 'y', 'y', 'e', 'yu', 'ya'); | |
return str_replace($rus, $lat, $str); | |
} | |
function makeAlias($url){ | |
$url = ereg_replace(' ','-',$url); | |
$url = translit($url); | |
$url = ereg_replace("[^a-z A-Z0-9-]*","",$url); |
This file contains 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
define('MODX_API_MODE', true); | |
require_once($_SERVER['DOCUMENT_ROOT'].'/index.php'); | |
$modx=new modX(); | |
$modx->initialize('web'); |
This file contains 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
<button id="toTop" class=""><i class="material-icons">keyboard_arrow_up</i></button> | |
#toTop.active { | |
opacity: 1; | |
visibility: visible; | |
} | |
#toTop { | |
opacity: 0; | |
visibility: hidden; | |
position: fixed; |
This file contains 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.session.js https://github.com/AlexChittock/JQuery-Session-Plugin | |
// ==================================================== | |
$('.setting-view a').click(function() { // клик по кнопке выбора | |
view = $(this).attr('href'); // запоминаем ссылку выбранного пункта | |
view = view.substring(1); // обрезаем значок # в ссылке | |
$.session.set('cat-view', view); // передаем полученное значение в сессию | |
}); | |
view = $.session.get('cat-view'); // отлавливаем значение из сессии |
This file contains 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 id="sort_count" name="sort_count" method="get" action="[~[*id*]~]"> | |
<div class="col-md-6 col-sm-6 col-xs-12"> | |
<div class="sort-by"> | |
<label>Сортировка:</label> | |
<div class="select-sort-by"> | |
<select class="inputbox" name="order" id="order" onChange="window.location=window.location.pathname+'?sort='+this.value;"> | |
<option [!selected? ¶m=`sort` &znach=`pagetitle`!] class="pagetitle" value="pagetitle" selected="selected">По алфавиту</option> | |
<option [!selected? ¶m=`sort` &znach=`asc`!] class="asc" value="asc">По возрастанию цены</option> | |
<option [!selected? ¶m=`sort` &znach=`desc`!] class="desc" value="desc">По убыванию цены</option> | |
<option [!selected? ¶m=`sort` &znach=`random`!] class="random" value="random" >Без сортировки</option> |
This file contains 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
Регистрация FormLister | |
[!FormLister? | |
&controller=`Reminder` | |
&formid=`remind` | |
&protectSubmit=`0` | |
&submitLimit=`0` | |
&rules=`{ | |
"email":{ | |
"required":"Обязательно введите email", |