Example #1
0
<?php

// ---- center ----
unset($parsed_res);
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
$items = new Items();
$dbtree = new dbtree('im_cat', 'cat', $db);
$Manufacturers = new Manufacturers();
$dbtree->Full(array('cat_id', 'cat_level', 'name', 'translit'), array('and' => array('visible=1')));
while ($item = $dbtree->NextRow()) {
    $list[] = $item;
}
$tpl->Assign('cat_list', $list);
$tpl->Assign('pages_list', $Page->list);
$Manufacturers->ManufacturersList();
$tpl->Assign('mans_list', $Manufacturers->list);
$GLOBALS['SITEMAP_URLS'][] = _base_url;
$parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_sitemap.tpl'));
$items->SetItemsList(array('visible' => 1));
$tpl->Assign('items_list', $items->list);
foreach ($items->list as $li) {
    $GLOBALS['SITEMAP_URLS'][] = _base_url . '/item/' . $li['item_id'] . '/' . $li['translit'] . '/';
}
$GLOBALS['SITEMAP_URLS'][] = _base_url . '/search/';
$GLOBALS['SITEMAP_URLS'][] = _base_url . '/sitemap.xml';
$sitemap = '<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
$first = true;
Example #2
0
$GLOBALS['IERA_LINKS'][$ii++]['url'] = _base_url . '/manufacturers/';
$GLOBALS['IERA_LINKS'][$ii]['title'] = $Manufacturers->fields['name'];
$GLOBALS['IERA_LINKS'][$ii++]['url'] = _base_url . '/manufacturer/' . $Manufacturers->fields['translit'] . '/';
$dbtree = new dbtree('im_cat', 'cat', $db);
$items = new Items();
// Список категорий производителя
$items->SetCatListMan($manufacturer_id);
$subcats = array();
$branch = 0;
foreach ($items->list as $l) {
    $dbtree->Parents($l['cat_id'], array('cat_id', 'name', 'translit', 'cat_level'));
    if (!empty($dbtree->ERRORS_MES)) {
        die("Error parents");
    }
    $jj = 0;
    while ($cat = $dbtree->NextRow()) {
        if (0 != $cat['cat_level']) {
            $fl = true;
            if ($branch) {
                if (isset($psubcats[$branch - 1][$jj]['cat_id']) && $psubcats[$branch - 1][$jj]['cat_id'] == $cat['cat_id']) {
                    $fl = false;
                }
            }
            if ($fl) {
                $subcats[$branch][$jj]['cat_id'] = $cat['cat_id'];
                $subcats[$branch][$jj]['name'] = $cat['name'];
                $subcats[$branch][$jj]['cat_level'] = $cat['cat_level'];
                $subcats[$branch][$jj]['translit'] = $cat['translit'];
                $subcats[$branch][$jj]['nolink'] = false;
                $subcats[$branch][$jj]['selected'] = false;
                if ($l['cat_id'] != $cat['cat_id']) {