Pavel

Pavel

С нами с 30 ноября 2018; Место в рейтинге пользователей: #854
Pavel
11 декабря 2018, 12:23
0
Спасибо. Пару дней поковыряю, если не смогу, напишу.
Pavel
11 декабря 2018, 12:18
0
Спасибо. Если мозгов не хватит, можно обратиться за помощью за благодарность?
Pavel
11 декабря 2018, 11:48
0
Нашел косяк с феномом))
Стиль был указал в начале странички, запихнул в {ignore}{/ignore}
Вот лог:
0.0001810: pdoTools loaded.
0.0004821: Conditions prepared
0.0000639: xPDO query object created
0.0003569: leftJoined msProductData as Data
0.0002632: leftJoined msVendor as Vendor
0.0000050: Grouped by msProduct.id
0.0000770: Added selection of msProduct: `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000429: Added selection of msProductData: `article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`, `availability`, `series`, `sort`
0.0000401: Added selection of msVendor: `name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`
0.0000510: Processed additional conditions
0.0004640: Added where condition: class_key=msProduct, Data.color(серебряный), Data.series(Tacto), msProduct.published=1, msProduct.deleted=0
0.0001159: Sorted by msProduct.id, ASC
0.0000060: Limited to 10, offset 0
0.0020580: SQL prepared "SELECT `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Data`.`availability`, `Data`.`series`, `Data`.`sort`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties` FROM `site_site_content` AS `msProduct` LEFT JOIN `site_ms2_products` `Data` ON `msProduct`.`id` =  `Data`.`id` LEFT JOIN `site_ms2_vendors` `Vendor` ON Data.vendor=Vendor.id WHERE  ( `msProduct`.`class_key` = 'msProduct' AND `Data`.`color` =  AND `Data`.`series` =  AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 )  GROUP BY msProduct.id ORDER BY msProduct.id ASC LIMIT 10 "
0.0001848: SQL executed
0.0000160: Rows fetched
0.0000191: Returning raw data
0.0047321: Total time
22 282 240: Memory usage
Но товар ни какой не выводит.
Pavel
11 декабря 2018, 11:44
0
Блок товара всё таки не как не загружается, при 'showLog' => '1', страничка пустая…
Хотел бы узнать, у меня после сохранения странички вечная ошибка
Parse error: syntax error, unexpected '<' in C:\Site\OSPanel\domains\localhost\core\cache\includes\elements\modsnippet\54.include.cache.php on line 217
Ругается на любой файлик кэша, там проблема такого рода…
код дублируется, тоесть после
}
return;
код вновь повторяется…
<?php
/** @var array $scriptProperties */
/** @var pdoFetch $pdoFetch */
я это побороть уже давно не могу, приходится постоянно вручную чистить кэш…
вот полны код файла

<?php
/** @var array $scriptProperties */
/** @var pdoFetch $pdoFetch */
$fqn = $modx->getOption('pdoFetch.class', null, 'pdotools.pdofetch', true);
$path = $modx->getOption('pdofetch_class_path', null, MODX_CORE_PATH . 'components/pdotools/model/', true);
if ($pdoClass = $modx->loadClass($fqn, $path, false, true)) {
    $pdoFetch = new $pdoClass($modx, $scriptProperties);
} else {
    return false;
}
$pdoFetch->addTime('pdoTools loaded');

if (!isset($from) || $from == '') {
    $from = 0;
}
if (empty($to)) {
    $to = $modx->resource->id;
}
if (empty($direction)) {
    $direction = 'ltr';
}
if ($outputSeparator == '&nbsp;&rarr;&nbsp;' && $direction == 'rtl') {
    $outputSeparator = '&nbsp;&larr;&nbsp;';
}
if ($limit == '') {
    $limit = 10;
}
// For compatibility with BreadCrumb
if (!empty($maxCrumbs)) {
    $limit = $maxCrumbs;
}
if (!empty($containerTpl)) {
    $tplWrapper = $containerTpl;
}
if (!empty($currentCrumbTpl)) {
    $tplCurrent = $currentCrumbTpl;
}
if (!empty($linkCrumbTpl)) {
    $scriptProperties['tpl'] = $linkCrumbTpl;
}
if (!empty($maxCrumbTpl)) {
    $tplMax = $maxCrumbTpl;
}
if (isset($showBreadCrumbsAtHome)) {
    $showAtHome = $showBreadCrumbsAtHome;
}
if (isset($showHomeCrumb)) {
    $showHome = $showHomeCrumb;
}
if (isset($showCurrentCrumb)) {
    $showCurrent = $showCurrentCrumb;
}
// --
$fastMode = !empty($fastMode);
$siteStart = $modx->getOption('siteStart', $scriptProperties, $modx->getOption('site_start'));

