Skip to content

Instantly share code, notes, and snippets.

<?php
require_once '_fenom.php';
class FenomPlus extends FenomX
{
/**
* @inheritdoc
*/
protected function _addDefaultModifiers()
{
<?php
$oneBooking = $modx->getService('onebooking','oneBooking',$modx->getOption('core_path').'components/onebooking/model/onebooking/', $scriptProperties);
if (!($oneBooking instanceof oneBooking)) return '';
$included = array();
if (!empty($scriptProperties['fields'])) {
$included = explode(',',$scriptProperties['fields']);
array_walk($included,'trim');
}
$fields = false;
@sergant210
sergant210 / gist:4a5e631a7005bea680da
Created September 19, 2015 13:41
Скрипт переноса данных из HitsPage в siteStatistics
<?php
$tstart = microtime(true);
$hits = array();
$q = $modx->newQuery('modResource');
$q->select('id,properties');
$q->sortby('id');
// Для поэтапной обработки указываем limit и offset
//$q->limit(100,0);
if ($q->prepare() && $q->stmt->execute()) {
while($row = $q->stmt->fetch(PDO::FETCH_ASSOC)) {
@sergant210
sergant210 / showErrors.php
Last active August 29, 2015 14:25
Show errors from the system error log in a new window
<?php
switch ($modx->event->name) {
case 'OnManagerPageBeforeRender':
// Определяем названия // Define titles on your language
$lang['no'] = 'Нет'; //No
$lang['yes'] = 'Есть'; //Yes
$lang['errors'] = 'Ошибки'; //Errors
$lang['errors_title'] = 'Открыть журнал ошибок в новом окне'; //Open the error log in a new window
//
$response = $modx->runProcessor('system/errorlog/get');
@sergant210
sergant210 / default2
Created February 19, 2015 15:39
mSearch2/default2.js
var mSearch2 = {
options: {
wrapper: '#mse2_mfilter'
,filters: '#mse2_filters'
,results: '#mse2_results'
,total: '#mse2_total'
,pagination: '#mse2_pagination'
,sort: '#mse2_sort'
,limit: '#mse2_limit'
,slider: '.mse2_number_slider'
@sergant210
sergant210 / mSearch2ext
Last active August 29, 2015 14:15
Класс mSearch2ext
<?php
/**
* The extended class for mSearch2.
* Feature: search in found
*/
require_once 'mSearch2.class.php';
class mSearch2ext extends mSearch2 {
/** @var array $resources */
public $resources = array();