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
Соддаем пользователя deploy | |
sudo adduser deploy | |
Генерируем ключ | |
ssh-keygen -t rsa | |
Посмотреть ключ | |
cat ~/.ssh/id_rsa.pub | |
sudo apt-get update | |
sudo apt-get upgrade |
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
При переносе сайта возникла ошибка smtp все было настроено но поста не отправляется, похожие ошибки можно найти "Обновился до PHP 7, не уходит почта с FormIt " | |
[2016-04-30 21:40:10] (ERROR @ /var/www/web1/www/core/model/modx/mail/phpmailer/class.smtp.php : 343) PHP warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: | |
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed | |
[2016-04-30 21:40:10] (ERROR @ /var/www/web1/www/core/components/formit/model/formit/fihooks.class.php : 552) [FormIt] Произошла ошибка при попытке отправить почту. Ошибка соединения с SMTP-сервером https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting | |
Решение заняло 2 дня но оказалось очень простым | |
apt-get install --reinstall ca-certificates |
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
AddDefaultCharset UTF-8 | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access 7 days" | |
ExpiresByType application/javascript "access plus 1 year" | |
ExpiresByType text/javascript "access plus 1 year" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType text/html "access plus 7 day" | |
ExpiresByType text/x-javascript "access 1 year" |
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
Фото должно быть по пути | |
assets/components/minishop2 | |
assets/components/ms2gallery | |
{"small":{"w":344,"h":552,"q":100,"zc":"0","far":"C","f":"png","bg":"ffffff","fltr":"wmi|ico-infographic-03.png|BR|50|5|5"},"small_ex":{"w":285,"h":285,"q":100,"zc":"0","far":"C","f":"png","bg":"ffffff","fltr":"wmi|ico-infographic-03.png|C | |
|50|5|5"}} |
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 sortCatalog(products, section, reverse = false) { | |
// Переменные | |
var arProductsList = []; | |
var strHtml = ''; | |
// Переделываем в массив | |
products.each(function (e) { | |
arProductsList.push(products[e]); | |
}); |
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
Суть проблемы | |
Во время сохранения ресурса значения TV-параметров не сохраняются в таблице базы данных (modx_site_tmplvar_contentvalues), при этом внешне всё выглядит нормально: после сохранения в соответствующих полях отображаются обновлённые значения. Однако после перезагрузки страницы редактирования поля вновь оказываются пустыми (или заполненными значениями по умолчанию). | |
В файле error.log системы (раздел Управление→Отчёты→Журнал ошибок административной панели) отображается следующее сообщение об ошибке: | |
[2016-10-19 08:18:19] (ERROR @ /var/www/init/www/core/xpdo/om/xpdoobject.class.php : 240) Error HY000 executing statement: | |
Array | |
( | |
[0] => HY000 | |
[1] => 3065 |
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
Если перед вами стоит задача написать компонент для MODX Revolution, выбирающий некие данные из БД и отображающий их, то с большой долей вероятности вам потребуется добавить постраничную навигацию. | |
Для MODX Revolution существует отличное дополнение getPage с широкими возможностями, которое превосходно справляется с этой задачей. От вас потребуется совсем немного, что бы подружить ваш компонент с getPage и заставить работать их в связке. | |
Немного о getPage | |
getPage - это вспомогательный сниппет, который служит для реализации постраничной навигации на сайте и является своеобразной "оберткой" для других сниппетов. | |
Установочный пакет в репозитории: http://modx.com/extras/package/getPage | |
Официальная документация: http://rtfm.modx.com/display/ADDON/getPage | |
Как работает getPage? |
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
$options = array(); | |
$translit = $modx->getOption('friendly_alias_translit', $options, 'russian'); | |
$translitClass = $modx->getOption('friendly_alias_translit_class', $options, 'translit.modTransliterate'); | |
$translitClassPath = $modx->getOption('friendly_alias_translit_class_path', $options, $modx->getOption('core_path', $options, MODX_CORE_PATH) . 'components/'); | |
$modx->getService('translit', $translitClass, $translitClassPath, $options); | |
$transliteratedtext = $modx->translit->translate($text, $translit); |
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
Выборка из масива Тип поля в БД должен быть json | |
В поле хранится по типу [one,two,three,four,five] | |
SELECT * FROM `table_name` WHERE JSON_CONTAINS(`field`,'[value]'); | |
В поле хранится по типу ID ТАБЛИЦЫ 1 - ["one","two","three","four","five"] | |
SELECT * FROM `table_name` WHERE JSON_CONTAINS(`field`,'['\"value\"']'); | |
SELECT * FROM `table_name` WHERE JSON_CONTAINS(`field`,JSON_ARRAY('value')); | |
SELECT JSON_EXTRACT((SELECT `field` FROM `table_name` WHERE `id` = 1),'$[index]') as title; |
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
sudo apt-get update && sudo apt-get upgrade | |
sudo apt-get install curl | |
sudo apt-get install software-properties-common | |
sudo apt-get install python-software-properties | |
sudo apt-get install language-pack-ru-base | |
sudo echo "ru_RU.CP1251 CP1251" >>/var/lib/locales/supported.d/ru | |
sudo locale-gen | |
sudo locale-gen en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export LANG=C.UTF-8 |