if (empty($showAtHome) && $modx->resource->id == $siteStart) {
    return '';
}

$class = $modx->getOption('class', $scriptProperties, 'modResource');
// Start building "Where" expression
$where = array();
if (empty($showUnpublished) && empty($showUnPub)) {
    $where['published'] = 1;
}
if (empty($showHidden)) {
    $where['hidemenu'] = 0;
}
if (empty($showDeleted)) {
    $where['deleted'] = 0;
}
if (!empty($hideContainers) && empty($showContainer)) {
    $where['isfolder'] = 0;
}

$resource = ($to == $modx->resource->id)
    ? $modx->resource
    : $modx->getObject($class, $to);

if (!$resource) {
    $message = 'Could not build breadcrumbs to resource "' . $to . '"';

    return '';
}

$parents = $modx->getParentIds($resource->id, $limit, array('context' => $resource->get('context_key')));
if (!empty($showHome)) {
    $parents[] = $siteStart;
}

$ids = array($resource->id);
foreach ($parents as $parent) {
    if (!empty($parent)) {
        $ids[] = $parent;
    }
    if (!empty($from) && $parent == $from) {
        break;
    }
}
$where['id:IN'] = $ids;

if (!empty($exclude)) {
    $where['id:NOT IN'] = array_map('trim', explode(',', $exclude));
}

// Fields to select
$resourceColumns = array_keys($modx->getFieldMeta($class));
$select = array($class => implode(',', $resourceColumns));

// Add custom parameters
foreach (array('where', 'select') as $v) {
    if (!empty($scriptProperties[$v])) {
        $tmp = $scriptProperties[$v];
        if (!is_array($tmp)) {
            $tmp = json_decode($tmp, true);
        }
        if (is_array($tmp)) {
            $$v = array_merge($$v, $tmp);
        }
    }
    unset($scriptProperties[$v]);
}
$pdoFetch->addTime('Conditions prepared');

// Default parameters
$default = array(
    'class' => $class,
    'where' => json_encode($where),
    'select' => json_encode($select),
    'groupby' => $class . '.id',
    'sortby' => "find_in_set(`$class`.`id`,'" . implode(',', $ids) . "')",
    'sortdir' => '',
    'return' => 'data',
    'totalVar' => 'pdocrumbs.total',
    'disableConditions' => true,
);

// Merge all properties and run!
$pdoFetch->addTime('Query parameters ready');
$pdoFetch->setConfig(array_merge($default, $scriptProperties), false);
$rows = $pdoFetch->run();

$output = array();
if (!empty($rows) && is_array($rows)) {
    if (strtolower($direction) == 'ltr') {
        $rows = array_reverse($rows);
    }

    foreach ($rows as $row) {
        if (!empty($useWeblinkUrl) && $row['class_key'] == 'modWebLink') {
            $row['link'] = is_numeric(trim($row['content'], '[]~ '))
                ? $pdoFetch->makeUrl(intval(trim($row['content'], '[]~ ')), $row)
                : $row['content'];
        } else {
            $row['link'] = $pdoFetch->makeUrl($row['id'], $row);
        }

        $row = array_merge(
            $scriptProperties,
            $row,
            array('idx' => $pdoFetch->idx++)
        );
        if (empty($row['menutitle'])) {
            $row['menutitle'] = $row['pagetitle'];
        }

        if ($row['id'] == $resource->id && empty($showCurrent)) {
            continue;
        } elseif ($row['id'] == $resource->id && !empty($tplCurrent)) {
            $tpl = $tplCurrent;
        } elseif ($row['id'] == $siteStart && !empty($tplHome)) {
            $tpl = $tplHome;
        } else {
            $tpl = $pdoFetch->defineChunk($row);
        }
        $output[] = empty($tpl)
            ? '<pre>' . $pdoFetch->getChunk('', $row) . '</pre>'
            : $pdoFetch->getChunk($tpl, $row, $fastMode);
    }
}
$pdoFetch->addTime('Chunks processed');

if (count($output) == 1 && !empty($hideSingle)) {
    $pdoFetch->addTime('The only result was hidden, because the parameter "hideSingle" activated');
    $output = array();
}

$log = '';
if ($modx->user->hasSessionContext('mgr') && !empty($showLog)) {
    $log .= '<pre class="pdoCrumbsLog">' . print_r($pdoFetch->getTime(), 1) . '</pre>';
}

