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 | |
//настройки для коннекта к gifts | |
$giftsLogin = '****_xmlexport'; | |
$giftsPass = '****'; | |
$giftsUrlProduct = "http://{$giftsLogin}:{$giftsPass}@api2.gifts.ru/export/v2/catalogue/product.xml"; | |
$giftsUrlTree = "http://{$giftsLogin}:{$giftsPass}@api2.gifts.ru/export/v2/catalogue/tree.xml"; | |
$giftsUrlStock = "http://{$giftsLogin}:{$giftsPass}@api2.gifts.ru/export/v2/catalogue/stock.xml"; | |
$giftsUrlFilters = "http://{$giftsLogin}:{$giftsPass}@api2.gifts.ru/export/v2/catalogue/filters.xml"; | |
$urlImages = 'http://files.gifts.ru/reviewer/'; |
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> | |
function resizeImg(){ | |
$( ".slides li img" ).each(function( index, element ){ | |
$( element ).removeAttr("width") | |
.removeAttr("height") | |
.removeAttr("margin-top") | |
.removeAttr("margin-left") | |
.css({ width: "", height: "", "margin-top": "", "margin-left": "" }); |
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 | |
$id = $modx->resource->id; | |
if (!isset($limit)) {$limit = 4;} | |
// Добавляем просмотренный товар MS2 в сессию | |
if ($modx->resource->get('class_key') == 'msProduct') { | |
if (!isset($_SESSION['viewedrecent'])) { | |
$_SESSION['viewedrecent'] = array($id); | |
} | |
else { |
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 | |
define('MODX_API_MODE', true); | |
require_once(dirname(__FILE__).'/index.php'); | |
// Включаем обработку ошибок | |
$modx->getService('error','error.modError'); | |
$modx->setLogLevel(modX::LOG_LEVEL_ERROR); | |
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); | |
$modx->error->message = null; // Обнуляем переменную | |
$parent = 15; |
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 | |
$tplProduct = 3; //номер шаблона для карточки товара | |
$tplParent = 2; //номер шаблона для категорий | |
$tplChildParent = 2; //номер шаблона для подкатегорий | |
$idParent = 6; //id каталога товаров | |
$fileProduct = 'product.xml'; //имя файла с товарами | |
$xpath_expression['pagetitle'] = '//Товары/Номенклатура'; //DOM структура в XML файле до имени | |
$xpath_expression['article'] = '//Товары/Артикул'; //DOM структура в XML файле до артикула | |
$xpath_expression['parents'] = '//Товары/Родитель'; //DOM структура в XML файле до родителей |
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 | |
/** | |
* требуется библиотека phpQuery | |
**/ | |
$parserURL = array( | |
'Уголовные дела' => 'https://pravoved.ru/questions/criminal-law/' | |
,'Дела семейные' => 'https://pravoved.ru/questions/family-law/' | |
,'Недвижимость' => 'https://pravoved.ru/questions/realty/' | |
,'Автоюрист' => 'https://pravoved.ru/questions/auto-law/' | |
,'Наследственные дела' => 'https://pravoved.ru/questions/inheritance/' |
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 | |
// Add RTE for introtext if richtext option is enabled for the resource | |
// check "OnDocFormRender" event | |
$modx->regClientStartupHTMLBlock('<script>Ext.onReady(function() { | |
if(MODx.loadRTE) MODx.loadRTE("modx-resource-introtext"); | |
});</script>'); |
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
<!--noindex--> | |
<p id="texthidecomments" style="text-align:center;font-style:italic">----- некоторые вопросы были скрыты -----</p> | |
<h4 id="showallcomments" style="display: block;"> | |
<a href="[[*uri]]#" class="wpb_button_anone"><span class="wpb_none btn btn-default">Показать все вопросы</span></a> | |
</h4> | |
<!--/noindex--> | |
<script> | |
jQuery( document ).ready(function() { | |
var $div = jQuery("li[data-parent=0]"); | |
var start = 7; |
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 | |
$out = ''; | |
if($tv = $modx->resource->getTVValue('slider-inside-oneclick')){ | |
$tv_arr = $modx->fromJSON($tv); | |
if(is_array($tv_arr)){ | |
foreach($tv_arr as $v){ | |
if(!$v['name']) $v['name'] = $modx->resource->get('pagetitle'); | |
$out .= $modx->parseChunk('tpl.slider-inside-oneclick', $v); | |
} | |
} |
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 | |
$allFormFields = $hook->getValues(); | |
if(is_array($allFormFields)){ | |
foreach($allFormFields as $k => $v){ | |
if (filter_var($v, FILTER_VALIDATE_EMAIL)) { | |
$mail = trim($v); | |
} | |
} | |
if($mail){ |