전체 코멘트 불러오기.. 정보
최근게시물 전체 코멘트 불러오기..관련링크
http://www.rinix.co.kr
363회 연결
http://rinix.co.kr/g4/
298회 연결
첨부파일
본문
압축해제하시면 lib 폴더와 skin 폴더가 있습니다.
lib 폴더에는 fixing.lib.php 와 comment.lib.php 파일 2개가 있으며
skin 폴더에는 newcomment 폴더가 있고 그안에 2개 폴더가 있습니다.
[설치]
압축해제후 그누 폴더에 그대로 업로드 하신후 comment.lib.php 파일을 인클루드 하세요.
include_once("$g4[path]/lib/comment.lib.php ");
fixing.lib.php 파일을 적용하신분은 중간생략하셔도 됩니다.
common.php 파일 350줄 근처로 보시고 아래와 같이 수정하세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 보드 설정값을 불러 저장
include_once("$g4[path]/lib/fixing.lib.php");
if (isset($bo_table)) {
//$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
$num = $g4_board[num][$bo_table];
$board = $g4_board[$num];
if ($board['bo_table']) {
$gr_id = $board['gr_id'];
$write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
if ($wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
}
if (isset($gr_id)){
//$group = sql_fetch(" select * from {$g4['group_table']} where gr_id = '$gr_id' ");
$num = $g4_group[num][$gr_id];
$group = $g4_group[$num];
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
위내용에서 실질적으로는 include_once("$g4[path]/lib/fixing.lib.php"); 만있으면됩니다.
그외 내용은 fixing.lib.php 파일에서 저장한 내용을 디비에서 다시 불러들이는 내용이여서 위와 같이 수정하시면 쿼리를 줄일수 있습니다.
그외 latest.lib.php 파일의 수정은 아래 소스를 붙여 넣기 하세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4, $g4_board;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
//$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
//$board = sql_fetch($sql);
$num = $g4_board[num][$bo_table];
$board = $g4_board[$num];
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
latest.lib.php 파일 또한 수정을 안해도 됩니다.
수정하신경우 다량으로 최신글이 불러지는 페이지에서 불러진최신글의 수만큼 쿼리수가 줄어듭니다.
함수 호출은 head.php 파일 에서 원하시는 위치에서 <?=comment("타이틀", "스킨명", 목록수, 제목길이)?> 를 적어주시면 됩니다.
[기능]
1. 전체 최신 코멘트 보기
2. 비밀글 작성자나 최고관리자만 보여짐.
lib 폴더에는 fixing.lib.php 와 comment.lib.php 파일 2개가 있으며
skin 폴더에는 newcomment 폴더가 있고 그안에 2개 폴더가 있습니다.
[설치]
압축해제후 그누 폴더에 그대로 업로드 하신후 comment.lib.php 파일을 인클루드 하세요.
include_once("$g4[path]/lib/comment.lib.php ");
fixing.lib.php 파일을 적용하신분은 중간생략하셔도 됩니다.
common.php 파일 350줄 근처로 보시고 아래와 같이 수정하세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 보드 설정값을 불러 저장
include_once("$g4[path]/lib/fixing.lib.php");
if (isset($bo_table)) {
//$board = sql_fetch(" select * from {$g4['board_table']} where bo_table = '$bo_table' ");
$num = $g4_board[num][$bo_table];
$board = $g4_board[$num];
if ($board['bo_table']) {
$gr_id = $board['gr_id'];
$write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$comment_table = $g4['write_prefix'] . $bo_table . $g4['comment_suffix']; // 코멘트 테이블 전체이름
if ($wr_id)
$write = sql_fetch(" select * from $write_table where wr_id = '$wr_id' ");
}
}
if (isset($gr_id)){
//$group = sql_fetch(" select * from {$g4['group_table']} where gr_id = '$gr_id' ");
$num = $g4_group[num][$gr_id];
$group = $g4_group[$num];
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
위내용에서 실질적으로는 include_once("$g4[path]/lib/fixing.lib.php"); 만있으면됩니다.
그외 내용은 fixing.lib.php 파일에서 저장한 내용을 디비에서 다시 불러들이는 내용이여서 위와 같이 수정하시면 쿼리를 줄일수 있습니다.
그외 latest.lib.php 파일의 수정은 아래 소스를 붙여 넣기 하세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<?
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4, $g4_board;
if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";
$list = array();
//$sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
//$board = sql_fetch($sql);
$num = $g4_board[num][$bo_table];
$board = $g4_board[$num];
$tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
latest.lib.php 파일 또한 수정을 안해도 됩니다.
수정하신경우 다량으로 최신글이 불러지는 페이지에서 불러진최신글의 수만큼 쿼리수가 줄어듭니다.
함수 호출은 head.php 파일 에서 원하시는 위치에서 <?=comment("타이틀", "스킨명", 목록수, 제목길이)?> 를 적어주시면 됩니다.
[기능]
1. 전체 최신 코멘트 보기
2. 비밀글 작성자나 최고관리자만 보여짐.
추천
11
11
댓글 전체
드디어 원하는 전체 코멘트 불러오기가 올라왔군요....
감사합니다!!!!
감사합니다!!!!
감사합니다!!!!
오호랏!!
이거이거~ 대박 기다렸습니다.
넘 감사합니다. 쵝오잖아욧!!! ^^
넘 감사합니다. 쵝오잖아욧!!! ^^
숙하셨습니다.
잘 사용하겠습니다. 감사합니다
include_once("$g4[path]/lib/comment.lib.php ");
include를 어디에 해야하는지요 head.php 에 했는데 아래와같은 오류가...
쪼끔만 도와주세요 ^^;
Warning: main(./lib/comment.lib.php ): failed to open stream: No such file or directory in /home1/hewego/public_html/board/head_main.php on line 10
Warning: main(): Failed opening './lib/comment.lib.php ' for inclusion (include_path='.:/usr/lib/php/pear') in /home1/hewego/public_html/board/head_main.php on line 10
include를 어디에 해야하는지요 head.php 에 했는데 아래와같은 오류가...
쪼끔만 도와주세요 ^^;
Warning: main(./lib/comment.lib.php ): failed to open stream: No such file or directory in /home1/hewego/public_html/board/head_main.php on line 10
Warning: main(): Failed opening './lib/comment.lib.php ' for inclusion (include_path='.:/usr/lib/php/pear') in /home1/hewego/public_html/board/head_main.php on line 10
newcomment 폴더를 skin 바로 밑에 넣었고..
fixing.lib.php comment.lib.php 파일 그대로 lib 폴더에 덮어쓰기 했고..
common.php 파일 350줄 수정했고..
latest.lib.php 파일의 수정 했고..
head 부분에 불러올거라서 인크루드 head 파일 상단에
include_once("$g4[path]/lib/comment.lib.php "); 하고
<?=comment("타이틀", "스킨명", 목록수, 제목길이)?> 넣어서
<?=comment("test", "basic", 5, 20)?>
했는데.. 왜 안될까요?? ㅠㅠㅠ
fixing.lib.php comment.lib.php 파일 그대로 lib 폴더에 덮어쓰기 했고..
common.php 파일 350줄 수정했고..
latest.lib.php 파일의 수정 했고..
head 부분에 불러올거라서 인크루드 head 파일 상단에
include_once("$g4[path]/lib/comment.lib.php "); 하고
<?=comment("타이틀", "스킨명", 목록수, 제목길이)?> 넣어서
<?=comment("test", "basic", 5, 20)?>
했는데.. 왜 안될까요?? ㅠㅠㅠ
에러문을 적으세요
고맙습니다. :) 잘 쓰겠습니다.
초보라 그런지 설명이 너무어렵다..
..
면상이님
new를붙여주세요
<?=newcomment("제목", "스킨명", 목록수, 제목길이)?>
new를붙여주세요
<?=newcomment("제목", "스킨명", 목록수, 제목길이)?>
혹시라도 위 설정대로 하셨는데 에러 나오는 분들을 위해 조금이나마 도움 되고자 말씀드립니다.
저도 이게 뭥미~? 하면서도 왜 안되나 싶었는데요!!
include_once("$g4[path]/lib/comment.lib.php ");
위 내용에 한부분 입니다. php " 보이시죠? 이 부분은 php" 로 해주시기 바랍니다.ㅡㅡ^
공백 하나에 문제가 생기네여 ~
저도 이게 뭥미~? 하면서도 왜 안되나 싶었는데요!!
include_once("$g4[path]/lib/comment.lib.php ");
위 내용에 한부분 입니다. php " 보이시죠? 이 부분은 php" 로 해주시기 바랍니다.ㅡㅡ^
공백 하나에 문제가 생기네여 ~
설치가 넘어렵네요 ..
이누야샤 님이랑 똑같은 에러가 나오는데요 ,,안되네요 ,,ㅠㅠ
A
적용
이런 이런... 함수 이름이... new로 되어있으니 안대지....ㅋ
이건 무슨 숨은 그림도 아니고... 끼룩끼룩 님 감사~ㅋ
이건 무슨 숨은 그림도 아니고... 끼룩끼룩 님 감사~ㅋ
감사합니다
빌더 사용자는 common.php 파일이 틀려서어디를 수정해야 할지 모르겠네요.!
수정없이
압축파일 푸시고 lib 파일은 그위치에 skin 파일은 그위치에 적용시키시고
불러올곳에
<?
include_once("$g4[path]/lib/comment.lib.php");
include_once("$g4[path]/lib/fixing.lib.php");
echo newcomment("전체댓글", "basic", 15, 20);
?>
이럼되요..~_~
압축파일 푸시고 lib 파일은 그위치에 skin 파일은 그위치에 적용시키시고
불러올곳에
<?
include_once("$g4[path]/lib/comment.lib.php");
include_once("$g4[path]/lib/fixing.lib.php");
echo newcomment("전체댓글", "basic", 15, 20);
?>
이럼되요..~_~
덕분에 잘 설치 했습니다. 정말 감사합니다
필요해는돼
감사합니다.
추천~~~~~~
감사합니다.
추천~~~~~~
감사합니다...
감사합니다