|
|
@@ -49,10 +49,7 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$ctp->LoadSource($innerText);
|
|
|
|
$revalue = $seli = '';
|
|
|
|
$channelid = (empty($refObj->TypeLink->TypeInfos['channeltype']) ? -8 : $refObj->TypeLink->TypeInfos['channeltype']);
|
|
|
|
$fields = array(
|
|
|
|
'nativeplace' => '', 'infotype' => '', 'typeid' => $typeid,
|
|
|
|
'channelid' => $channelid, 'linkallplace' => '', 'linkalltype' => ''
|
|
|
|
);
|
|
|
|
$fields = array('nativeplace' => '', 'infotype' => '', 'typeid' => $typeid, 'channelid' => $channelid, 'linkallplace' => '', 'linkalltype' => '');
|
|
|
|
$fields['nativeplace'] = $fields['infotype'] = '';
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['linkallplace'] = "<a href='{$baseurl}list-{$typeid}?infotype={$infotype}&channelid={$channelid}'>不限</a>";
|
|
|
@@ -61,47 +58,46 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$fields['linkallplace'] = "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&infotype={$infotype}'>不限</a>";
|
|
|
|
$fields['linkalltype'] = "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}'>不限</a>";
|
|
|
|
}
|
|
|
|
//地区链接
|
|
|
|
//地区
|
|
|
|
if (empty($nativeplace)) {
|
|
|
|
foreach ($em_nativeplaces as $eid => $em) {
|
|
|
|
if ($eid % 500 != 0) continue;
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['nativeplace'] .= " <a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$fields['nativeplace'] .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$sontype = (($nativeplace % 500 != 0) ? $nativeplace : 0); //子集
|
|
|
|
$toptype = (($nativeplace % 500 == 0) ? (int)$nativeplace : (int)($nativeplace - ($nativeplace % 500))); //顶级联动分类
|
|
|
|
$sontype = (($nativeplace % 500 != 0) ? $nativeplace : 0);//子级联动分类
|
|
|
|
$toptype = (($nativeplace % 500 == 0) ? (int)$nativeplace : (int)($nativeplace - ($nativeplace % 500)));//顶级联动分类
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['nativeplace'] = "<a href='{$baseurl}list-{$typeid}?nativeplace={$toptype}&infotype={$infotype}&channelid={$channelid}'> {$em_nativeplaces[$toptype]}</a> -";
|
|
|
|
$fields['nativeplace'] = "<a href='{$baseurl}list-{$typeid}?nativeplace={$toptype}&infotype={$infotype}&channelid={$channelid}'> {$em_nativeplaces[$toptype]}</a><br>";
|
|
|
|
} else {
|
|
|
|
$fields['nativeplace'] = "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$toptype}&infotype={$infotype}'> {$em_nativeplaces[$toptype]}</a> -";
|
|
|
|
$fields['nativeplace'] = "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$toptype}&infotype={$infotype}'> {$em_nativeplaces[$toptype]}</a><br>";
|
|
|
|
}
|
|
|
|
if ($nativeplace % 500 == 0) {
|
|
|
|
//1级分类
|
|
|
|
foreach ($em_nativeplaces as $eid => $em) {
|
|
|
|
if ($eid < $toptype + 1 || $eid > $toptype + 499) continue;
|
|
|
|
if (is_str_float($eid)) continue; //仅显示2级
|
|
|
|
if (is_str_float($eid)) continue;//仅显示2级
|
|
|
|
if ($eid == $nativeplace) {
|
|
|
|
$fields['nativeplace'] .= " {$em}\r\n";
|
|
|
|
$fields['nativeplace'] .= "{$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['nativeplace'] .= " <a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$fields['nativeplace'] .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!is_str_float($nativeplace)) {
|
|
|
|
//2级分类
|
|
|
|
$fields['nativeplace'] .= "<span> {$em_nativeplaces[$sontype]}</span>";
|
|
|
|
$fields['nativeplace'] .= "<span>{$em_nativeplaces[$sontype]}</span>";
|
|
|
|
$i = 0;
|
|
|
|
$ff = "";
|
|
|
|
foreach ($em_nativeplaces as $eid => $em) {
|
|
|
|
if ($eid < $sontype + 1 && $eid > $sontype)
|
|
|
|
{
|
|
|
|
if ($eid < $sontype + 1 && $eid > $sontype) {
|
|
|
|
if (is_str_float($eid)) {
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
@@ -109,22 +105,22 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$ff .= " {$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$ff .= " <a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$ff .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$ff .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
$ff .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($i > 0) $fields['nativeplace'] .= " - ";
|
|
|
|
if ($i > 0) $fields['nativeplace'] .= "<br>";
|
|
|
|
$fields['nativeplace'] .= $ff;
|
|
|
|
} else {
|
|
|
|
//3级分类
|
|
|
|
$t = intval($nativeplace);
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$t}&infotype={$infotype}&channelid={$channelid}'> {$em_nativeplaces[$t]}</a> -";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$t}&infotype={$infotype}&channelid={$channelid}'> {$em_nativeplaces[$t]}</a><br>";
|
|
|
|
} else {
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$t}&infotype={$infotype}'> {$em_nativeplaces[$t]}</a> -";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$t}&infotype={$infotype}'> {$em_nativeplaces[$t]}</a><br>";
|
|
|
|
}
|
|
|
|
foreach ($em_nativeplaces as $eid => $em) {
|
|
|
|
if ($eid < $t + 1 && $eid > $t) {
|
|
|
@@ -132,16 +128,16 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$fields['nativeplace'] .= " {$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['nativeplace'] .= " <a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$eid}&infotype={$infotype}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$fields['nativeplace'] .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
$fields['nativeplace'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&infotype={$infotype}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//小分类链接
|
|
|
|
//信息类型
|
|
|
|
if (empty($infotype) || !is_array($smalltypes)) {
|
|
|
|
foreach ($em_infotypes as $eid => $em) {
|
|
|
|
if (!is_array($smalltypes) || $eid % 500 != 0) continue;
|
|
|
@@ -150,9 +146,9 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$fields['infotype'] .= " {$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['infotype'] .= " <a href='{$baseurl}list-{$typeid}?infotype={$eid}&nativeplace={$nativeplace}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}list-{$typeid}?infotype={$eid}&nativeplace={$nativeplace}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$fields['infotype'] .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&infotype={$eid}&nativeplace={$nativeplace}'>{$em}</a>\r\n";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&infotype={$eid}&nativeplace={$nativeplace}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -160,28 +156,28 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$sontype = (($infotype % 500 != 0) ? $infotype : 0);
|
|
|
|
$toptype = (($infotype % 500 == 0) ? (int)$infotype : (int)($infotype - ($infotype % 500)));
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['infotype'] = "<a href='{$baseurl}list-{$typeid}?infotype={$toptype}&nativeplace={$nativeplace}&channelid={$channelid}'>{$em_infotypes[$toptype]}</a> - ";
|
|
|
|
$fields['infotype'] = "<a href='{$baseurl}list-{$typeid}?infotype={$toptype}&nativeplace={$nativeplace}&channelid={$channelid}'>{$em_infotypes[$toptype]}</a><br>";
|
|
|
|
} else {
|
|
|
|
$fields['infotype'] = "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&infotype={$toptype}&nativeplace={$nativeplace}'>{$em_infotypes[$toptype]}</a> - ";
|
|
|
|
$fields['infotype'] = "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&infotype={$toptype}&nativeplace={$nativeplace}'>{$em_infotypes[$toptype]}</a><br>";
|
|
|
|
}
|
|
|
|
if ($infotype % 500 == 0) {
|
|
|
|
//1级分类
|
|
|
|
foreach ($em_infotypes as $eid => $em) {
|
|
|
|
if ($eid < $toptype + 1 || $eid > $toptype + 499) continue;
|
|
|
|
if (is_str_float($eid)) continue; //仅显示2级
|
|
|
|
if (is_str_float($eid)) continue;//仅显示2级
|
|
|
|
if ($eid == $infotype) {
|
|
|
|
$fields['infotype'] .= " {$em}\r\n";
|
|
|
|
$fields['infotype'] .= "{$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['infotype'] .= " <a href='{$baseurl}list-{$typeid}?nativeplace={$nativeplace}&infotype={$eid}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$nativeplace}&infotype={$eid}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$fields['infotype'] .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$eid}'>{$em}</a>\r\n";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$eid}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!is_str_float($infotype)) {
|
|
|
|
//2级分类
|
|
|
|
$fields['infotype'] .= "<span> {$em_infotypes[$sontype]}</span>";
|
|
|
|
$fields['infotype'] .= "<span>{$em_infotypes[$sontype]}</span>";
|
|
|
|
$i = 0;
|
|
|
|
$ff = "";
|
|
|
|
foreach ($em_infotypes as $eid => $em) {
|
|
|
@@ -193,22 +189,22 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$ff .= " {$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$ff .= " <a href='{$baseurl}list-{$typeid}?nativeplace={$nativeplace}&infotype={$eid}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$ff .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$nativeplace}&infotype={$eid}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$ff .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$eid}'>{$em}</a>\r\n";
|
|
|
|
$ff .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$eid}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($i > 0) $fields['infotype'] .= " - ";
|
|
|
|
if ($i > 0) $fields['infotype'] .= "<br>";
|
|
|
|
$fields['infotype'] .= $ff;
|
|
|
|
} else {
|
|
|
|
//3级分类
|
|
|
|
$t = intval($infotype);
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$nativeplace}&infotype={$t}&channelid={$channelid}'> {$em_infotypes[$t]}</a> -";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}list-{$typeid}?nativeplace={$nativeplace}&infotype={$t}&channelid={$channelid}'> {$em_infotypes[$t]}</a><br>";
|
|
|
|
} else {
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$t}'> {$em_infotypes[$t]}</a> -";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$t}'> {$em_infotypes[$t]}</a><br>";
|
|
|
|
}
|
|
|
|
foreach ($em_infotypes as $eid => $em) {
|
|
|
|
if ($eid < $t + 1 && $eid > $t) {
|
|
|
@@ -216,9 +212,9 @@ function lib_infolink(&$ctag, &$refObj) |
|
|
|
$fields['infotype'] .= " {$em}\r\n";
|
|
|
|
} else {
|
|
|
|
if ($cfg_rewrite == 'Y') {
|
|
|
|
$fields['infotype'] .= " <a href='{$baseurl}/list-{$typeid}?nativeplace={$nativeplace}&infotype={$eid}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}/list-{$typeid}?nativeplace={$nativeplace}&infotype={$eid}&channelid={$channelid}'>{$em}</a>\r\n";
|
|
|
|
} else {
|
|
|
|
$fields['infotype'] .= " <a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$eid}'>{$em}</a>\r\n";
|
|
|
|
$fields['infotype'] .= "<a href='{$baseurl}apps/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}&infotype={$eid}'>{$em}</a>\r\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|