if (!empty($toSeparatePlaceholders)) {
    $output['log'] = $log;
    $modx->setPlaceholders($output, $toSeparatePlaceholders);
} else {
    $output = implode($outputSeparator, $output);
    if ($pdoFetch->idx >= $limit && !empty($tplMax) && !empty($output)) {
        $output = ($direction == 'ltr')
            ? $pdoFetch->getChunk($tplMax, array(), $fastMode) . $output
            : $output . $pdoFetch->getChunk($tplMax, array(), $fastMode);
    }
    $output .= $log;

    if (!empty($tplWrapper) && (!empty($wrapIfEmpty) || !empty($output))) {
        $output = $pdoFetch->getChunk($tplWrapper, array('output' => $output, 'crumbs' => $output), $fastMode);
    }

    if (!empty($toPlaceholder)) {
        $modx->setPlaceholder($toPlaceholder, $output);
    } else {
        return $output;
    }
}
return;
<?php
/** @var array $scriptProperties */
/** @var pdoFetch $pdoFetch */
$fqn = $modx->getOption('pdoFetch.class', null, 'pdotools.pdofetch', true);
$path = $modx->getOption('pdofetch_class_path', null, MODX_CORE_PATH . 'components/pdotools/model/', true);
if ($pdoClass = $modx->loadClass($fqn, $path, false, true)) {
    $pdoFetch = new $pdoClass($modx, $scriptProperties);
} else {
    return false;
}
$pdoFetch->addTime('pdoTools loaded');

if (!isset($from) || $from == '') {
    $from = 0;
}
if (empty($to)) {
    $to = $modx->resource->id;
}
if (empty($direction)) {
    $direction = 'ltr';
}
if ($outputSeparator == '&nbsp;&rarr;&nbsp;' && $direction == 'rtl') {
    $outputSeparator = '&nbsp;&larr;&nbsp;';
}
if ($limit == '') {
    $limit = 10;
}
// For compatibility with BreadCrumb
if (!empty($maxCrumbs)) {
    $limit = $maxCrumbs;
}
if (!empty($containerTpl)) {
    $tplWrapper = $containerTpl;
}
if (!empty($currentCrumbTpl)) {
    $tplCurrent = $currentCrumbTpl;
}
if (!empty($linkCrumbTpl)) {
    $scriptProperties['tpl'] = $linkCrumbTpl;
}
if (!empty($maxCrumbTpl)) {
    $tplMax = $maxCrumbTpl;
}
if (isset($showBreadCrumbsAtHome)) {
    $showAtHome = $showBreadCrumbsAtHome;
}
if (isset($showHomeCrumb)) {
    $showHome = $showHomeCrumb;
}
if (isset($showCurrentCrumb)) {
    $showCurrent = $showCurrentCrumb;
}
// --
$fastMode = !empty($fastMode);
$siteStart = $modx->getOption('siteStart', $scriptProperties, $modx->getOption('site_start'));

if (empty($showAtHome) && $modx->resource->id == $siteStart) {
    return '';
}

$class = $modx->getOption('class', $scriptProperties, 'modResource');
// Start building "Where" expression
$where = array();
if (empty($showUnpublished) && empty($showUnPub)) {
    $where['published'] = 1;
}
if (empty($showHidden)) {
    $where['hidemenu'] = 0;
}
if (empty($showDeleted)) {
    $where['deleted'] = 0;
}
if (!empty($hideContainers) && empty($showContainer)) {
    $where['isfolder'] = 0;
}

$resource = ($to == $modx->resource->id)
    ? $modx->resource
    : $modx->getObject($class, $to);

if (!$resource) {
    $message = 'Could not build breadcrumbs to resource "' . $to . '"';

    return '';
}

$parents = $modx->getParentIds($resource->id, $limit, array('context' => $resource->get('context_key')));
if (!empty($showHome)) {
    $parents[] = $siteStart;
}

$ids = array($resource->id);
foreach ($parents as $parent) {
    if (!empty($parent)) {
        $ids[] = $parent;
    }
    if (!empty($from) && $parent == $from) {
        break;
    }
}
$where['id:IN'] = $ids;

if (!empty($exclude)) {
    $where['id:NOT IN'] = array_map('trim', explode(',', $exclude));
}

// Fields to select
$resourceColumns = array_keys($modx->getFieldMeta($class));
$select = array($class => implode(',', $resourceColumns));

// Add custom parameters
foreach (array('where', 'select') as $v) {
    if (!empty($scriptProperties[$v])) {
        $tmp = $scriptProperties[$v];
        if (!is_array($tmp)) {
            $tmp = json_decode($tmp, true);
        }
        if (is_array($tmp)) {
            $$v = array_merge($$v, $tmp);
        }
    }
    unset($scriptProperties[$v]);
}
$pdoFetch->addTime('Conditions prepared');

// Default parameters
$default = array(
    'class' => $class,
    'where' => json_encode($where),
    'select' => json_encode($select),
    'groupby' => $class . '.id',
    'sortby' => "find_in_set(`$class`.`id`,'" . implode(',', $ids) . "')",
    'sortdir' => '',
    'return' => 'data',
    'totalVar' => 'pdocrumbs.total',
    'disableConditions' => true,
);

