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 | |
$msop2 = $modx->getService('msop2', 'msop2', $modx->getOption('msop2_core_path', null, $modx->getOption('core_path') . 'components/msop2/') . 'model/msop2/', $scriptProperties); | |
if (!($msop2 instanceof msop2)) return ''; | |
$msop2Option = 0; | |
if(!$msop2Option = $modx->getObject('msop2Option', $name)) { | |
$msop2Option = $msop2Option->get('id'); | |
} | |
$miniShop2 = $modx->getService('minishop2'); | |
/* @var array $scriptProperties */ | |
/* @var pdoFetch $pdoFetch */ |
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
<div class="row ms2_product"> | |
<div class="col-md-8"> | |
<form method="post" class="ms2_form"> | |
<a href="{$rid | url}">{$product_pagetitle}</a> | |
{if $_pls['small']?} | |
<img src="{$_pls['small']}" alt="{$product_pagetitle}" title="{$product_pagetitle}"/> | |
{else} | |
<img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png" | |
srcset="{'assets_url' | option}components/minishop2/img/web/ms2_small@2x.png 2x" |
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 | |
/** | |
* Email validate | |
* | |
* @category validate | |
* @version 0.2 | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @global array $spamDomain массив с доменами спам-почт | |
* @param string $email проверяемый email | |
* @param boolean $spam проверять ли домен почты на наличе в спам базе |
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
<script type="text/javascript" language="JavaScript"> | |
jQuery(function($){ | |
$('#results').load('[[~43]]', { | |
action: 'field33', | |
parents: '3', | |
page: '1', | |
limit: '10', | |
//offset: '0' | |
//where: '{"Data.favorite":"1"}' | |
}); |
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
#!/bin/bash | |
USER=root | |
PASSWORD=111111 | |
BACKUP=/home/backup | |
OLD=7 # Сколько дней хранить бэкапы | |
# Создаем директорию для сегодняшнего бэкапа | |
DIR=$BACKUP/`date '+%Y-%m-%d'` | |
mkdir $DIR |
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 | |
/* | |
* WP Import, Ver 2015.01.04 | |
* (C) 2015 by ZoRg Soft | |
* MODx Notes - WP Import модуь для импорта записей из Wordpress | |
* http://agarkov.org/modx-x/evo-wpimport | |
*/ | |
$theme = $modx->config['manager_theme']; | |
$basePath = $modx->config['base_path']; |
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 | |
if (!$modx->user->isAuthenticated('mgr')) return; | |
$placeholders = $prefix ? array() : $modx->placeholders; | |
if ($prefix) { | |
foreach ($modx->placeholders as $key => $ph) { | |
if (strpos($key, $prefix) === 0) { | |
$placeholders[$key] = $ph; | |
} |
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 | |
/** | |
* Password generate | |
* | |
* @category generate | |
* @version 0.1 | |
* @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
* @param string $len длина пароля | |
* @param string $data правила генерации пароля | |
* @return string Строка с паролем |
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 | |
/* @var miniShop2 $miniShop2 */ | |
$miniShop2 = $modx->getService('minishop2'); | |
$miniShop2->initialize($modx->context->key); | |
$cart = $miniShop2->cart->status(); | |
$cart['total_cost'] = $miniShop2->formatPrice($cart['total_cost']); | |
$cart['total_weight'] = $miniShop2->formatWeight($cart['total_weight']); | |
$cart['total_my_count'] = count(array_count_values(array_values(array_map('array_shift',$_SESSION['minishop2']['cart'])))) | |
return !empty($tpl) ? $modx->getChunk($tpl, $cart) : print_r($cart,1); |
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
$(document).on('click', 'button[name="ms2_action_set"][value="cart/addset"]', function(e) { | |
var parentSelector = '.mssetincart-row'; | |
var formSelector = '.ms2_form'; | |
var sets = { | |
action: 'cart/add', | |
ctx: miniShop2Config.ctx, | |
id: 0, | |
count: 1, | |
options: [] |