반부

사이트 운영을 위한 설정

‹ 커뮤니티 · 자유게시판

자유게시판

사이트 운영을 위한 설정

최고관리자2025.01.12 22:45조회 7,522

필수 등록

1. google search console

2. google analytics

3. google adsense

4. naver webmaster

5. bing webmaster

6. zoom webmaster

 

sitemap 생성

1. https://www.xml-sitemaps.com/ 

2. 아파트 매매, 청약 등 우리가 개발 한 페이지의 sitemap은 직접 사이트 맵 만들기 

--> 이런 경우는 sitemap.index를 만들어서 사이트맵을 구성하는게 효율적임 (ex. banbu.kr/sitemap.xml)

 

rss feed 생성

<?php

$g5_path = ''; // common.php 의 상대 경로

include_once ('common.php');


// 특수문자 변환

function specialchars_replace($str, $len = 0)

{

if ($len) {

$str = substr($str, 0, $len);

}


$str = str_replace(array("&", "<", ">"), array("&amp;", "<", ">"), $str);


return $str;

}


function conv_rich_content($matches)

{

global $view;

return view_image($view, $matches[1], $matches[2]);

}


function conv_link_video($link)

{


if (!$link)

return;


// 비디오, 오디오 체크

$vext = array("mp4", "m4v", "f4v", "mov", "flv", "webm", "acc", "m4a", "f4a", "mp3", "ogg", "oga", "rss");


list($link_video) = explode("|", $link);


$file = apms_get_filename($link_video);


$str = '';

if (isset ($file['ext']) && $file['ext'] && in_array($file['ext'], $vext)) {

if (apms_jwplayer($link_video)) {

$str = '<p>{video:' . $link_video . '|file=1}</p>';

}

} else {

$video = apms_video_info($link_video);

if (isset ($video['vid']) && $video['vid']) {

$str = '<p>{video:' . $link_video . '}</p>';

}

}


return $str;

}


function img_insert_content($matches)

{

global $row;


return view_image($row, $matches[1], $matches[2]);

}


// RSS 갯수

$rss_rows = $config['cf_page_rows'];


// 통합 RSS bo_table

$bo = array();

$result = sql_query(" select bo_table from {$g5['board_table']} where bo_read_level = '1' and bo_table <> '' "); // 

for ($i = 0; $row = sql_fetch_array($result); $i++) {

$bo[$i] = $row['bo_table'];

}


if (!$i) {

echo 'RSS 보기가 가능한 게시판이 없습니다.';

exit;

}



// Feed 동영상

$is_feedvideo = true;


header('Content-type: text/xml');

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

header('Pragma: no-cache');


echo '<?xml version="1.0" encoding="utf-8" ?>' . "\n";


?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">

<channel>

<title>

<?php echo specialchars_replace($config['cf_title']); ?>

</title>

<link>

<?php echo specialchars_replace(G5_URL); ?>

</link>

<description>

<?php echo ($xp['seo_desc']) ? specialchars_replace($xp['seo_desc']) : specialchars_replace($config['cf_title']); ?>

</description>

<language>ko</language>

<?php

// 추출하기

$bo_list = ($i > 0) ? implode(',', $bo) : $bo[0];

$result = sql_query(" select * from {$g5['board_new_table']} where wr_id = wr_parent and find_in_set(bo_table, '{$bo_list}') order by bn_id desc limit 0, $rss_rows ", false);


for ($i = 0; $post = sql_fetch_array($result); $i++) {


$tmp_write_table = $g5['write_prefix'] . $post['bo_table'];

$row = sql_fetch(" select * from $tmp_write_table where wr_id = '{$post['wr_id']}' ", false);

$board = sql_fetch(" select bo_subject from {$g5['board_table']} where bo_table = '{$post['bo_table']}' ");


// 링크

for ($i = k; $k <= G5_LINK_COUNT; $k++) {

$row['link'][$i] = set_http(get_text($row["wr_link{$k}"]));

}


if (strstr($row['wr_option'], 'html'))

$html = 1;

else

$html = 0;


// 확장보드

//$wr_data = apms_unpack($row['wr_content']);

//

//if($row['as_extend'] || $wr_data['content']) {

//$row['wr_content'] = $wr_data['content'];

//}

$row['wr_content'] = conv_content($row['wr_content'], $html);


$file = $head_file = $tail_file = '';

if ($row['as_img'] == "2") { // 본문삽입

$row['wr_content'] = preg_replace_callback("/{이미지\:([0-9]+)[:]?([^}]*)}/i", "img_insert_content", $row['wr_content']);

} else {


$tmp = get_file($post['bo_table'], $post['wr_id']);


for ($j = 0; $j < count($tmp); $j++) {

if (isset ($tmp[$j]['source']) && $tmp[$j]['source'] && $tmp[$j]['view']) {

$file .= '<p><img src="' . $tmp[$j]['path'] . '/' . $tmp[$j]['file'] . '"></p>';

}

}


if ($row['as_img'] == "1") {

$head_file = $file;

} else {

$tail_file = $file;

}


//$row['wr_content'] = $head_file.apms_link_video($row['link']);//.apms_content($row['wr_content']).$tail_file;

}


$post_url = G5_BBS_URL . '/board.php?bo_table=' . $post['bo_table'] . '&amp;wr_id=' . $post['wr_id'];

?>

<item>

<title>

<?php echo specialchars_replace('[' . $board['bo_subject'] . '] ' . $row['wr_subject']) ?>

</title>

<link>

<?php echo $post_url; ?>

</link>

<description>

<![CDATA[<?php echo $row['wr_content']; ?>]]>

</description>

<dc:creator>

<?php echo specialchars_replace($row['wr_name']) ?>

</dc:creator>

<?php

$date = $row['wr_datetime'];

// rss 리더 스킨으로 호출하면 날짜가 제대로 표시되지 않음

//$date = substr($date,0,10) . "T" . substr($date,11,8) . "+09:00";

$date = date('r', strtotime($date));

?>

<pubDate>

<?php echo $date ?>

</pubDate>

<guid>

<?php echo $post_url; ?>

</guid>

</item>

<?php } ?>

</channel>

</rss> 

 

robots.txt 생성

User-agent: *

Allow: /

댓글 0

아직 댓글이 없습니다. 첫 댓글 남기기 ›