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 | |
/* | |
* Хук компонента FormIt для отправки сообщений в Telegram | |
* Автор: Алексей Митин, viplexa@gmail.com | |
*/ | |
// Токен бота | |
$token = ""; | |
// Кому отправлять сообщение |
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 | |
// msOnCreateOrder | |
// msOnChangeOrderStatus | |
switch ($modx->event->name) { | |
case 'msOnCreateOrder': | |
// Новый заказ | |
// $modx->log(xPDO::LOG_LEVEL_ERROR, 'msOnCreateOrder'); | |
$iOrderId = $msOrder->get('id'); | |
$oOrder = $order->get(); |
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 | |
/* ActivateNotify Plugin | |
by Breezer | |
http://forums.modx.com/index.php?topic=53213.0%3Bwap2 | |
8/15/2010 7:12 pm est | |
*/ | |
if ($modx->event->name == 'OnUserActivate') { | |
// array of emails to send the notification |
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
/* | |
LocalBusiness Schema | |
*/ | |
<script type="application/ld+json"> | |
{ | |
"@context": "http://schema.org", | |
"@type": "LocalBusiness", | |
"name": "Search Engine Rescue", | |
"image": "https://www.searchenginerescue.co.uk/sites/all/themes/ser_theme/images/ser-logo-variants/ser-horizontal-72dpi.png", | |
"@id": "https://www.searchenginerescue.co.uk/#organisation", |
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
<div itemscope="" itemtype="http://schema.org/Person"> | |
<meta itemprop="gender" content="Male"> | |
<meta itemprop="birthDate" content="March 21, 1978"> | |
<meta itemprop="spouse" content="Rebecca Kirshner"> | |
<meta itemprop="parent" content="Jack Kirshner"> | |
<meta itemprop="jobTitle" content="CEO of Elite SEM and Coffeeforless"> | |
<meta itemprop="email" content="ben@elitesem.com"> | |
<meta itemprop="url" content="http://www.benkirshner.com"> | |
<meta itemprop="memberOf" content="Young President's Organization"> | |
<meta itemprop="memberOf" content="SEMPO"> |
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
<script> | |
$(document).ready(function() { | |
AjaxForm.Message.success = function() {}; | |
}); | |
$(document).on('af_complete', function(event,res) { | |
if(res.success) $('.fancybox-close-small').click(); | |
if (res.success) { | |
// показываем сообщение об успехе | |
$.fancybox.close(); |
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
{set $rows = 1 | resource : 'partner' | fromJSON} | |
<div> | |
<ul class="partners"> | |
{foreach $rows as $row index=$idx} | |
<li><a href="{$row.url}"><img src="{$row.image}" alt=""></a>{$idx}</li> | |
{if ($idx+1) % 3 == 0 && count($rows) > $idx+1 } | |
</ul> </div> <div> <ul class="partners"> | |
{/if} | |
{/foreach} | |
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 'msOnGetProductPrice': | |
$returned_values = & $modx->event->returnedValues; | |
$values = $modx->event->params['data']; | |
$returned_values['price'] = ceil($values['price']/100)*100; // округляем в большу сторону | |
break; |
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 | |
$token = "5048022178:AAGMwxxsWqYxm-2zO0fme1WJrXoGrUP7taU"; | |
$chat_id = "-1001544150342"; | |
$values = $hook->getValues(); | |
// Получаем название формы | |
$formName = $modx->getOption('formName', $formit->config, 'form-'.$modx->resource->get('id')); | |
// Получаем ip адрес отправителя |
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
# вызов сниппета с формой поиска | |
[[!mSearchForm? | |
&fields=`pagetitle:5,vendor.name:3,content:1,description:1,introtext:1` | |
&minQuery=`2` | |
&pageId=`8` | |
&includeThumbs=`360x270` | |
&element=`mSearch2` | |
&includeTVs=`img` | |
&autocomplete=`results` | |
&onlyIndex=`false` |
NewerOlder