Пример #1
0
 static function makePrettyOfferUrl($urlParams, $materialIDsRule, $ThemeArray, $data, $shopcoins_class, $return_params = array())
 {
     // , $divisions, $Country, $Region, $RegionPart, $City, $domain
     $domain = "www.numizmatik.ru/shopcoins";
     $params = $urlParams;
     $texts = array();
     foreach ($params as $key => $value) {
         if (!$params[$key]) {
             unset($params[$key]);
         }
     }
     $pattern = 'http://' . $domain;
     if (isset($params['materialtype'])) {
         if ($params['materialtype'] == 100) {
             $pattern .= '/newcoins';
             $texts[] = "Новинки";
         } elseif ($params['materialtype'] == 200) {
             $pattern .= '/revaluation';
             $texts[] = "Распродажа";
         } elseif (isset(self::$shopcoins_materialIDsRule[$params['materialtype']])) {
             $pattern .= '/' . self::$shopcoins_materialIDsRule[$params['materialtype']];
             $texts[] = contentHelper::$menu[$params['materialtype']];
         }
     }
     if (isset($params['group_id'])) {
         $groupData = $shopcoins_class->getGroupItem($params['group_id']);
         if ($groupData) {
             $pattern .= contentHelper::groupUrl($groupData['name'], $params['group_id']);
             $texts[] = $groupData['name'];
         }
     }
     if (isset($params['nominal_id'])) {
         $nominalMainTitle = $shopcoins_class->getNominal($params['nominal_id']);
         if ($nominalMainTitle) {
             $pattern .= contentHelper::nominalUrl($nominalMainTitle, $params['nominal_id']);
             $texts[] = $nominalMainTitle;
         }
     }
     if (isset($params['metal_id'])) {
         $metalMainTitle = $data['metalls'][$params['metal_id']];
         if ($metalMainTitle) {
             $pattern .= contentHelper::metalUrl($metalMainTitle, $params['metal_id']);
             $texts[] = $metalMainTitle;
         }
     }
     if (isset($params['condition_id'])) {
         $conditionMainTitle = $data['conditions'][$params['condition_id']];
         if ($conditionMainTitle) {
             $pattern .= contentHelper::conditionUrl($conditionMainTitle, $params['condition_id']);
             $texts[] = $conditionMainTitle;
         }
     }
     if (isset($params['year'])) {
         $pattern .= '/y_ysp' . $params['year'];
         $texts[] = $params['year'];
     }
     if (isset($params['theme_id'])) {
         $themeMainTitle = $ThemeArray[$params['theme_id']];
         if ($themeMainTitle) {
             $pattern .= contentHelper::themeUrl($themeMainTitle, $params['theme_id']);
             $texts[] = $themeMainTitle;
         }
     }
     if (isset($return_params['full']) && $return_params['full']) {
         return array('href' => $pattern, 'title' => implode(" ", $texts));
     }
     return $pattern;
 }
Пример #2
0
    $H1_sub .= " " . $yearsArray[$years_p[0]]['name'];
} else {
    foreach ((array) $years_p as $y) {
        // $addhref .="&years_p[]=$y";
        $urlParams['years_p'][] = $y;
    }
}
$metalMain = 0;
$metalMainTitle = '';
if (count($metal_data) == 1) {
    $metalMain = $metal_data[0];
    $data_filter['metal_id'] = $metalMain;
    $metalMainTitle = $tpl['metalls'][$metalMain];
    $H1_sub .= " {$metalMainTitle}";
    $urlParams['metal'] = array($metalMain => $metalMainTitle);
    $tpl['breadcrumbs'][] = array('text' => $metalMainTitle, 'href' => $r_url . ($groupHref ? $groupHref : '') . contentHelper::metalUrl($metalMainTitle, $metalMain), 'base_href' => $r_url . ($groupHref ? $groupHref : '') . contentHelper::metalUrl($metalMainTitle, $metalMain));
    //$r_url_paginator .= contentHelper::metalUrl($metalMainTitle,$metalMain);
} else {
    foreach ((array) $metals as $m) {
        // $addhref .="&metals[]=".urlencode($m);
        $arraykeyword[] = urlencode($m);
    }
    $urlParams['metal'] = $metal_data;
}
$themeMain = 0;
$themeMainTitle = '';
if (count($theme_data) == 1) {
    $themeMain = $theme_data[0];
    $data_filter['theme_id'] = $themeMain;
    $themeMainTitle = $ThemeArray[$theme_data[0]];
    $H1_sub .= " {$themeMainTitle}";