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 | |
$siteName = $modx->getOption('siteName', $scriptProperties, $modx->getOption('site_name')); // Имя сайта | |
$companyName = $modx->getOption('companyName', $scriptProperties, $modx->getOption('site_name')); // Компания | |
$bid = $modx->getOption('bid', $scriptProperties, 10); // Цена за клик | |
$siteUrl = $modx->makeUrl($modx->getOption('site_start'), '', '', 'full'); // Ссылка на главную страницу сайта | |
$descTpl = strip_tags($modx->getOption('descTpl', $scriptProperties, '[[+description]]')); // Шаблон для описания товара, без html | |
$paramCurrency = $modx->getOption('paramCurrency', $scriptProperties, 'RUR'); // Валюта | |
$paramDelivery = $modx->getOption('paramDelivery', $scriptProperties, true); // Доставка, по умолчанию - да. Можно указать имя параметра. | |
////////////////////////////////////////////////////////////////////////////// |
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
/** v.1.1.0 -- */ | |
msfavorites = { | |
options: { | |
selector: '.msfavorites', | |
add: '.msfavorites-add', | |
remove: '.msfavorites-remove', | |
go: '.msfavorites-go', | |
total: '.msfavorites-total', | |
element: '.ms2_product', |
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 | |
switch ($modx->event->name) { | |
case 'OnManagerPageBeforeRender': | |
$msoptionscolor = $modx->getService('msoptionscolor', 'msoptionscolor', $modx->getOption('msoptionscolor_core_path', null, $modx->getOption('core_path') . 'components/msoptionscolor/') . 'model/msoptionscolor/'); | |
if (!($msoptionscolor instanceof msoptionscolor)) { | |
return ''; | |
} | |
if (!$config = $controller->config) { | |
return ''; |
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 | |
/** @var modX $modx */ | |
switch ($modx->event->name) { | |
case 'msOnChangeOrderStatus': | |
// Update customer stat | |
if ($status = $modx->getObject('msOrderStatus', array('id' => $status, 'active' => 1))) { | |
if ($miniShop2 = $modx->getService('miniShop2')) { | |
$miniShop2->initialize($modx->context->key, array( |
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 ($modx->event->name == 'OnWebPageInit') { | |
// Получаем ресурс | |
if (!is_object($modx->resource)) { | |
$modx->resource = $modx->request->getResource($modx->resourceMethod, $modx->resourceIdentifier); | |
} | |
} |
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
// Все элементы класса .social_share считаем кнопками шаринга | |
$(document).on('click', '.social_share', function(){ | |
Share.go(this); | |
}); |
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 method="post" onkeypress="if(event.keyCode == 13) return false;"> | |
</form> |
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. Нужно найти все коммиты, которые изменяли файл: | |
git log --pretty=oneline --branches -- BIGFILE.ZIP | |
2.1 Удалить ссылки на файл из всей истории коммитов, начиная с последнего (пусть, хеш последнего коммита - 6df7640): | |
git filter-branch --index-filter 'git rm --cached BIGFILE.ZIP --ignore-unmatch' --prune-empty --tag-name-filter cat -- --all | |
2.2 Удалить ссылки на каталог из истории коммитов: | |
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch BIG/DIR' --prune-empty --tag-name-filter cat -- --all | |
3. Отправляем изменения на сервер: |
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 | |
Ставим Apache2 | |
apt-get install apache2 | |
Настроим Apache2 | |
nano /etc/apache2/apache2.conf | |
## Фиксим предупреждения при перезапуске Apache | |
ServerName localhost |
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 install apache2 mysql-server mysql-client vsftpd ssh mc git | |
Настройка php | |
Включаем php в виде модуля апачи: | |
sudo apt install php7.0 libapache2-mod-php7.0 | |
sudo a2enmod rewrite |
OlderNewer