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 | |
$db_server = "localhost"; // hostname MySQL server | |
$db_username = "cl723w"; // username MySQL server | |
$db_password = "Wwe"; // password MySQL server | |
$db_name = "cl7"; // database name | |
$pattern = "a_"; // search string | |
$new_pattern = "b_"; // replacement string, | |
// can be empty | |
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 | |
/** | |
* Get full parsed HTML from resource | |
* (you already need to have the resource object available in $this->resource) | |
* | |
* @access public | |
* @return string $html The parsed html of the resource | |
*/ | |
public function parseResource() { | |
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 | |
switch ($modx->event->name) { | |
case 'OnLoadWebDocument': | |
// id ресурса | |
$id = $modx->resource->get('id'); | |
// объект ресурса | |
$doc = $modx->resource; | |
// текущий контекст | |
$mgrCtx = $modx->context->get('key'); |
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 | |
$ress = $modx->getIterator('msProduct', ['class_key' => 'msProduct']); | |
foreach($ress as $res){ | |
$introtext = $res->get('introtext'); | |
if($introtext){ | |
$introtext = preg_replace('/\?\s{0,}-Хранение/iu', '🏰-Хранение', $introtext ); | |
$introtext = preg_replace('/\?-<\/span><\/span>Хранение/iu', '🏰-</span></span>Хранение', $introtext ); | |
$introtext = preg_replace('/\?\s{0,}️-Развал/iu', '🛠️-Развал', $introtext ); | |
$introtext = preg_replace('/\?- Доставка по/iu', '🚀- Доставка по', $introtext ); |
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(dirname(dirname(dirname(__FILE__)))) . '/index.php'; | |
$modx->getService('error','error.modError'); | |
$modx->setLogLevel(modX::LOG_LEVEL_ERROR); | |
$modx->setLogTarget('FILE'); | |
if ($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') { | |
$modx->sendRedirect($modx->makeUrl($modx->getOption('site_start'),'','','full')); //отфильтровываем все не ajax запросы | |
} |
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 onFormSubmit(e) { | |
if( e ) { | |
values = e.range.getValues(); | |
theNewRow = values[0]; | |
var response = UrlFetchApp.fetch('https://test.ru/assets/components/newsletters/googleform_hook.php?id=1&form=TestForm&data='+theNewRow, {'muteHttpExceptions': true}); | |
Logger.log(response); | |
} | |
} |
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 | |
$tablePrefix = $modx->getOption(xPDO::OPT_TABLE_PREFIX); | |
$modx->addPackage('colorsproducts', $modx->getOption('core_path') . 'components/colorsproducts/model/', $tablePrefix); | |
$in = json_decode(file_get_contents('https://www.ceresit-coloursofnature.com/api/facade-designer/categories/6'), true); | |
print_r($in['data']['colours']); | |
foreach($in['data']['colours'] as $color){ | |
if($color['images']['thumb']){ | |
$name_img = mb_strtolower(end(explode('/', $color['images']['thumb']))); |
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 | |
/* | |
* API для Долями | |
* by [email protected] / andronex | |
* интеграция от 20 т.р. | |
*/ | |
use VKolegov\DolyameAPI\DolyameAPIClient; | |
use VKolegov\DolyameAPI\Entities\OrderInfo; | |
use VKolegov\DolyameAPI\Entities\OrderItems; | |
use VKolegov\DolyameAPI\Entities\RefundResponse; |
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 (!isset($modx)) { | |
define('MODX_API_MODE', true); | |
while (!isset($modx) && ($i = isset($i) ? --$i : 10)) { | |
if (($file = dirname(!empty($file) ? dirname($file) : __FILE__) . '/index.php') AND !file_exists($file)) { | |
continue; | |
} | |
require_once $file; | |
} | |
if (!is_object($modx)) { |
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 | |
/* сопоставление категорий каталога happygifts с сайтом | |
* @array id категории happy, название, id аналогичной категории на сайте | |
*/ | |
$in = [[910,'Аксессуары для красоты','174'], | |
[2713,'Аромаподарки','14240'], | |
[3433,'Пробники ароматов','33'], | |
[701,'Деловые и офисные аксессуары','79'], | |
[1366,'Дождевики','14621'], | |
[733,'Ежедневники и бизнес-блокноты','195'], |
NewerOlder