테스트 사이트 - 개발 중인 베타 버전입니다

사이트맵 생성하는 php 관련 질문입니다. 채택완료

Text 7년 전 조회 2,290

include_once("./_common.php");

 

$charset = $g5[charset];

$url = "https://www.example.com/" rel="nofollow" target="_blank">https://www.example.com"; //::::::::::::::: write your GNUboard root path

 

header("Content-type: text/xml;charset=\"UTF-8\"");

header("Cache-Control: no-cache, must-revalidate");

header("Pragma: no-cache");

 

echo "\n";

?>

http://www.sitemaps.org/schemas/sitemap/0.9" rel="nofollow" target="_blank">http://www.sitemaps.org/schemas/sitemap/0.9">

$query = sql_query("select bo_table from `g5_write_test_board` where as_list='1'");

while($temp = sql_fetch_array($query)) {

        $bo_arr = $temp;

}

$i = 1;

foreach($bo_arr as $bo) {

        // list of bo_table

        echo "\n";

        echo "$url/bbs/board.php?bo_table=$bo\n";

        $temp = sql_fetch("select wr_datetime from `$g5[write_prefix]$bo` order by wr_datetime DESC");

        $lastmod = str_replace(" ", "T", substr($temp[wr_datetime], 0, 30))."+00:00";

 

        // if

        if(!$lastmod || strlen($lastmod) < 25 || strcmp($lastmod, "+00:00")) $lastmod = "2014-10-10T00:00:00+00:00";

 

        echo "$lastmod\n";

        echo "daily\n";

        echo "0.9\n";

        echo "\n";

 

        $query = sql_query("select wr_id, wr_datetime from `$g5[write_prefix]$bo` where wr_is_comment='0' AND wr_option NOT LIKE '%secret%'");

        while($row = sql_fetch_array($query)) {

                // list of each article

                echo "";

                echo "$url/bbs/board.php?bo_table=$bo&wr_id=$row[wr_id]";

                $temp = sql_fetch("select wr_datetime from `$g5[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 `$g5[write_prefix]$bo` where wr_id='$row[wr_id]'");

                        $lastmod = str_replace(" ", "T", substr($temp[wr_datetime], 0, 30))."+00:00";

                }

                if(!$lastmod) $lastmod = $g5[time_ymd];

                echo "$lastmod";

                echo "weekly";

                echo "0.5";

                echo "\n";

        }

        $i++;

}

?>

 

원래 코딩되어있던걸 이런식으로 수정해서 g5_write_test_ board만 사이트 맵을 생성하려고 하는데요...

결과가 이렇습니다.

 

This XML file does not appear to have any style information associated with it. The document tree is shown below.

http://www.sitemaps.org/schemas/sitemap/0.9" rel="nofollow" target="_blank">http://www.sitemaps.org/schemas/sitemap/0.9">

 

 

도저히 어디가 잘못됐는지 모르겠습니다.

$query = sql_query("select bo_table from `g5_write_test_board` where as_list='1'");

while($temp = sql_fetch_array($query)) {

        $bo_arr = $temp;

}

 

여기서 특정 게시판으로 선별됐다고 생각하는데.... 

아직 초보자라서 그런지 잘 모르겠네요 ㅠㅠ

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
베원
7년 전

</p>

<p>$query = sql_query("select bo_table from `g5_write_test_board` where as_list='1'");</p>

<p>while($temp = sql_fetch_array($query)) {</p>

<p>        $bo_arr = $temp;</p>

<p>}</p>

<p>

</p>

<p>$query = sql_query("select bo_table from `g5_board` where 1");</p>

<p>while($temp = sql_fetch_array($query)) {</p>

<p>        $bo_arr[] = $temp['bo_table'];</p>

<p>}</p>

<p>

로 변경해보세요.

 

test_board 게시판만 선정하고 싶으시면

변경된

</p>

<p>$query = sql_query("select bo_table from `g5_board` where 1");</p>

<p>while($temp = sql_fetch_array($query)) {</p>

<p>        $bo_arr[] = $temp['bo_table'];</p>

<p>}</p>

<p>

부분을 지우시고

</p>

<p>$bo_arr[] = 'test_board'</p>

<p>

를 넣어보세요.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

T
Text
7년 전
음.. 결과값을 sitemap_testboard.xml 이런식으로 저장하고 싶은데...
어떻게 하는지 알려주실수 있으신가요?
죄송합니다.
베원
7년 전
@Text echo로 되어 있는 부분을 문자열 변수에 저장하도록 하신 후, 그 변수의 값을 file_put_contents 함수로 내보내시면 될 겁니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인