getExtension() == 'php'; $bl_id = $db->get_row("select Subdivision_ID as sub, Sub_Class_ID as cc from Sub_Class where Class_ID = '2016' AND Catalogue_ID='$catalogue' LIMIT 0,1", ARRAY_A); $parentSubSql = []; foreach ($parent_sub_tree as $parent_sub) { if (isset($parent_sub['Subdivision_ID']) && $parent_sub['Subdivision_ID'] != $sub) { $parentSubSql[] = $parent_sub['Subdivision_ID']; } } $where = "block.`Checked` = 1 AND block.`Subdivision_ID` = '{$bl_id['sub']}' AND EXISTS ( SELECT * FROM Showing_Blocks AS showB WHERE block.`Message_ID` = showB.`Block_ID` AND ( showB.`Subdivision_ID` = {$sub} " . (!empty($parentSubSql) ? "OR showB.`Subdivision_ID` IN (" . implode(',', $parentSubSql) . ") AND showB.`extends` = 1" : null) . " ) ) != block.`fixblock`"; if ($setting['targeting'] && ($cityid >= 0 || !$cityid)) { if (!isset($cityid)) $cityid = 9999; $where .= " AND (block.citytarget like '%,{$cityid},%' OR block.citytarget IS null OR block.citytarget = '' OR block.citytarget = ',,')"; } $where = getLangQuery($where, 'block'); $selectBlsql = "SELECT block.`Message_ID`, block.`Subdivision_ID`, block.`Sub_Class_ID`, block.`Checked`, block.`Priority`, block.`notitle`, block.`width`, block.`col`, block.`pos`, block.`name`, block.`nolink`, block.`recnum`, block.`rand`, block.`substr`, block.`bgimg`, block.`sub`, block.`cc`, block.`msg`, block.`ctpl`, block.`noindex`, block.`height`, block.`inmob`, block.`iscache`, block.`cache`, block.`text`, block.`no_in_full_obj`, block.`no_in_list_obj`, block.`cachetime`, block.`lastcache`, block.`cssclass`, block.`vars`, block.`padding`, block.`phpset`, block.`settings`, block.`block_id` FROM Message2016 as block WHERE {$where} ORDER BY block.`Priority`"; $blocks = $db->get_results($selectBlsql, 'ARRAY_A'); if ($blocks) { // debug: посмотреть все блоки на странице ?debug_show_all_blocks=all if ($_GET['debug_show_blocks'] == 'all') { foreach ($blocks as $b) { $all_blocks[] = $b['Message_ID']; } die("Отключить все блоки: http://" . $HTTP_HOST . "/?debug_no_blocks=-" . implode("-", $all_blocks) . "-"); } foreach ($blocks as $b) { // начало блока // debug: отключение блоков if ($_GET['debug_no_blocks'] && strstr($_GET['debug_no_blocks'], "-" . $b['Message_ID'] . "-")) continue; $dopclass = $dopclass2 = $blockHtml = $blockHtmlCont = $classNum = $block = $name = $col = $templ = $pos = $settings = $phpset = $contset = $contsetclass = $menuHtml = $blklr = null; # ЭКСПЕРИМЕНТАЛЬНО не выводить блоки в мобилкке, если он только для десктопа (нужно решить вопрос с планшетами, они определеются как мобильные) $siteArrNoBlock = array(970); if (in_array($catalogue, $siteArrNoBlock) && is_mobile() && $b[inmob] == 2) continue; # не выводить блок если он не для мобильного приложения и это приложение if (($b['inmob'] == 2 || $b['inmob'] == 3) && $_SESSION['deviceID']) continue; # не выводить блок если он для мобильного приложения, но это не приложение if ($b['inmob'] == 4 && !$_SESSION['deviceID']) continue; // if($b['name'] == "Каталог") continue; if ($b['no_in_full_obj'] && $action == 'full') continue; if ($b['no_in_list_obj'] && $action != 'full' && $current_cc['Class_ID'] == 2001) continue; $col = ($b['col'] > 0 ? $b['col'] : 'banner'); if ($b['recnum'] > 50) $b['recnum'] = 50; if ($pageIsPhpScript && in_array($col, NO_LINE_ZONE_ARRAY)) continue; if ($b['phpset']) { // настройки php $phpset = orderArray($b['phpset']); if ($phpset['contsetclass']) { $contset = $phpset['contsetclass']; foreach ($phpset['contsetclass'] as $k => $v) { $contsetclass .= "&{$k}={$v}"; } //if (!$contset[nc_ctpl]) $contsetclass .= "&nc_ctpl=1"; } } $settings = orderArray($b['settings']); // настройки визуальные if (!$b['iscache'] || !$b['cache'] || ($b['iscache'] && $b['cachetime'] && $b['lastcache'] < time())) { // если нет кэша или не кэшируется или время кэша вышло $params = subParams($b['sub']); if ($b['cc'] > 0) $classNum = $db->get_var("select Class_ID from Sub_Class where Sub_Class_ID = '" . $b['cc'] . "'"); $name = ($b['name'] ? $b['name'] : $params['name']); $pos = $b['pos']; // классы start end $grid = ($b['col'] == 2 ? '3' : (in_array($b['col'], array(3, 4, 5)) ? ($setting['htmlShema'] == 1 || $setting['htmlShema'] == 2 ? '9' : '6') : '12')); if ($zoneid != $b['col']) { $zoneid = $b['col']; $zonewnow = 0; } if ($zonewnow == 0 || ($zonewnow + $b[width]) > $grid) { $blklr .= "start "; $zonewnow = 0; } if (($zonewnow + $b['width']) <= $grid) { $zonewnow += $b['width']; if ($zonewnow == $grid) { $blklr .= "end "; $zonewnow = 0; } } $dopclass .= (!$_SESSION['cart']['items'] && $classNum == 2005 && $contset['minicarttype'] > 2 ? " none" : null); $dopclass2 .= ($classNum == 2005 ? " smallcart" . ($setting['minicart'] > 0 ? " smallcart_type{$setting['minicart']}" : null) : null); $dopclass .= ($contset['minicartbord'] == 1 ? " basket_mini_open_border_solid" : null); $dopclass .= ($contset['minicartbord'] == 2 ? " basket_mini_open_border_dashed" : null); $dopclass .= ($contset['minicartbg'] ? " basket_mini_open_bg" : null); $dopclass .= " type-block-" . $phpset['contenttype']; $dopclass .= " menu-type-" . $contset['menutpl']; $dopclass .= (($phpset['contenttype'] && $contset['menutpl'] == 1) ? " mainmenu" : null); $dopclass .= (($phpset['contenttype'] && $contset['menutpl'] >= 20) ? " submenublock" : null); $dopclass .= ($contset['menutpl'] > 0 ? " thismenu submenutype" . $contset['menutpl'] : null); $dopclass .= ($b['ctpl'] == 2019 ? " searchblock" : null); $dopclass .= ($b['inmob'] == 1 ? " mobyes" : null); $dopclass .= ($b['inmob'] == 2 || $contset['menutpl'] == 2 || $contset['menutpl'] == 20 ? " nomob" : null); $dopclass .= ($b['cssclass'] ? " {$b['cssclass']}" : null); $dopclass .= ($b['bgimg'] ? ' imgbg' : null); $dopclass .= ($classNum ? " class{$classNum}" : null); $dopclass .= ($contset['nc_ctpl'] ? " sdfgdf nc" . $contset['nc_ctpl'] : null); $dopclass .= ($b['notitle'] ? " notitle" : null); $dopclass .= ($b['height'] && $b['height'] != '100%' ? " heightFix" : null); $dopclass .= ($b['height'] == '100%' ? " h100" : null); $dopclass .= ($b['margin'] > 0 ? " nomarg" . $b['margin'] : null); $dopclass .= ($b['msg'] > 0 ? " msg" . $b['msg'] : null); $dopclass .= ($settings['borderwidth'] && $settings['bordercolor'] ? " blk_padding" : null); // bg of header and body is deleted (ломает поиск) $dopclass .= ($b['padding'] && (!$settings['headbg'] && (!$settings['borderwidth'] || !$settings['bordercolor']) && !$settings['bg']) ? " blk_nomarg_head" : null); $dopclass .= ($b['padding'] ? " blk_nomarg_cont" : null); $dopclass .= (!(($settings['borderwidth'] && $settings['bordercolor']) || $settings['bg']) ? " blk_nomarg_cont_lr_b" : null); $dopclass .= (!(($settings['borderwidth'] && $settings['bordercolor']) || $settings['bg'] || $settings['headbg']) ? " blk_nomarg_cont_lr_h" : null); $dopclass .= ($blklr ? " {$blklr}" : null); if (!$jsnp) { /* КОНТЕНТ БЛОКА */ if ($b['text']) { // содершимое - текст # animate $animate_text = ""; $animate_delay = 0; if ($phpset['contsetclass']['animate'] && $phpset['contsetclass']['animate_text']) { if ($phpset['contsetclass']['animate_title']) $animate_delay = 0.16; $animate_text = $phpset['contsetclass']['animate_text']; } $blockHtmlCont .= "
" . strtr(replace_lang(\Korzilla\Replacer::replaceText(textTargeting($b['text']))), $widgetArr) . "
"; } if ($b['sub'] > 0 && $b['cc'] > 0 && $phpset['contenttype'] == 1) { // содершимое - из раздела if ($params['name']) { $blockHtmlCont .= "\n\n\n\n"; $blockHtmlCont .= strtr(nc_objects_list($b['sub'], $b['cc'], "&width={$b['width']}&vars={$b['vars']}&ssub={$sub}&tsub={$b['sub']}&tcc={$b['cc']}&msg={$b['msg']}&mesid={$b['Message_ID']}&block_id={$b['block_id']}&isTitle=1&recNum={$b['recnum']}&rand={$b['rand']}&link={$params['url']}&name={$name}" . ($b['notitle'] ? "¬itle=1" : null) . "&substr={$b['substr']}" . ($b['noindex'] ? "&noindex=1" : "") . $contsetclass, 1, false), $widgetArr); } else { // выключение блока $db->query("update Message2016 set Checked = 0 where block_id = '{$b['block_id']}' AND Catalogue_ID = '$catalogue'"); } } if ($contset['menutpl'] > 0 && $phpset['contenttype'] == 2) { // содержимое - меню $sortsubArr = array(1 => "Subdivision_Name", ); $templ = $contset['menutpl']; if ($templ == 31 || $templ == 30) { if ($templ == 30) $contset['list'] = 1; // Вывод меню плитки через нашу функцию $menuHtml = catalogCategory($b['sub'], $contset); } else { if ($templ == 1) $templ = '0'; # шаблон с выподашкой $levelPolyfill = [0 => 0, 1 => 1, 2 => 2, 3 => 2]; if ($contset['dropmenu'] == 3 && $templ == '0') $templ .= '_img'; $name_nav = ${'nav_templ_' . $templ}; if ($contset['sortsub'] > 0) $name_nav[0]['sortby'] = $sortsubArr[$contset['sortsub']]; // вызять меню if ($templ == '42') { if ($current_sub['Parent_Sub_ID'] == 0) continue; $sub_extension = getExtensionSub($current_sub['Subdivision_ID']); if (!in_array($b['sub'], $sub_extension)) continue; $menuHtml = kz_browse_sub((int) $current_sub['Parent_Sub_ID'], $name_nav, 0, '', (int) ($levelPolyfill[$contset['dropmenu']] ?: 0)); } else if ($templ == 43) { $menuHtml = getMenuTemplate43($current_sub, $name_nav, $b); if (!$menuHtml) continue; } else { $menuHtml = kz_browse_sub((int) $b['sub'], $name_nav, 0, '', (int) ($levelPolyfill[$contset['dropmenu']] ?: 0)); } // if ($contset['showicon']) $menuHtml = str_replace("menu-img-no", "menu-img", $menuHtml); if (!$contset['showicon']) { $menuHtml = preg_replace("/.*?<\/span>/s", "", $menuHtml); } else { $menuHtml = str_replace("menu-img-no", "menu-img", $menuHtml); } if ($contset['devidertpl'] == 1) $menuHtml = str_replace("menu-dashed-no", "menu-dashed", $menuHtml); if ($contset['devidertpl'] == 2) $menuHtml = str_replace("menu-decoration-no", "menu-decoration", $menuHtml); if ($contset['punktwidth100']) $menuHtml = str_replace("nowidth100", "elwidth100", $menuHtml); if ($contset['itemsinmenu']) { if (!$menuHtml) { $menuHtml = "-->"; $menuHtml = itemsinmenu($menuHtml, 1); } else { $menuHtml = itemsinmenu($menuHtml); } } else { $menuHtml = itemsinmenu($menuHtml, '', 1); } $menuHtml = str_replace("data-o='1'", "target='_blank'", $menuHtml); $menuHtml = preg_replace( "/\s{0,}\s{0,}<\/span>/mu", '', $menuHtml ); $menuHtml = preg_replace( "/\s{0,}\s{0,}<\/span>/mu", '', $menuHtml ); $menuHtml = preg_replace( "/\s{0,}\s{0,}<\/span>/mu", '', $menuHtml ); $menuHtml = preg_replace( "/\s{0,}\s{0,}<\/span>/mu", '', $menuHtml ); # html выподающего меню - 40 if ($contset['menutpl'] == '40' || $contset['menutpl'] == '41') { $menuHtml = $b['sub'] > 0 ? "" : ""; if ($contset['menutpl'] == '41') $plugins['js']["packery.pkgd.min"] = 1; } } $blockHtmlCont .= $menuHtml; } if ($phpset['contenttype'] == 3) { // содержимое - контакты $contactsBlock = smallcontacts($contset); $blockHtmlCont .= $contactsBlock; if (stristr($contactsBlock, "i_user2")) $authInBlock = 1; } if ($phpset['contenttype'] == 4 && !$isPgSpeed) { // содержимое - copyright $blockHtmlCont .= getcoporight($contset); } if ($phpset['contenttype'] == 5 && !$isPgSpeed) { // содержимое - разработчик $sites = array(749, 750); if (in_array($catalogue, $sites)) { $blockDev = getdev($contset); if ($b['noindex']) { // $blockDev = preg_replace("/())/", " $1 ", $blockDev); $blockDev = preg_replace("/(href=\'[\d\D]*\')/U", "$1 rel='nofollow'", $blockDev); } $blockHtmlCont .= $blockDev; } else { $blockHtmlCont .= getdev($contset); } } if ($phpset['contenttype'] == 6) { // модули $blockHtmlCont .= checkModule('get', $contset['module'], $b[block_id]); } if ($phpset['contenttype'] == 7) { // хлеб $blockHtmlCont .= getXleb(array("type" => $settings['xlebtype'] ?? 2)); } /* END КОНТЕНТ БЛОКА */ } // Классы блока $thisBlkClass = "blocks {$dopclass2} grid_{$b['width']} {$dopclass}"; // Массив настроек jsonpar $jsonparam['blocks'][$b['block_id']]['class'] = $thisBlkClass; if (!$jsnp) { if ((trim($blockHtmlCont) && ($b['sub'] > 0 && $b['cc'] > 0 && $phpset['contenttype'] == 1)) || (trim($blockHtmlCont) && $phpset['contenttype'] == 7) || ($phpset['contenttype'] != 1 && $phpset['contenttype'] != 7)) { // показ блока, если в нем есть какой-то контент (разела) if ($b['noindex']) $blockHtml .= ""; if (!$b['noblock']) { $blockHtml .= "
"; if (!$b['notitle'] && $name) { // заголовок не скрыт # animate $animate_title = ""; if ($phpset['contsetclass']['animate'] && $phpset['contsetclass']['animate_title']) { $animate_title = $phpset['contsetclass']['animate_title']; } $blockHtml .= "
"; } $blockHtml .= "
"; } else { $blockHtml .= "
"; } $blockHtml .= $blockHtmlCont; if (!$b['noblock']) $blockHtml .= "
"; else $blockHtml .= ""; if ($b['noindex']) $blockHtml .= ""; // кэшируем блок if (!$AUTH_USER_ID && (($b['iscache'] && !$b['cache']) || ($b['iscache'] && $b['cachetime'] && $b['lastcache'] < time()))) { $db->query("update Message2016 set cache = '" . addslashes($blockHtml) . "' where Message_ID = '" . $b['Message_ID'] . "'"); if ($b['iscache'] && $b['cachetime']) $db->query("update Message2016 set lastcache = '" . (time() + $b['cachetime'] * 60) . "' where Message_ID = '" . $b['Message_ID'] . "'"); } $blockHtml .= ""; } } } else { // если кэш атуален $blockHtml .= $b['cache'] . ""; } if (strstr($block, 'data-effect')) $slider = 1; // есть слайдеры, подключить js $zoneblocks[$col] .= $blockHtml; } } // конец блока if (!$zoneblocks['banner']) $zoneblocks['banner'] = "
"; // если нет банера return ($jsnp ? $jsonparam['blocks'] : $zoneblocks); } } # Заполнение массива зонами / заполнение jsonparam function getzonearr($zoneblocks, $jsnp = 0) { global $catalogue, $db, $jsonparam, $mobileMenu, $HTTP_FILES_PATH, $bitcat, $AUTH_USER_ID; if (!$catalogue && $jsnp) $catalogue = $jsnp[id]; $selectBlp = "setting,zone_id" . (!$jsnp ? ",Message_ID,Subdivision_ID,Sub_Class_ID,Priority,Keyword,Checked,Catalogue_ID,name,zone_position,zone_priority,mobilemenu,SUBSTRING_INDEX(bgimg, ':', -1) as bgimg" : null); $selectBlsql = "select {$selectBlp} from Message2000 where Checked = 1 AND Catalogue_ID = '{$catalogue}' AND zone_position != 0 ORDER BY zone_position, zone_priority"; $zones = $db->get_results($selectBlsql, 'ARRAY_A'); $cssb .= ($settingszone['blkvertmid'] ? " #zone{$zn['zone_id']} .container { display: table; } #zone{$zn['zone_id']} .blocks { display: table-cell; vertical-align: middle; float: none; } " : null); if ($zones) { foreach ($zones as $z) { // начало блока if ($z['zone_position'] == 6 && $z['mobilemenu']) $mobileMenu = 1; # меню только в моб. версии $col = $pos = $classbg = null; unset($classZone); unset($classBg); unset($classBgData); $col = ($z['zone_id'] ? $z['zone_id'] : 1); $setzones = orderArray($z['setting']); # массив статичных зон $nolinezone = NO_LINE_ZONE_ARRAY; $classBg[] = "zone-bg"; $classBg[] = $setzones['fixwidth'] && !in_array($col, $nolinezone) ? "containerbg_12" : ""; if ($setzones['parallaxZone'] && $z['bgimg']) { $classBg[] = "zone-parallax"; $classBgData = "data-parallax='scroll' data-image-src='{$HTTP_FILES_PATH}{$z[bgimg]}'"; } if (!$jsnp) { $pos = ($z['zone_position'] ? $z['zone_position'] : 1); $name = ($z['name'] ? $z['name'] : "Без названия"); $message_id = ($z['Message_ID'] ? $z['Message_ID'] : 1); $class = "container " . ($setzones['width'] != 1 ? 'container_100 ' : 'container_12 ') . " cb"; if ($zoneblocks[$col]) { $classZone[] = "zone"; $classZone[] = "cb"; if ($setzones['blkvertmid']) $classZone[] = "blk-middle"; if ($setzones['fixedZone']) $classZone[] = "zone-fixtop"; $zone[$pos] .= ($setzones['footer'] ? "
" : null) . "
" . "
" . ($setzones['header'] ? "" : "") . "
" . ($setzones['footer'] ? "
" : null); } } // Массив настроек jsonparam $jsonparam['zone'][$col]['classbg'] = ($classbg ? $classbg : ""); } } if ($jsnp) $jsonparam['blocks'] = getblocksarr($jsnp); return ($jsnp ? $jsonparam : $zone); } setCartText($param); $tabSetting = new App\modules\Korzilla\CatalogItem\Tab\Models\ModelSetting($_SERVER['DOCUMENT_ROOT'] . $pathInc); $tabs = $tabsBody = ""; $allTabs = []; foreach ($tabSetting->getData() as $id => $value) { if (!$value['Checked']) continue; if ((int) $value['params']['contenttype'] == 0) { $allTabs[$id]["title"] = $value['name']; $allTabs[$id]["body"] = "
{$value['params']['f_text']}
"; continue; } if ((int) $value['params']['contenttype'] == 1) { $allTabs[$id]["title"] = $value['name']; list($sub, $cc) = explode('|', $value['params']['f_sub']); $allTabs[$id]["body"] = nc_objects_list($sub, $cc, "&ssub={$sub}&tsub={$sub}&tcc={$cc}&msg={$value['params']['f_msg']}&isTitle=1&recNum={$value['params']['f_recnum']}&rand={$value['params']['f_rand']}&name={$value['name']}&substr={$value['params']['f_substr']}", 1, false); continue; } if ((int) $value['params']['contenttype'] == 2) { switch ($value['params']['default_tab_type']) { # описание и параметры case 'cart-param': if ($obj->tagsHtml || $obj->firstText) { $allTabs["cart-param"]["title"] = $value['name'] ?: $obj->vkldk_opisitem; $allTabs["cart-param"]["body"] = $obj->tagsHtml . $obj->firstText; } break; # описание 2 case 'cart-param-2': if ($obj->text2 || $obj->parameters) { $allTabs["cart-param-2"]["title"] = $value['name'] ?: $obj->vkldk_opisitem2; $allTabs["cart-param-2"]["body"] = "
" . $obj->text2 . $obj->parameters . "
"; } break; # отзывы case 'cart-review': $comment = getComments(2054, $obj->id); $commentCount = substr_count($comment, 'kz_otz_item'); $allTabs["cart-review"]["title"] = ($value['name'] ?: $obj->reviews) . ($commentCount > 0 ? "{$commentCount}" : ""); $allTabs["cart-review"]["body"] = $comment; break; # Деловые линии case 'cart-citymap': if (stristr($obj->deliveryMap, "this_map")) { $allTabs["cart-citymap"]["title"] = getLangWord('full_delline_title', 'Получение заказа в г.') . " " . getLangCityName($cityname) . ""; $allTabs["cart-citymap"]["body"] = $obj->deliveryMap; } elseif ($setting['targeting'] && $setting['devlintarget']) { $allTabs["select-city"]["title"] = getCityLink(array("title" => "" . getLangWord('full_delline_title', 'Получение заказа:') . " " . getLangWord('full_delline_select_city', 'выберите ваш город') . "")); } break; case 'cart-var1': if ($obj->var1) { $allTabs["cart-var1"]["title"] = $value['name']; $allTabs["cart-var1"]["body"] = htmlspecialchars_decode($obj->var1); } break; } continue; } } if ($obj->analogs_new) { $allTabs["analogs-new"]["title"] = "Навесное оборудование"; $html = ""; $analogs_decoded = json_decode(htmlspecialchars_decode($obj->analogs_new)); $analogs_ids = implode(",", $analogs_decoded->products); $dataObj = "" . nc_objects_list($obj->sub, $obj->cc, "&isTitle=1&nc_ctpl=2001&scrolling=0&scrollNav=0&recNum=200¬obj=" . $obj->id . "&getanalognew=" . $analogs_ids, true, false); if (strstr($dataObj, "catalog-item") || strstr($dataObj, "catalog-table")) { $analogHtml = $dataObj; } if ($analogHtml) { $result = "
{$analogHtml}
"; } $allTabs["analogs-new"]["body"] = $result; } # перебор foreach ($allTabs as $key => $itemTab) { if ($key == "select-city") { $tabs .= "
  • {$itemTab['title']}
  • "; } else { $tabs .= "
  • {$itemTab['title']}

  • "; $tabsBody .= "
    {$itemTab['body']}
    "; } } # Вкладки if (count($allTabs) > 1) { $html = "
      {$tabs}
    {$tabsBody}
    "; } elseif ($tabsBody) { $html = "
    {$tabsBody}
    "; } # Дополнительный текст $html .= ($obj->secondText ? "
    " . $obj->secondText . "
    " : null); return $html; } /** * Карточки товара * * @param string $type * * @return string */ function class2001_getCard($self, $type) { global $setting, $AUTH_USER_ID; # класс шаблона $type = $type ?: $setting['templateItem'] ?: 'type1'; # html switch ($type) { case 'type1': // Стандартные карточки $html = "
    attr('data')}>
    {$self->comparisonHtml} {$self->favoritHtml}
    " . ($self->discontText || $self->labelHtml ? "
    {$self->discontText}{$self->labelHtml}
    " : '') . " {$self->photoMain}
    " . ($self->subname ? "
    {$self->subname}
    " : '') . "
    {$self->link}
    " . ($setting['itemlistart'] && $self->artHtml ? "
    {$self->artHtml}
    " : '') . " " . ($setting['itemlistart'] && $self->art2Html ? "
    {$self->art2Html}
    " : '') . " " . (($setting['itemliststock'] || $setting['stockValShow']) && !$self->getPriceLinkSupplier ? "
    {$self->stockHtml}
    " : '') . " " . ($setting['itemlistedism'] && $self->edizm ? "
    Ед.изм: {$self->edizm}
    " : "") . " " . ($self->variantsHtml ? "
    {$self->variantsHtml}
    " : "") . " " . ($self->variantsNameHtml ? "
    {$self->variantsNameHtml}
    " : "") . " " . ($self->colorsHtml ? "
    {$self->colorsHtml}
    " : "") . " " . ($self->descr ? "
    {$self->descr}
    " : "") . "
    " . ($self->lastPrice ? "
    {$self->lastPriceHtml}
    " : "") . "
    {$self->pricePrefix} {$self->priceHtml}
    " . $self->regPrice() . " " . $self->getNoPriceText() . " " . ($setting['ves'] && $self->ves ? "
    {$self->ves}
    " : "") . " {$self->parametrsPreview}
    {$self->discontCount}
    " . ($self->getPriceLinkSupplier ?: null) . " " . ($self->btn() && !$self->getPriceLinkSupplier ? "
    {$self->btn()}
    " : "") . "
    {$self->edit}
    "; break; case 'type2': $html = "
    attr('data')}>
    {$self->comparisonHtml} {$self->favoritHtml}
    " . ($self->discontText || $self->labelHtml ? "
    {$self->discontText}{$self->labelHtml}
    " : "") . " {$self->photoMain}
    " . ($self->subname ? "
    {$self->subname}
    " : "") . "
    " . $self->link . "
    " . ($setting['itemlistart'] && $self->artHtml ? "
    {$self->artHtml}
    " : "") . " " . ($setting['itemlistart'] && $self->art2Html ? "
    {$self->art2Html}
    " : "") . " " . ($setting['itemliststock'] || $setting['stockValShow'] ? "
    {$self->stockHtml}
    " : "") . " " . ($setting['itemlistedism'] && $self->edizm ? "
    Ед.изм: {$self->edizm}
    " : "") . " " . ($self->variantsHtml ? "
    {$self->variantsHtml}
    " : "") . " " . ($self->variantsNameHtml ? "
    {$self->variantsNameHtml}
    " : "") . " " . ($self->colorsHtml ? "
    {$self->colorsHtml}
    " : "") . " " . ($self->descr ? "
    {$self->descr}
    " : "") . "
    {$self->pricePrefix} {$self->priceHtml}
    " . ($self->lastPrice ? "
    {$self->lastPriceHtml}
    " : "") . "
    " . $self->regPrice() . " " . $self->getNoPriceText() . " " . ($setting['ves'] && $self->ves ? "
    {$self->ves}
    " : "") . " {$self->parametrsPreview}
    {$self->discontCount}
    " . ($self->getPriceLinkSupplier ?: null) . " " . ($self->btn('type2') && !$self->getPriceLinkSupplier ? "
    {$self->btn('type2')}
    " : "") . "
    {$self->edit}
    "; break; } return $html; }f = $fieldsArray; # texts $this->time_work = $setting_texts['time_work']['checked'] ? $setting_texts['time_work']['name'] : "Время работы"; $this->main(); } # main private function main() { if (function_exists('class2012_main')) { $html = class2012_main($this); // своя функция } else { global $setting_texts, $setting, $AUTH_USER_ID, $db, $pathInc, $catalogue;; # лого сйта для разметки JSON-LD $img_logo = $db->get_var("select SUBSTRING_INDEX(file, ':', -1) from Message2047 where Catalogue_ID = '{$catalogue}' limit 1"); if ($img_logo) $this->logo = $img_logo; # заголовки $this->artname = ($setting_texts['full_cat_art']['checked'] ? $setting_texts['full_cat_art']['name'] : "Артикул"); # id объекта if (!$this->id && $this->RowID) $this->id = $this->RowID; # шаблон if (!stristr($this->template, "template")) $this->template = "template-1"; if (!stristr($this->map, "2gis")) $this->map = str_replace("width", "width=100%25&w", $this->map); if ($this->photo) { foreach (array_reverse($this->photo) as $photo) { # реализация title or alt. Для удаления заменить ftitle,falt на f[Name] if ($photo['Name']) { $photoName = trim($photo['Name']); if (preg_match("/\|/", $photoName)) { $fname = explode('|', trim($photoName)); $ftitle = $fname[0] ? trim($fname[0]) : NULL; $falt = $fname[1] ? trim($fname[1]) : NULL; } else { $ftitle = $falt = $photoName; } } $this->photos .= "
  • " . ($f_AdminButtons ? $f_AdminButtons : "") . " " . ($bitcat ? editObjBut($editLink) : NULL) . "
  • "; } } if ($this->email) { $this->email = str_replace([" ", " ", "\r\n", "\n"], [" ", ",", ",", ","], $this->email); foreach (explode(",", $this->email) as $em) { if (!empty($em)) { if (!$this->isTitle) { $this->emailHtml .= ($this->emailHtml ? ", " : NULL) . "{$this->email}"; } else { $this->emailHtml .= ""; $this->emailAll .= ""; } } } } if ($this->skype) { $this->skype = str_replace([' ', ' '], [' ', ','], $this->skype); foreach (explode(",", $this->skype) as $sk) { if ($sk) $this->skp .= ($this->skp ? ", " : NULL) . "{$sk}"; } } if ($this->phones) { $this->phones = str_replace(["\r\n", "\n"], ",", $this->phones); $hidephone = $setting['hidephone'] ? '' : 'hidephone '; $phones = ''; $telephone = []; foreach (explode(",", $this->phones) as $phone) { if (empty(trim($phone))) continue; $phone = trim(replace_lang($phone)); $telephone[] = $phone; $phoneNum = preg_replace('/[^0-9]/', '', $phone); $classPhoneItem = ['how_phone_item']; $showPhoneBtn = ''; if (strlen($phoneNum) == 11) $classPhoneItem[] = $hidephone; if ($hidephone && strlen($phoneNum) == 11) { $showPhoneBtn = "Показать телефон"; } $classPhoneItem = implode(' ', $classPhoneItem); if (strlen($phoneNum) < 11) { $phones .= "
    {$phone}
    "; $this->phonestitle .= "
    {$phone}
    "; } else { $phones .= "
    {$phone}{$showPhoneBtn}
    "; $this->phonestitle .= "
    {$phone}{$showPhoneBtn}
    "; } } $this->telephone = $telephone; $this->phones = $phones ? $phones : ""; } } } public function getContact() { return $this->isTitle ? $this->getContactBlock() : $this->getContactPage(); } # Контакт на странице public function getContactPage() { if (function_exists('class2012_getContactPage')) { $html = class2012_getContactPage($this); // своя функция } else { global $db, $cityid, $bitcat, $catalogue, $current_catalogue, $AUTH_USER_ID; # people class $ppl = $db->get_row("select a.Subdivision_ID as sub, a.Sub_Class_ID as cc from Message201 as a, Sub_Class as b where a.Catalogue_ID = '{$catalogue}' AND a.Subdivision_ID = b.Subdivision_ID AND b.Class_ID = 201 LIMIT 0,1", ARRAY_A); $edit = $this->AdminButtons; switch ($this->template) { case 'template-1': $html = "
    {$edit}
    " . ($this->name ? "
    {$this->name}
    " : "") . "
    " . ($this->phones ? "
    {$this->phones}
    " : NULL) . " " . ($this->adres ? "
    {$this->name}
    {$this->adres}
    " : NULL) . " " . ($this->emailHtml || $this->skype || $this->icq || $this->site ? "
    " . ($this->emailHtml ? "
    E-mail:
    {$this->emailHtml}
    " : NULL) . " " . ($this->skype ? "
    Skype:
    {$this->skp}
    " : NULL) . " " . ($this->icq ? "
    ICQ:
    {$this->icq}
    " : NULL) . " " . ($this->site ? "
    Сайт:
    " : NULL) . "
    " : NULL) . " " . ($this->time ? $this->getTimeFull($this) : NULL) . "
    " . ($this->soc_show ? $this->getSoc() : null) . "
    " . ($this->photos ? "" : NULL) . " " . ($this->map ? "
    {$this->map}
    " : NULL) . " " . ($bitcat ? editObjBut($this->editLink) . getAddPeople($this->id) : "") . "
    " . ($ppl['sub'] && $ppl['cc'] ? nc_objects_list($ppl['sub'], $ppl['cc'], "&office={$this->id}") : NULL) . "
    "; break; case 'template-2': $html = "
    {$edit}
    " . ($this->name ? "
    {$this->name}
    " : "") . "
    " . ($this->phones ? "
    {$this->phones}
    " : NULL) . " " . ($this->adres ? "
    {$this->name}
    {$this->adres}
    " : NULL) . " " . ($this->emailHtml || $this->skype || $this->icq || $this->site ? "
    " . ($this->emailHtml ? "
    E-mail:
    {$this->emailHtml}
    " : NULL) . " " . ($this->skype ? "
    Skype:
    {$this->skp}
    " : NULL) . " " . ($this->icq ? "
    ICQ:
    {$this->icq}
    " : NULL) . " " . ($this->site ? "
    Сайт:
    " : NULL) . "
    " : NULL) . " " . ($this->time ? $this->getTimeFull($this) : NULL) . "
    " . ($this->soc_show ? $this->getSoc() : null) . "
    " . ($this->photos ? "" : NULL) . " " . ($this->map ? "
    {$this->map}
    " : NULL) . "
    " . ($bitcat ? editObjBut($this->editLink) . getAddPeople($this->id) : "") . "
    " . ($ppl['sub'] && $ppl['cc'] ? nc_objects_list($ppl['sub'], $ppl['cc'], "&office={$this->id}") : NULL) . "
    "; break; } } return $html; } protected function getSoc() { global $db, $catalogue; if (!$this->soc_show) return ''; $subSoc = $db->get_row( "SELECT Subdivision_ID as sub, Sub_Class_ID as cc FROM Sub_Class WHERE Catalogue_ID = {$catalogue} AND Class_ID = 2011 LIMIT 0,1", ARRAY_A ); if (empty($subSoc)) return ''; return nc_objects_list($subSoc['sub'], $subSoc['cc'], "&recNum=200"); } // Время с микро разметкой public function getTimeFull() { if (function_exists('class2012_getTimeFull')) { $result = class2012_getTimeFull($this); // своя функция } else { global $AUTH_USER_ID; $timeArr = orderArray($this->time); $isJson = (json_last_error() === JSON_ERROR_NONE ? true : false); // if($AUTH_USER_ID == 6) echo $this->time; $text = str_replace(["\n", "\r"], ["
    ", ""], ($isJson ? $timeArr['text'] : $this->time)); if (!$text) return false; $mitTime = ($isJson ? $timeArr['met_text'] : ''); $result = "
    " . getLangWord('time_work', 'Время работы:') . "
    {$text}
    "; } return $result; } public function getTime() { if (function_exists('class2012_getTime')) { $result = class2012_getTime($this); // своя функция } else { $timeArr = orderArray($this->time); $isJson = (json_last_error() === JSON_ERROR_NONE ? true : false); $text = str_replace(["\n", "\r"], ["
    ", ""], ($isJson ? $timeArr['text'] : $this->time)); if (!$text) return false; $mitTime = ($isJson ? $timeArr['met_text'] : ''); $result = "
    {$text}
    "; } return $result; } # Контакт в блоке public function getContactBlock() { if (function_exists('class2012_getContactBlock')) { $html = class2012_getContactBlock($this); // своя функция } else { global $db, $cityid, $bitcat, $catalogue, $current_catalogue; if (!$this->type) $this->type = 'template-1'; $class[] = "obj"; $class[] = objHidden($this->Checked, $this->citytarget, $cityid); $class[] = "obj{$this->id}"; $class[] = "item-contact"; $class[] = $this->type; switch ($this->type) { case 'template-1': // Стандартный шаблон $html = "
    " . ($this->name ? "
    {$this->name}
    " : "") . " " . ($this->adres ? "
    {$this->adres} " . ($this->map ? " " : "") . "
    " : "") . " " . ($this->phonestitle ? "
    {$this->phonestitle}
    " : "") . " " . ($this->fax ? "
    {$this->fax}
    " : "") . " " . ($this->getTime() ? "
    " . $this->getTime() . "
    " : "") . " " . ($this->emailHtml || $this->skp || $this->icq ? "
    " . ($this->emailHtml ? $this->emailHtml : "") . " " . ($this->skp ? "
    Skype: {$this->skp}
    " : "") . " " . ($this->icq ? "
    ICQ: {$this->icq}
    " : "") . "
    " : "") . " " . ($bitcat ? editObjBut($this->editLink) : "") . "
    "; break; case 'template-2': // Шаблон с картой и данными $class[] = $this->map ? "contact-map-have" : ""; //if ($_SERVER[REMOTE_ADDR]=='31.13.133.138') echo "SELECT IF(citytarget LIKE '%,{$cityid},%',1,0) as currentContact, Message_ID, name FROM Message2012 WHERE name not like '%Пункт%' AND Catalogue_ID = {$catalogue} AND Subdivision_ID = {$this->sub} ORDER BY currentContact DESC"; $contacts = $db->get_results("SELECT IF(citytarget LIKE '%,{$cityid},%',1,0) as currentContact, Message_ID, name FROM Message2012 WHERE name not like '%Пункт%' AND Catalogue_ID = {$catalogue} AND Subdivision_ID = {$this->sub} ORDER BY currentContact DESC", ARRAY_A); $Hidden_URL = $db->get_var("SELECT Hidden_URL FROM Subdivision WHERE Catalogue_ID = {$catalogue} AND Subdivision_ID = {$this->sub}"); if (count($contacts) > 1) { foreach ($contacts as $key => $contact) { $option[$Hidden_URL . "?isNaked=1&isTitle=1&template_block=template-2&msg=" . $contact['Message_ID']] = $contact['name'] ? $contact['name'] : "Контакт " . (++$key); } $options = getOptionsFromArray($option, $Hidden_URL . "?isNaked=1&isTitle=1&template_block=template-2&msg=" . $this->id); $select = bc_select_standart("contact-select", $options, "", 'class="select-style"'); } $html = "
    " . ($this->map ? "
    " : NULL) . "
    " . ($select ? "
    {$select}
    " : "") . " " . ($this->name ? "
    {$this->name}
    " : "") . " " . ($this->adres ? "
    {$this->adres}
    " : "") . " " . ($this->phonestitle ? "
    {$this->phonestitle}
    " : "") . " " . ($this->fax ? "
    {$this->fax}
    " : "") . " " . ($this->getTime() ? $this->getTime() : "") . " " . ($this->emailAll ? "
    {$this->emailAll}
    " : "") . " " . ($this->skp ? "
    Skype: {$this->skp}
    " : "") . " " . ($this->icq ? "
    ICQ: {$this->icq}
    " : "") . " " . ($bitcat ? editObjBut($this->editLink) : "") . "
    "; break; case 'template-3': // Шаблон с картой $class[] = $this->map ? "contact-map-have" : ""; $html = "
  • " . ($this->map ? "
    {$this->map}
    " : NULL) . "
  • "; break; } } return $html; } # Контакт внутряк public function getContactFull() { global $db, $cityid, $bitcat, $catalogue; $html = " {$this->map} "; return $html; } # тестовый метод public function test() { global $setting; return $setting['itemlistsub']; } public function __set($name, $value) { $this->f[$name] = $value; } public function __get($name) { return isset($this->f[$name]) ? $this->f[$name] : ""; } public function __isset($name) { return isset($this->$name); } } f = $fieldsArray; $this->main(); $this->setPhoto(); } # main private function main(){ global $setting_texts, $setting; # id объекта if(!$this->id && $this->RowID) $this->id = $this->RowID; } # Объект портфолио public function getItem(){ if(function_exists('class2021_getItem')){ $html = class2110_getItem($this); // своя функция }else{ global $db, $cityid, $bitcat, $bitLoadMore, $catalogue, $currency; # кнопка редактирования $edit = ($bitcat || $bitLoadMore ? editObjBut(nc_message_link($this->id, $this->classID, "edit")) : NULL); $class[] = "portfolio-item"; $class[] = "obj"; $class[] = "obj{$this->id}"; $class[] = objHidden($this->Checked, $this->citytarget, $cityid); $class[] = $this->type; if($this->animateKey) $class[] = "wow {$this->animateKey}"; $html = "
  • animateKey ? str_replace(",", ".", "data-wow-delay='".($this->animateDelay + ($this->RowNum * $this->animateDelayStep))."s'") : "")."> {$edit} {$this->photoMain} ".($this->name || $this->text || $this->price ? "
    ".($this->name ? "" : NULL)." ".($this->text ? "
    {$this->text}
    " : NULL)." ".($this->price ? "
    ".($this->firstprice ? "от " : "")."".price($this->price)." {$currency[html]}
    " : NULL)."
    ": "")."
  • "; } return $html; } # внутряк public function getItemFull(){ if(function_exists('class2021_getItemFull')){ $html = class2110_getItemFull($this); // своя функция }else{ global $db, $cityid, $bitcat, $bitLoadMore, $catalogue, $currency, $setting_texts, $current_sub; $callformlink = $setting_texts['portfolio_link_call']['checked'] ? $setting_texts['portfolio_link_call']['name'] : "Заказать обратный звонок"; if($this->form_id) { $htmlForm = htmlAnyForm($this->form_id, ['moreRequest' => "&t_item_name={$this->name}"]); // $formParam = explode('/', $this->form_id); // $htmlForm = nc_objects_list($formParam[0], $formParam[1], str_replace('&', '&', "{$formParam[2]}")); } # кнопка редактирования $edit = ($bitcat || $bitLoadMore ? editObjBut($this->editLink, null, 'портфолио') : NULL); $class[] = 'portfolio-item-full'; $html = "{$edit}
    {$this->bigphoto}
    ".($this->link ? "" : NULL)." ".($this->price ? "
    ".($this->firstprice ? "от " : "")."firstprice ? "itemprop='lowPrice'" : "itemprop='price'")." content='{$this->price}'>".price($this->price)." {$currency[html]}
    " : NULL)." ".($this->textfull || $this->text ? "
    ".($this->textfull ? $this->textfull : $this->text)."
    " : NULL)."

    {$likedwork}

    ".($htmlForm != '' ? $htmlForm : "{$callformlink}")."
    ".$this->getVideo()." ".($this->textfull_bottom ? "
    {$this->textfull_bottom}
    " : "")." ".$this->bottomFormHtml()."
    "; } return $html; } #bottom_form public function bottomFormHtml() { if (!$this->bottom_form) return ''; global $db, $catalogue; $formParam = $db->get_row("SELECT Sub_Class_ID as cc, Subdivision_ID as sub FROM `Sub_Class` WHERE `Class_ID` IN (2013) AND `Catalogue_ID` = {$catalogue}", ARRAY_A); $htmlForm = nc_objects_list($formParam['sub'], $formParam['cc'], "&nc_ctpl=2256&t_item_name={$this->name}"); $html = "
    Остались вопросы ? {$htmlForm}
    "; return $html; } #video public function getVideo() { if (!$this->video) return ''; $html = "
    "; return $html; } # photo public function setPhoto(){ global $nc_core, $HTTP_FILES_PATH, $pathInc, $DOCUMENT_ROOT, $IMG_HOST, $titleArr; # шаблон вывода картинок $this->photo->set_template(array('record' => "%Preview%")); if($this->full){ # photo объекта if ($this->photo->records) { foreach($this->photo->records as $i => $f) { $alt = $f[Name] ? $f[Name] : $this->name; $bigphoto .= "{$alt}"; $smallphoto .= "
    {$alt}
    "; } } # файла нет if (!$bigphoto) $bigphoto = "
    "; $this->bigphoto = ""; $this->smallphoto = $smallphoto ? "
    {$smallphoto}
    " : ""; }else{ # загруженная картинка if($this->photo_preview){ $image = $this->photo_preview; } # внутрение картинки if(!$image && $this->photo->get_record(1)){ $image = $this->photo->get_record(1); } # файла нет if (!$image) $image = getnoimage("big"); $photoMain = ""; $this->photoMain = $photoMain; } } # тестовый метод public function test() { global $setting; return $setting[itemlistsub]; } public function __set($name, $value) { $this->f[$name] = $value; } public function __get($name) { return isset($this->f[$name]) ? $this->f[$name] : ""; } public function __isset($name){ return isset($this->$name); } } ?>
    Parse error: syntax error, unexpected end of file in /home/vannaykomnata/web/xn--80aaaag4cofadj5cxk.su/public_html/template/template/2/Header.html on line 465