示例#1
0
 function disSubNames($id, $sep = "»")
 {
     $ids = $this->disSubOptions($id);
     $tmp_controller = new PbController();
     include CACHE_PATH . "cache_area.php";
     $datas = $tmp_controller->array_multi2single($_PB_CACHE['area']);
     foreach ($ids as $key => $val) {
         $r[] = $datas[$val];
     }
     unset($_PB_CACHE);
     return implode($sep, $r);
 }
示例#2
0
 function disSubNames($id, $sep = "»", $link = false, $do = null)
 {
     $ids = $this->disSubOptions($id);
     $tmp_controller = new PbController();
     if (is_null($sep)) {
         $sep = "»";
     }
     $r = array();
     $_PB_CACHE['industry'] = cache_read("industry");
     $datas = $tmp_controller->array_multi2single($_PB_CACHE['industry']);
     $tmp_ids = $ids;
     foreach ($ids as $key => $val) {
         if ($link) {
             $tmp = ltrim($key, "id");
             switch ($tmp) {
                 case 1:
                     $the_id = implode(",", $ids);
                     break;
                 case 2:
                     unset($tmp_ids["id1"]);
                     $the_id = implode(",", $tmp_ids);
                     break;
                 default:
                     $the_id = $val;
                     break;
             }
             if (!function_exists("smarty_function_the_url")) {
                 require SLUGIN_PATH . "function.the_url.php";
             }
             $r[] = "<a href='" . smarty_function_the_url(array("module" => $do, "action" => "lists", "do" => "search", "industryid" => $the_id)) . "' rel='special_link'>" . $datas[$val] . "</a>";
         } else {
             $r[] = $datas[$val];
         }
     }
     unset($_PB_CACHE);
     return implode($sep, $r);
 }
示例#3
0
         //for sub-station
         setvar($mod . "_id", $mod_id);
         $model_object->setInfo($mod_id);
         if (!empty($model_object->info)) {
             $cache_id = $mod_id;
             $viewhelper->setTitle($model_object->info['name'] . L("sub_" . $mod, "tpl"));
             if (empty($model_object->info['description'])) {
                 $model_object->info['description'] = nl2br(L("sub_default_desc", "tpl", $model_object->info['name']));
             }
             $viewhelper->setMetaDescription($model_object->info['description']);
             $viewhelper->setMetaKeyword(implode(",", array($model_object->info['name'] . L("offer", "tpl"), $model_object->info['name'] . L("market", "tpl"), $model_object->info['name'] . L("product_center", "tpl"), $model_object->info['name'] . L("yellow_page", "tpl"), $model_object->info['name'] . L("info", "tpl"))));
             setvar("item", $model_object->info);
         }
     } else {
         $datas = cache_read($mod);
         $datas = $special_controller->array_multi2single($datas);
         $alphabet_sorts = array();
         foreach ($datas as $key => $val) {
             $letter = strtoupper(L10n::getinitial($val));
             $alphabet_sorts[$letter]['child'][$key]['id'] = $key;
             $alphabet_sorts[$letter]['child'][$key]['title'] = $val;
         }
         ksort($alphabet_sorts);
         setvar("alpha_datas", $alphabet_sorts);
         setvar("type", $mod);
         setvar("station_name", L("sub_" . $mod, "tpl"));
         unset($datas, $alphabet_sorts);
         $tpl_file = "special/list";
         $viewhelper->setTitle(L("sub_" . $mod, "tpl"));
     }
 }