|
@@ -35,11 +35,16 @@ class SitemapController extends Controller{
|
35
|
35
|
$wildcard = $this->config('wildcard'); //泛域名支持状态
|
36
|
36
|
$city_suffix = $this->config('city_suffix'); //城市后缀
|
37
|
37
|
$city_suffix = $city_suffix ? '.html' : '/';
|
|
38
|
+
|
38
|
39
|
$model = model('admin.system.City');
|
39
|
40
|
$city = $model->getAllList();
|
40
|
41
|
$domain = get_http_host(); //当前域名
|
41
|
42
|
$cur_city = array_filter($city, function($t) use ($domain) { return $t['isurl'] == $domain; }); //当前城市绑定了域名
|
|
43
|
+
|
|
44
|
+
|
42
|
45
|
if( $wildcard || !empty($cur_city) ){
|
|
46
|
+ //开启泛域名
|
|
47
|
+ //var_dump("fdfdf");die;
|
43
|
48
|
foreach ($sorts as $value) {
|
44
|
49
|
if ($value->outlink) {
|
45
|
50
|
continue;
|
|
@@ -55,12 +60,16 @@ class SitemapController extends Controller{
|
55
|
60
|
continue;
|
56
|
61
|
} else {
|
57
|
62
|
$link = $Parser->parserLink(2, $value2->urlname, 'content', $value2->scode, $value2->sortfilename, $value2->id, $value2->filename);
|
|
63
|
+ //echo $link;die;
|
|
64
|
+ //去除.html
|
|
65
|
+ $link = str_replace(".html", "", $link);
|
58
|
66
|
}
|
59
|
67
|
$str .= $this->makeNode($link, date('Y-m-d', strtotime($value2->date)), '0.60', 'daily');
|
60
|
68
|
}
|
61
|
69
|
}
|
62
|
70
|
}
|
63
|
71
|
}else{
|
|
72
|
+ //var_dump("fdfdf");die;
|
64
|
73
|
cookie('city',''); //防止生成的链接叠加当前城市
|
65
|
74
|
foreach ($city as $c) {
|
66
|
75
|
$str .= $this->makeNode( '/'.$c['etitle'] . $city_suffix, date('Y-m-d'), '1.00', 'always'); // 根目录
|
|
@@ -94,6 +103,9 @@ class SitemapController extends Controller{
|
94
|
103
|
continue;
|
95
|
104
|
} else {
|
96
|
105
|
$link = $Parser->parserLink(2, $value2->urlname, 'content', $value2->scode, $value2->sortfilename, $value2->id, $value2->filename);
|
|
106
|
+ //echo $link;die;
|
|
107
|
+ //去除.html
|
|
108
|
+ $link = str_replace(".html", "", $link);
|
97
|
109
|
}
|
98
|
110
|
$str .= $this->makeNode( $url . $link, date('Y-m-d', strtotime($value2->date)), '0.60', 'daily');
|
99
|
111
|
}
|
|
@@ -133,6 +145,8 @@ class SitemapController extends Controller{
|
133
|
145
|
$domain = get_http_host(); //当前域名
|
134
|
146
|
$cur_city = array_filter($city, function($t) use ($domain) { return $t['isurl'] == $domain; }); //当前城市绑定了域名
|
135
|
147
|
if( $wildcard || !empty($cur_city) ){
|
|
148
|
+ //开启二级域名
|
|
149
|
+ //var_dump("55dfd5");die;
|
136
|
150
|
foreach ($sorts as $value) {
|
137
|
151
|
if ($value->outlink) {
|
138
|
152
|
continue;
|
|
@@ -148,6 +162,9 @@ class SitemapController extends Controller{
|
148
|
162
|
continue;
|
149
|
163
|
} else {
|
150
|
164
|
$link = $Parser->parserLink(2, $value2->urlname, 'content', $value2->scode, $value2->sortfilename, $value2->id, $value2->filename);
|
|
165
|
+ //echo $link;die;
|
|
166
|
+ //去除.html
|
|
167
|
+ $link = str_replace(".html", "", $link);
|
151
|
168
|
}
|
152
|
169
|
$str .= get_http_url() . $link . "\n";
|
153
|
170
|
}
|
|
@@ -184,6 +201,9 @@ class SitemapController extends Controller{
|
184
|
201
|
continue;
|
185
|
202
|
} else {
|
186
|
203
|
$link = $Parser->parserLink(2, $value2->urlname, 'content', $value2->scode, $value2->sortfilename, $value2->id, $value2->filename);
|
|
204
|
+ //echo $link;die;
|
|
205
|
+ //去除.html
|
|
206
|
+ $link = str_replace(".html", "", $link);
|
187
|
207
|
}
|
188
|
208
|
$str .= get_http_url() . $url . $link . "\n";
|
189
|
209
|
}
|