http://www.miwit.com/b/mw_tip-4392
여기에 그누5올려놓았는데요... 그누4로 사용을 할수는없을까요???
g5 -> g4 로는 변경해도 사용을 할수가없어서요..
현재 구글에서는 이렇게 하라고 되있어서요..
https://support.google.com/news/publisher/answer/74288?hl=ko
--- 배추님이 파일을 수정해서 올려놓았는데도 그걸사용해도 등록은 되지만 구글에서 색인이불가능합니다.
어떻게 해야될까요??? -------
*** 앗 다운이 안되네요.. ******* 밑에 소스올릴께요
Copy
<?php</urlset>// please give feedbacks to bomool.netinclude_once("_common.php");$charset = $g4[charset];$url = "http://www.purpress.com"; //::::::::::::::: write your GNUboard root path// 특수문자 변환. 변환하지않으면 XML 문법에 맞지 않으니까 변환해야합니다.function specialchars_replace($str, $len=0) { if ($len) { // 두번째 인자로 길이 값을 주면 그 길이만큼만 잘르고 나머지는 버린 후 치환합니다 $str = substr($str, 0, $len); } // 정규식으로 치환해야 제대로 원하는 것만 치환시키겠죠.. $str = preg_replace("/&/", "&", $str); $str = preg_replace("/</", "<", $str); $str = preg_replace("/>/", ">", $str); return $str;}header("Content-type: text/xml;charset=\"UTF-8\"");header("Cache-Control: no-cache, must-revalidate");header("Pragma: no-cache");echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"><?php$query = sql_query("select bo_table from `$g4[board_table]` where bo_read_level='1'");while($temp = sql_fetch_array($query)) { $bo_arr[] = $temp[bo_table];}$i = 1;foreach($bo_arr as $bo) { $query = sql_query("select wr_id, wr_datetime, wr_subject from `$g4[write_prefix]$bo` where wr_is_comment='0' AND wr_option NOT LIKE '%secret%'"); while($row = sql_fetch_array($query)) { // list of bo_table echo "<url>\n"; echo "<loc>$url/bbs/board.php?bo_table=$bo&wr_id=$row[wr_id]</loc>\n"; $temp = sql_fetch("select wr_datetime from `$g4[write_prefix]$bo` where wr_parent='$row[wr_id]' order by wr_id DESC"); $lastmod = str_replace(" ", "T", substr($temp[wr_datetime], 0, 30))."+00:00"; if(!$lastmod) { $temp = sql_fetch("select wr_datetime from `$g4[write_prefix]$bo` where wr_id='$row[wr_id]'"); $lastmod = str_replace(" ", "T", substr($temp[wr_datetime], 0, 30))."+00:00"; } if(!$lastmod) $lastmod = $g4[time_ymd]; echo "<news:news>\n"; echo "<news:publication>\n"; echo "<news:name>".specialchars_replace("e뉴스페이퍼")."</news:name>\n"; echo "<news:language>".specialchars_replace("ko")."</news:language>\n"; echo "</news:publication>\n"; echo "<news:publication_date>".specialchars_replace("$lastmod")."</news:publication_date>\n"; echo "<news:title>".specialchars_replace('['.$board['bo_subject'].'] '.$row['wr_subject'])."</news:title>\n"; echo " </news:news>\n"; echo "</url>\n"; } $i++;}?></urlset>
|
답변 2개 / 댓글 2개
채택된 답변
+20 포인트
2015-07-23 (목) 17:01:52
그누보드4에 맞춰서 수정하시면 사용 가능 합니다.
답변에 대한 댓글 1개
별을따는소년
2015-07-23 (목) 17:25:13
저소스부분이 배추님이 그누4에 맞쳐서 수정한건데요... 불러오지를 못하네요.. http://www.purpress.co.kr/google-news.php
2015-07-23 (목) 17:27:38
url이 틀린것 같습니다.
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.