그누보드5 검색최적화 방법
meta_seo_plugin.zip
첨부파일을 그누보드의 plugin 폴더에 넣으신 뒤
head.sub.php 파일의 <title> 태그 위에 incluede 해주시면될듯합니다 ㅎㅎㅎ
********** 참고 **************
<?php
include_once G5_PLUGIN_PATH. "/meta_seo_plugin.php";
?>
또 게시판 목록 보기를 하니 에러가 아래와 같이 나서 질/답게시판에서 균이님이 또 답변 주셔서 수정했습니다..(감사합니다)
에러내용:
Warning: Missing argument 2 for conv_subject(), called in /home/iherbkorea/www/plugin/meta_seo_plugin.php on line 38 and defined in /home/iherbkorea/www/lib/common.lib.php on line 464
해결책:
$view['meta_description'] = str_replace("\r\n"," ",conv_subject($site_name . " > 게시판 > ".$board['bo_subject']." (".$page."페이지)"));
--> 수정
$view['meta_description'] = "$site_name > 게시판 > {$board['bo_subject']} ($page 페이지)";
다른 분들에게도 도움이 되었으면 합니다.
**************** 참고 끝 ********************
첨부파일에 설정하는부분이 있는데
4번째줄부터
03 | $site_name = "치즈의 사이트"; |
04 | $site_hellow = "치즈의 사이트에 방문해주셔셔 감사합니다."; |
05 | $deport_key = "치즈,도치즈,프로그래머,일상"; |
07 | $capy_right = "Copyright © Dochis. All rights reserved."; |
08 | $capy_rghter = "DOCHIS"; |
10 | $site_description = "도치즈의 개인홈페이지입니다. 안녕하세요^^"; |
17 | $metoday_tags = "도치즈넷,도치즈,공지사항"; |
이런부분이 있는데... 해당부분은 사이트에 맞게 수정해주시기 바랍니다 ㅎㅎ
그누보드5.0b21 버젼 기준으로
head.sub.php 파일의 47번째줄
<title><?php echo $g5_head_title; ?></title>
코드 위에
1 | include_once G5_PLUGIN_URL . "/meta_seo_plugin.php"; |
추가해주시면될듯합니다^^
재가쓰던걸 급조해서 올린거라 오류가 발생할 수 있는데요;;
오류가있으면 알려주세요^^;;
첨부파일 전채코드
003 | if($wr_id && $bo_table) { $meta_post_cottent = sql_fetch("select wr_subject, wr_content, wr_name, wr_datetime from g5_write_{$bo_table} where wr_id = '$wr_id' limit 1"); } |
007 | $site_name = "치즈의 사이트"; |
008 | $site_hellow = "치즈의 사이트에 방문해주셔셔 감사합니다."; |
009 | $deport_key = "치즈,도치즈,프로그래머,일상"; |
011 | $capy_right = "Copyright © Dochis. All rights reserved."; |
012 | $capy_rghter = "DOCHIS"; |
014 | $site_description = "도치즈의 개인홈페이지입니다. 안녕하세요^^"; |
021 | $metoday_tags = "도치즈넷,도치즈,공지사항"; |
027 | if($meta_post_cottent) { |
028 | $view['wr_name'] = "이 게시물에 대한 모든 저작권은 작성자에게 있습니다. ( 작성자: ".$meta_post_cottent['wr_name']." )"; |
029 | $view['author'] = $meta_post_cottent['wr_name']; |
031 | $post_key = conv_subject(strip_tags($meta_post_cottent['wr_subject'].$meta_post_cottent['wr_content']),500); |
033 | $is_meta_author_data = $meta_post_cottent['wr_datetime']; |
037 | if($board['bo_subject'] || $meta_post_cottent['wr_content']) { |
038 | if(!$meta_post_cottent) { |
039 | $view['meta_description'] = str_replace("\r\n"," ",conv_subject($site_name . " > 게시판 > ".$board['bo_subject']." (".$page."페이지)")); |
041 | $view['meta_description'] = str_replace("\r\n"," ",conv_subject($site_name . " > ".$board['bo_subject']." | ".strip_tags($meta_post_cottent['wr_content']), 500)); |
044 | if($wr_id == "0" ) { unset($wr_id); } |
045 | $view['meta_canonical'] = $site_url."tb.php/$bo_table/$wr_id"; |
048 | $keywords = str_replace(array("\r\n","!","@","#","$"," "),",",$deport_key.",".$post_key); |
049 | $keywords = str_replace(array(" "),"",$keywords); |
050 | $keywords = array_unique(explode(",",$keywords)); |
051 | $keywords = array_filter(array_map('trim', $keywords)); |
052 | $keywords = implode(",",$keywords); |
057 | $g5_head_title = (!$g5_head_title) ? $site_hellow : $g5_head_title; |
058 | $meta_subject = (!$g5_head_title) ? $site_hellow : $g5_head_title; |
059 | $meta_title = (!$g5_head_title) ? $site_hellow : $g5_head_title; |
060 | $meta_copyright = (!$view['wr_name']) ? $capy_right : $view['wr_name']; |
061 | $meta_author = (!$view['wr_name']) ? $capy_rghter : $view['author']; |
062 | $meta_keywords = $keywords; |
064 | $meta_description = (!$view['meta_description']) ? $site_description.$deport_key : str_replace(array(" ","\r\n"),"",$view['meta_description']); |
066 | $meta_distribution = "Global"; |
068 | $meta_canonical = (!$view['meta_canonical']) ? 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] : $view['meta_canonical']; |
072 | <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
075 | <meta name="Location" content="KR"> |
076 | <meta name="subject" content="<?php echo $meta_subject // 페이지 주재 ?>" /> |
077 | <meta name="title" content="<?php echo $meta_title // 페이지 재목 ?>" /> |
078 | <meta name="copyright" content="<?php echo $meta_copyright // 저작권 ?>" /> |
079 | <meta name="author" content="<?php echo $meta_author // 작성자 ?>"> |
080 | <meta name="keywords" content="<?php echo $meta_keywords // 페이지 키워드 ?>" /> |
081 | <meta name="description" content="<?php echo $meta_description // 페이지 요약설명 ?>" /> |
082 | <meta name="distribution" content="<?php echo $meta_distribution // 배포자 ?>" /> |
083 | <meta name="publisher" content="<?php echo $capy_rghter // 페이지의 공급자 ?>" /> |
084 | <meta name="robots" content="index,follow" /> |
085 | <link rel="canonical" href="<?php echo $meta_canonical ?>"> |
088 | if($is_meta_author_data) { |
089 | echo "<meta name='author-date(date)' content='$is_meta_author_data'/>"; |
094 | <meta name="twitter:card" content="summary"> |
095 | <meta name="twitter:title" content="<?php echo $meta_title // 페이지 재목 ?>"> |
096 | <meta name="twitter:site" content="<?php echo $site_name // 사이트 이름 ?>"> |
097 | <meta name="twitter:creator" content="<?php echo $meta_author // 작성자 ?>"> |
098 | <meta name="twitter:image" content="<?php echo $sns_icon_img // 섬네일 이미지 ?>"> |
099 | <meta name="twitter:description" content="<?php echo $meta_title // 페이지 재목 ?>"> |
102 | <meta property="og:title" content="<?php echo $meta_title // 페이지 재목 ?>"/> |
103 | <meta property="og:type" content="website"/> |
104 | <meta property="og:site_name" content="<?php echo $site_name // 사이트 이름 ?>"/> |
105 | <meta property="fb:app_id" content="<?php echo $facebook_appid // 페이스북 앱 아이디 ?>"/> |
106 | <meta property="og:image" content="<?php echo $sns_icon_img // 섬네일 이미지 ?>"/> |
107 | <meta property="og:url" content="<?php echo $meta_canonical // 페이지 주소 ?>"/> |
108 | <meta property="og:description" content="<?php echo $meta_title // 페이지 재목 ?>"/> |
111 | <meta property="me2:post_body" content="<?php echo $meta_title // 페이지 재목 ?>"/> |
112 | <meta property="me2:post_tag" content="<?php echo $metoday_tags.",".$meta_canonical ?>"/> |
113 | <meta property="me2:image" content="<?php echo $sns_icon_img // 섬네일 이미지 ?>"/> |
116 | <meta itemprop="name" content="<?php echo $meta_title // 페이지 재목 ?>"> |
117 | <meta itemprop="description" content="<?php echo $meta_description // 페이지 요약설명 ?>"> |
118 | <meta itemprop="image" content="<?php echo $sns_icon_img // 섬네일 이미지 ?>"> |
출처: https://sir.kr/g5_tip/1471
네이버 웹마스터도구 메타태그 참고용
01 | <meta name="robots" content="ALL"/> |
02 | <meta name="title" content="사이트제목"/> |
03 | <meta name="keywords" content="사이트키워드"/> |
04 | <meta name="description" content="사이트설명문"/> |
05 | <meta name="author" content="사이트주소"/> |
06 | <meta name="NaverBot" content="All"/> |
07 | <meta name="NaverBot" content="index,follow"/> |
08 | <meta name="Yeti" content="All"/> |
09 | <meta name="Yeti" content="index,follow"/> |
10 | <meta property="og:type" content="website"/> |
11 | <meta property="og:title" content="사이트제목과 동일"/> |
12 | <meta property="og:description" content="사이트설명문과 동일"/> |
13 | <meta property="og:image" content="링크 공유했을때 표시되는 이미지 경로"/> |
14 | <meta property="og:url" content="사이트주소"/> |
15 | <meta property="og:site_name" content="사이트제목과 동일"/> |
16 | <meta name="viewport" content="width=device-width"> |
네이버로 검색등록 하실때 메타태그 입니다.
모르시는 분들도 많으시기 때문에 적어봅니다.
