안녕하세요..
신문사 페이지를 운영하다 보니..
필요에의해 만들었습니다..
- 추출방법 -
izen_group('스킨', '그룹명', 정렬필드, 출력갯수, 자를 문자열, 최근 몇일간을 출력할 것인가?);
예) echo izen_group('gr_best_news', 'news', wr_hit, 10, 28, 30);
참고한 게시물
- izen님의 지정 기간제 히트순 최근 게시물 -
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8790
신문사 페이지를 운영하다 보니..
필요에의해 만들었습니다..
- 추출방법 -
izen_group('스킨', '그룹명', 정렬필드, 출력갯수, 자를 문자열, 최근 몇일간을 출력할 것인가?);
예) echo izen_group('gr_best_news', 'news', wr_hit, 10, 28, 30);
참고한 게시물
- izen님의 지정 기간제 히트순 최근 게시물 -
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8790
댓글을 작성하시려면 로그인이 필요합니다.
댓글 96개
그런데 추출방법이 상당히 어렵네요...쩝~~
감사합니다.
요긴하게 쓰겠습니다.
잘쓰겠습니다.
디렉토리에 파일은 다 넣었는데 그담부터 어케해야 되어용?
스킨 디렉토리입니까?
어떻게 설치하는 건지 자세히 부탁드립니다.
그 파일은 gnu/extend/ 이곳에 올려서 쓰세요^^
추출 이외의 다른 게시판에서도 나오는데, 어떻게 고쳐야 하나요?
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/songpagu/www/bbs/extend/izen_hit.lib.php:108) in /home/hosting_users/songpagu/www/bbs/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/songpagu/www/bbs/extend/izen_hit.lib.php:108) in /home/hosting_users/songpagu/www/bbs/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/songpagu/www/bbs/extend/izen_hit.lib.php:108) in /home/hosting_users/songpagu/www/bbs/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/songpagu/www/bbs/extend/izen_hit.lib.php:108) in /home/hosting_users/songpagu/www/bbs/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/songpagu/www/bbs/extend/izen_hit.lib.php:108) in /home/hosting_users/songpagu/www/bbs/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/songpagu/www/bbs/extend/izen_hit.lib.php:108) in /home/hosting_users/songpagu/www/bbs/head.sub.php on line 38
Warning: Cannot modify header information - headers already sent by (output started at /home/sayboom/public_html/extend/izen_hit.lib.php:109) in /home/sayboom/public_html/head.sub.php on line 32
Warning: Cannot modify header information - headers already sent by (output started at /home/sayboom/public_html/extend/izen_hit.lib.php:109) in /home/sayboom/public_html/head.sub.php on line 34
Warning: Cannot modify header information - headers already sent by (output started at /home/sayboom/public_html/extend/izen_hit.lib.php:109) in /home/sayboom/public_html/head.sub.php on line 35
Warning: Cannot modify header information - headers already sent by (output started at /home/sayboom/public_html/extend/izen_hit.lib.php:109) in /home/sayboom/public_html/head.sub.php on line 36
Warning: Cannot modify header information - headers already sent by (output started at /home/sayboom/public_html/extend/izen_hit.lib.php:109) in /home/sayboom/public_html/head.sub.php on line 37
Warning: Cannot modify header information - headers already sent by (output started at /home/sayboom/public_html/extend/izen_hit.lib.php:109) in /home/sayboom/public_html/head.sub.php on line 38
도와주세요..머가 문제인지.ㅡㅡ
izen_hit.lib.php:109 이줄을 보시면...빈칸을 없애주세요..^^
아주 간단한 방법이었습니다.ㅋㅋ 다덜 수고용~~잘됩니다.
이렇게 앞뒤를 선언해줘야 된다는 ㅜ.ㅜ
한참을 찾았네요^^ 좋은자료 감사합니다.
혹시 하시는 분... 알려주시면 고맙겠습니다.
}
$list = array_slice($list, 0, $rows);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content; } ?> <----이 부분이 문서의 '맨 마지막 줄'이 되어야 함.
휴, 헤매다가 해결했네요. 즉 위에서 말씀드린 줄이 문서의 가장 마지막 줄이 되어야 한다는 말이었던 것 같습니다. 다시 말하면 마우스로 그 다음 줄을 클릭해서 클릭이 되면 그 공백 줄을 없애주시라는 말씀이죠. 만약에 이거 다음에 공백이 있으면 지워[한 칸을 올려] 주세요.
<?
if (!defined('_GNUBOARD_')) exit;
/*
izen.group.lib.php
제작일 : 2006-12-08
지정 기간제 히트순 최근 게시물 수정본
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/7328
그룹 최신글 관련하여 통합하도록 하였다.
정렬 필드값에 의해서 SQL 문을 추가하도록 하면 된다.
izen_group('스킨', '그룹명', 정렬필드, 출력갯수, 자를 문자열, 최근 몇일간을 출력할 것인가?);
예) echo izen_group('gr_best_news', 'news', wr_hit, 10, 28, 30);
*/
# 인기글
function izen_usort1($a, $b)
{
return $b['wr_hit'] - $a['wr_hit'];
}
# 헤드라인
function izen_usort2($a, $b)
{
return $b['wr_good'] - $a['wr_good'];
}
# 최신글 추출
function izen_group($skin_dir="", $gr_id, $izen_sort, $rows=10, $subject_len=40, $listdate)
{
global $g4;
$nowYmd = date(Ymd); # 시작시간을 구합니다.
$time = time();
$startYmd = date("Ymd",strtotime("-".$listdate." day", $time));
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 bo_table from {$g4['board_table']} where gr_id='$gr_id' and bo_use_search='1' order by bo_order_search ";
$ress = sql_query($sql);
for($i=0, $ii=0; $board=sql_fetch_array($ress); $ii++)
{
$tmp_write_table = $g4['write_prefix'] . $board['bo_table']; # 게시판 테이블 전체이름
#$sql = "select * from `$tmp_write_table` where wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' order by $sort desc limit 0, $rows ";
# 정렬 필드에 의해서 전체적으로 정렬, 관리한다.
if ($izen_sort == 'wr_hit')
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_scrap')
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_scrap <> 0 order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_datetime') # wr_1 헤드라인
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_datetime <> 0 order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_good') #
{
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_good <> '0' order by $izen_sort desc limit 0, $rows ";
}
elseif ($izen_sort == 'wr_id')
{
$sql_gr_Q = " wr_is_comment <> '1' order by $izen_sort desc limit 0, $rows ";
}
$sql = " select * from `$tmp_write_table` where $sql_gr_Q ";
$result = sql_query($sql);
#for (; $row=sql_fetch_array($result); $i++) # *오류* 전체 게시물 가운데 날짜에 상관없이 히트순으로 지정한 갯수만큼 출력된다.
for ($i==0; $row=sql_fetch_array($result); $i++)
{
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len, $listdate);
}
}
if ($izen_sort == 'wr_hit')
{
usort($list, 'izen_usort1');
}
elseif ($izen_sort == 'wr_good')
{
usort($list, 'izen_usort2');
}
$list= array_slice($list, 0, $rows);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();
return $content;
}
?>
여러게 그룹에서 뽑아 낼려면 어떻게 해야하나요?
index파일에
<? echo izen_group('izen_group_new', 'sonamu',wr_hit, 10, 28, 30); ?>
이렇게 넣으니까 안되거든요. izen_group()이 없다고 나오는데, 어떻게 해야 할까요?
Fatal error: Call to undefined function: izen_group()
FTP상의 gnuboard4/extends에 올리세요!!
2007년도 글이네요 ㅎㅎ
혹시라도 나중에 저처럼 헤메는 분 계실까 글 남깁니다.
감사합니다.
요긴하게 쓰겠습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=8790 에서 올리셨던,
extens/izen.group.lib.php를 삭제하시고,
izen_hit.lib.php만 남기셔야 합니다.
최근게시물의 소속 게시판 이름을 출력하려면 어떤 변수를 써야 하나요?
하라는대로 햇는데.. 안되네요.....제발 가르쳐주세요~ ^^;
<? echo izen_group('gr_best_news', 'news', wr_hit, 10, 28, 30); ?>
izen_group가 없다고 나오는데요..
링크가 {$list[$i]['href']} 이렇게 되있어서 내용말구 리스트로 가구 싶어서
<a href='{$g4['bbs_path']}/board.php?bo_table={$list[$i]['bo_table']}
라고 해줘도 테이블 명을 불러 드리지 못하네용... 이유가 무엇일까요 ....
헬푸미 ㅜㅜ
감사합니다 *-_-*