구글뉴스사이트맵 관련문의입니다.

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
구글뉴스사이트맵 관련문의입니다.

QA

구글뉴스사이트맵 관련문의입니다.

본문

http://www.miwit.com/b/mw_tip-4392
여기에 그누5올려놓았는데요... 그누4로 사용을 할수는없을까요???

g5 -> g4 로는 변경해도 사용을 할수가없어서요..

현재 구글에서는 이렇게 하라고 되있어서요..

https://support.google.com/news/publisher/answer/74288?hl=ko

 

 

--- 배추님이 파일을 수정해서 올려놓았는데도 그걸사용해도 등록은 되지만 구글에서 색인이불가능합니다.

 어떻게 해야될까요??? -------

 

 

*** 앗 다운이 안되네요.. ******* 밑에 소스올릴께요

 

 


 
<?php
</urlset>
// please give feedbacks to bomool.net
include_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 "<".specialchars_replace("e뉴스페이퍼")."\n'>news:name>".specialchars_replace("e뉴스페이퍼")."</news:name>\n";
    echo "<".specialchars_replace("ko")."\n'>news:language>".specialchars_replace("ko")."</news:language>\n";
    echo "</news:publication>\n";
    echo "<".specialchars_replace("$lastmod")."\n'>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

그누보드4에 맞춰서 수정하시면 사용 가능 합니다.

url이 틀린것 같습니다.

 

답변을 작성하시기 전에 로그인 해주세요.
전체 124,352 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT