質問編集履歴
14
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -256,10 +256,12 @@
|
|
256
256
|
|
257
257
|
|
258
258
|
|
259
|
-
```
|
259
|
+
```
|
260
260
|
|
261
261
|
<?
|
262
262
|
|
263
|
+
//試したこと①
|
264
|
+
|
263
265
|
$siteURL = "http://example.com";
|
264
266
|
|
265
267
|
$changefreqs =[0=>"always",
|
13
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -256,7 +256,7 @@
|
|
256
256
|
|
257
257
|
|
258
258
|
|
259
|
-
|
259
|
+
``` 試したこと①
|
260
260
|
|
261
261
|
<?
|
262
262
|
|
@@ -328,7 +328,7 @@
|
|
328
328
|
|
329
329
|
|
330
330
|
|
331
|
-
|
331
|
+
```
|
332
332
|
|
333
333
|
### 補足情報(FW/ツールのバージョンなど)
|
334
334
|
|
12
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -256,6 +256,80 @@
|
|
256
256
|
|
257
257
|
|
258
258
|
|
259
|
+
### 試したこと①
|
260
|
+
|
261
|
+
<?
|
262
|
+
|
263
|
+
$siteURL = "http://example.com";
|
264
|
+
|
265
|
+
$changefreqs =[0=>"always",
|
266
|
+
|
267
|
+
1=>"hourly",
|
268
|
+
|
269
|
+
2=>"daily",
|
270
|
+
|
271
|
+
3=>"weekly",
|
272
|
+
|
273
|
+
4=>"monthly",
|
274
|
+
|
275
|
+
5=>"yearly",
|
276
|
+
|
277
|
+
6=>"never"];
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
$publicSiteMap[] = ["loc"=>$siteURL . "/search/sample1.html","priority"=>"1.0","changefreq"=>0];
|
282
|
+
|
283
|
+
$publicSiteMap[] = ["loc"=>$siteURL . "/search/sample2.html","priority"=>"0.8","changefreq"=>2];
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
$xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?>' . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></urlset>');
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
// xmlノード追加(記事・マンスリー)
|
292
|
+
|
293
|
+
if (count($publicSiteMap) > 0) {
|
294
|
+
|
295
|
+
foreach ($publicSiteMap as $map) {
|
296
|
+
|
297
|
+
$xmla = $xml->addChild('url');
|
298
|
+
|
299
|
+
foreach($map as $mapkey=>$mapvalue){
|
300
|
+
|
301
|
+
if($mapkey === "changefreq"){
|
302
|
+
|
303
|
+
$xmla->addChild($mapkey, $changefreqs[$mapvalue]);
|
304
|
+
|
305
|
+
}else{
|
306
|
+
|
307
|
+
$xmla->addChild($mapkey, $mapvalue);
|
308
|
+
|
309
|
+
}
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
$retXML = $xml->asXML();
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
echo $retXML;
|
322
|
+
|
323
|
+
}
|
324
|
+
|
325
|
+
?>
|
326
|
+
|
327
|
+
を秀丸エディタを用いて記述し実行しました。
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
259
333
|
### 補足情報(FW/ツールのバージョンなど)
|
260
334
|
|
261
335
|
|
11
文章修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,6 +68,132 @@
|
|
68
68
|
|
69
69
|
$retXML = str_replace( "</urlset>" , "\n</urlset>" , $retXML );
|
70
70
|
|
71
|
+
|
72
|
+
|
73
|
+
/****** xmlファイルの書き出し*****/
|
74
|
+
|
75
|
+
$createFile = 'sitemap.xml';
|
76
|
+
|
77
|
+
$putFileName = $docRoot."/".$createFile;
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
file_put_contents ($putFileName, $retXML);
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
mysql_close($con);
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
$mess = "抽出バッチ終了時刻2:".date('Y,m/d H:i:s');
|
90
|
+
|
91
|
+
echo $mess;
|
92
|
+
|
93
|
+
//バッチ起動履歴ログ
|
94
|
+
|
95
|
+
$log -> writeLog2($mess);
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
function getDirFiles($tar,$match)
|
106
|
+
|
107
|
+
{
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
if ($handle = opendir($tar))
|
112
|
+
|
113
|
+
{
|
114
|
+
|
115
|
+
while (false !== ($file = readdir($handle)))
|
116
|
+
|
117
|
+
{
|
118
|
+
|
119
|
+
//echo $file."<br>";
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
if ('.' == $file || '..' == $file)// 自分自身と上位ディレクトリを除外
|
124
|
+
|
125
|
+
{
|
126
|
+
|
127
|
+
continue;
|
128
|
+
|
129
|
+
}// if
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
//echo preg_match($match, $file)."<br>";
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
//ファイル名パターンにマッチしない場合除外
|
140
|
+
|
141
|
+
if (!preg_match($match, $file)) {
|
142
|
+
|
143
|
+
continue;
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
/***** 制御文字、日本語文字処理 *****/
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
// 制御文字置換
|
154
|
+
|
155
|
+
$file00 = htmlspecialchars($file);
|
156
|
+
|
157
|
+
// 日本語対策 UTF-8へコード変換
|
158
|
+
|
159
|
+
$file01 = mb_convert_encoding($file00, 'UTF-8','HTML-ENTITIES,ASCII,JIS, EUC-JP, SJIS');
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
//ファイル名取得
|
164
|
+
|
165
|
+
$filename[] = $file01;
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
//サイトマップ公開記事(仕事詳細)
|
170
|
+
|
171
|
+
//$publicSiteMap[] = $siteURL."/contents/montly/".$filename;
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
} //while
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
closedir($handle); // ディレクトリハンドルを閉じる
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
return $filename;
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
} //if
|
188
|
+
|
189
|
+
}//function
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
71
197
|
```
|
72
198
|
|
73
199
|
|
10
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,6 +36,12 @@
|
|
36
36
|
|
37
37
|
```php
|
38
38
|
|
39
|
+
|
40
|
+
|
41
|
+
////現在のコード
|
42
|
+
|
43
|
+
|
44
|
+
|
39
45
|
$xml = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?>'.'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"></urlset>');
|
40
46
|
|
41
47
|
|
@@ -62,11 +68,13 @@
|
|
62
68
|
|
63
69
|
$retXML = str_replace( "</urlset>" , "\n</urlset>" , $retXML );
|
64
70
|
|
71
|
+
```
|
65
72
|
|
66
73
|
|
67
|
-
_____________________________________________________
|
68
74
|
|
75
|
+
```
|
76
|
+
|
69
|
-
現在の出力状況
|
77
|
+
//現在の出力状況
|
70
78
|
|
71
79
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
72
80
|
|
@@ -78,9 +86,11 @@
|
|
78
86
|
|
79
87
|
|
80
88
|
|
89
|
+
```
|
81
90
|
|
91
|
+
```
|
82
92
|
|
83
|
-
出力変更例
|
93
|
+
//出力変更例
|
84
94
|
|
85
95
|
|
86
96
|
|
9
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
|
3
|
+
|
4
4
|
|
5
5
|
sitemap.xmlの仕様変更で<priority>,<changefreq>項目の追加のしかた。
|
6
6
|
|
8
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
-
|
67
|
+
_____________________________________________________
|
68
68
|
|
69
69
|
現在の出力状況
|
70
70
|
|
7
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
}
|
56
56
|
|
57
|
-
|
57
|
+
}
|
58
58
|
|
59
59
|
$retXML = $xml->asXML();
|
60
60
|
|
6
誤字
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
sitemap.xmlの書きだし方変更
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
|
3
|
+
【至急!】
|
4
4
|
|
5
5
|
sitemap.xmlの仕様変更で<priority>,<changefreq>項目の追加のしかた。
|
6
6
|
|
5
文法
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
sitemap.xmlの書きだし方変更
|
1
|
+
【至急!】sitemap.xmlの書きだし方変更
|
test
CHANGED
File without changes
|
4
文法
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,11 +18,13 @@
|
|
18
18
|
|
19
19
|
さらにchangefreqを出力できるコードの組み方がわかりません。
|
20
20
|
|
21
|
+
担当者がいきなり初心者の私になりphpがほぼわからない状態となっております。
|
22
|
+
|
21
|
-
もしよろしければ足りないコードの組み方を教えてください!!
|
23
|
+
このようなことを言うのはずるいかもしれませんが、もしよろしければ足りないコードの組み方を教えてください!!
|
22
24
|
|
23
25
|
どうかお願いいたします!!
|
24
26
|
|
25
|
-
正直答えを頂かないと全くわからない状況です”!
|
27
|
+
正直答えそのものを頂かないと全くわからない状況です”!
|
26
28
|
|
27
29
|
```
|
28
30
|
|
@@ -112,8 +114,6 @@
|
|
112
114
|
|
113
115
|
|
114
116
|
|
115
|
-
担当者がいきなり初心者の私になりphpがほぼわからない状態となっております。
|
116
|
-
|
117
117
|
$retXML = str_replace( "<url><loc><priority><changefreq>" , "\n<url><loc><priority><changefreq>" , $retXML );
|
118
118
|
|
119
119
|
ここに<priority><changefreq>は入れましたがその前段階の設定がわかりません。
|
3
文法
test
CHANGED
File without changes
|
test
CHANGED
@@ -124,4 +124,4 @@
|
|
124
124
|
|
125
125
|
|
126
126
|
|
127
|
-
|
127
|
+
何か情報が足りないとかあるでしょうか?
|
2
文章追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,13 +64,27 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
|
67
|
+
現在の出力状況
|
68
|
+
|
69
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
70
|
+
|
71
|
+
<url><loc>http://sample1.com/</loc></url>
|
72
|
+
|
73
|
+
<url><loc>http://sample2.com/jbinf/00001/01.html</loc></url>
|
74
|
+
|
75
|
+
<url><loc>http://sample3.com/jbinf/00002/01.html</loc></url>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
67
|
-
出力例
|
81
|
+
出力変更例
|
68
82
|
|
69
83
|
|
70
84
|
|
71
85
|
<url>
|
72
86
|
|
73
|
-
<loc>http://sample.com/</loc>
|
87
|
+
<loc>http://sample1.com/</loc>
|
74
88
|
|
75
89
|
<priority>1.0</priority>
|
76
90
|
|
@@ -80,7 +94,7 @@
|
|
80
94
|
|
81
95
|
<url>
|
82
96
|
|
83
|
-
<loc>http://sample.com/info/</loc>
|
97
|
+
<loc>http://sample2.com/info/</loc>
|
84
98
|
|
85
99
|
<priority>0.8</priority>
|
86
100
|
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
3
|
|
4
|
-
|
5
|
-
ここに質問の内容を詳しく書いてください。
|
6
4
|
|
7
5
|
sitemap.xmlの仕様変更で<priority>,<changefreq>項目の追加のしかた。
|
8
6
|
|