그룹 최신글에서 > 질문답변

본문 바로가기
사이트 내 전체검색

질문답변

서버정보나 계정정보는 보안유지를 위해 관리자쪽지나 메일로 발송해 주시거나 제작의뢰 게시판을 이용해 주시면 감사하겠습니다..

그룹 최신글에서

페이지 정보

본문

http://zeronara.net/bbs/board.php?bo_table=z2_3&wr_id=717&sca=%C3%D6%BD%C5%B1%DB&page=1

히트순말고 실시간으로 댓글 많은글 순으로 정렬할려면 어떻게 해야하는지요?
추천0

댓글목록

profile_image

포인트님의 댓글

포인트쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

wr_comment로 바꾸도 안되던데요?

profile_image

포인트님의 댓글

포인트쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

소스가 이렇습니다


<? ob_start(); ?>
<?
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_1 = 1 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;
}
?>

profile_image

포인트님의 댓글

포인트쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

아기곰님 올려주세요..[email protected]
근데 위에꺼랑 같이사용(2개이상)같이사용하면 충돌되나요?

profile_image

포인트님의 댓글의 댓글

포인트쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

자게란에 관련글 올렸습니다^^

Total 1,640건 32 페이지
  • RSS
질문답변 목록
번호 제목 글쓴이 조회 추천 날짜
865 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9097 0 11-17
864 디란도쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9102 0 11-05
863 명예쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9111 0 03-04
862 귀여운현호쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9116 0 02-26
861 프라하쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9118 0 06-06
860 하이에나쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9124 0 03-27
859 사랑노래쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9127 0 07-04
858 Gmasta쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9131 0 01-03
857 쿠하하쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9140 0 11-03
856 디란도쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9143 0 10-26
855 휴먼쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9145 0 02-20
854 후니쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9156 0 04-10
853 용맨쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9158 1 01-21
852 webpark쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9160 0 10-31
851 이제다시쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9165 0 05-11
850 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9178 0 09-08
849 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9185 0 07-02
848 휴먼쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9185 0 08-01
847 프리쏘울쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9194 0 06-22
846 와룡이쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9195 0 05-11
845 초돌이쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9198 0 12-30
844 알라쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9199 0 03-05
843 쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9209 0 12-17
842 진진쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9211 0 12-14
841 nm클럽2쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9211 0 02-28

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
2,857
어제
7,473
최대
8,371
전체
1,673,650
Copyright (c) 株式会社YHPLUS. All rights reserved.