// Merge all properties and run!
$pdoFetch->addTime('Query parameters ready');
$pdoFetch->setConfig(array_merge($default, $scriptProperties), false);
$rows = $pdoFetch->run();

$output = array();
if (!empty($rows) && is_array($rows)) {
    if (strtolower($direction) == 'ltr') {
        $rows = array_reverse($rows);
    }

    foreach ($rows as $row) {
        if (!empty($useWeblinkUrl) && $row['class_key'] == 'modWebLink') {
            $row['link'] = is_numeric(trim($row['content'], '[]~ '))
                ? $pdoFetch->makeUrl(intval(trim($row['content'], '[]~ ')), $row)
                : $row['content'];
        } else {
            $row['link'] = $pdoFetch->makeUrl($row['id'], $row);
        }

        $row = array_merge(
            $scriptProperties,
            $row,
            array('idx' => $pdoFetch->idx++)
        );
        if (empty($row['menutitle'])) {
            $row['menutitle'] = $row['pagetitle'];
        }

        if ($row['id'] == $resource->id && empty($showCurrent)) {
            continue;
        } elseif ($row['id'] == $resource->id && !empty($tplCurrent)) {
            $tpl = $tplCurrent;
        } elseif ($row['id'] == $siteStart && !empty($tplHome)) {
            $tpl = $tplHome;
        } else {
            $tpl = $pdoFetch->defineChunk($row);
        }
        $output[] = empty($tpl)
            ? '<pre>' . $pdoFetch->getChunk('', $row) . '</pre>'
            : $pdoFetch->getChunk($tpl, $row, $fastMode);
    }
}
$pdoFetch->addTime('Chunks processed');

if (count($output) == 1 && !empty($hideSingle)) {
    $pdoFetch->addTime('The only result was hidden, because the parameter "hideSingle" activated');
    $output = array();
}

$log = '';
if ($modx->user->hasSessionContext('mgr') && !empty($showLog)) {
    $log .= '<pre class="pdoCrumbsLog">' . print_r($pdoFetch->getTime(), 1) . '</pre>';
}

if (!empty($toSeparatePlaceholders)) {
    $output['log'] = $log;
    $modx->setPlaceholders($output, $toSeparatePlaceholders);
} else {
    $output = implode($outputSeparator, $output);
    if ($pdoFetch->idx >= $limit && !empty($tplMax) && !empty($output)) {
        $output = ($direction == 'ltr')
            ? $pdoFetch->getChunk($tplMax, array(), $fastMode) . $output
            : $output . $pdoFetch->getChunk($tplMax, array(), $fastMode);
    }
    $output .= $log;

    if (!empty($tplWrapper) && (!empty($wrapIfEmpty) || !empty($output))) {
        $output = $pdoFetch->getChunk($tplWrapper, array('output' => $output, 'crumbs' => $output), $fastMode);
    }

    if (!empty($toPlaceholder)) {
        $modx->setPlaceholder($toPlaceholder, $output);
    } else {
        return $output;
    }
}
return;
Pavel
11 декабря 2018, 11:29
0
419 строка такая? $this->fenom($data, $properties)
Но modDevTools помог найти этот косяк. Спасибо за подсказку)))
Страница теперь загружается… буду смотреть что с кодом
Pavel
11 декабря 2018, 09:04
0
у меня с феномом на сайте почему то не грузятся странички, вообще, пустая загружается при малейшем коде фенома на странице, даже через чанки.
Вот такая ошибка падает.
[2018-12-11 09:13:20] (ERROR @ C:\Site\OSPanel\domains\localhost\core\components\pdotools\model\pdotools\pdotools.class.php: 989) Unexpected tag 'parent' (this tag can be used with 'block') in 045eb54d7a0fb9871b507200a46554fd line 419, near '{parent:' < — there
Pavel
05 декабря 2018, 10:45
0
msmcdcount.js:34 Uncaught ReferenceError: msMCDMiniCart is not defined
at HTMLDivElement.(msmcdcount.js:34)
at HTMLDocument.dispatch (jquery.js:5)
at HTMLDocument.v.handle (jquery.js:5)
Pavel
05 декабря 2018, 10:41
0
Как вызывать это? Как сделать, чтобы кнопки + — стали активны?
Я могу их через инпут полностью написать, но тогда смысл в этом дополнении?
Pavel
04 декабря 2018, 16:19
0
А как сделать вывод такого же цвета, как у товара на странице?
Pavel
04 декабря 2018, 15:25
0
Приветствую. Еще не реализовано?
Pavel
03 декабря 2018, 14:53
0
Подскажите плиз, почему кнопки + — не активы? их нельзя нажать.