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

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

질문답변

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

그룹 최신글에서

페이지 정보

본문

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건 1 페이지
  • RSS
질문답변 목록
번호 제목 글쓴이 조회 추천 날짜
1640 eodnhan87쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9 0 06-20
1639 860707ff쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3 0 05-28
1638
겔제에러 댓글1
산드리쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4 0 03-26
1637 에구치쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4 0 02-25
1636 에구치쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2 0 02-25
1635 레몬에이드쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3 0 01-17
1634 푸른하늘이다쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7 0 06-20
1633 HANPURE쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 2 0 03-27
1632 핫플레이쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 9 0 05-12
1631 휴먼쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 4 0 06-26
1630 삿갓맨쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6 0 05-26
1629 살람쥐쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3 0 05-13
1628 휴먼쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 20 0 05-11
1627 카오스쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6 0 04-26
1626 카오스쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 19429 0 04-20
1625 휴먼쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 8 0 04-17
1624 레몬에이드쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 7 0 11-23
1623 승희아빠쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4 0 10-06
1622 승희아빠쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4 0 10-06
1621 신디쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 5 0 07-22
1620 휴먼쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 3 0 06-27
1619 레몬에이드쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 17 0 06-08
1618 크림씨앤엠쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 3 0 06-05
1617 레몬에이드쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 4 0 06-01
1616 용맨쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 6991 0 05-08

검색

회원로그인

회원가입

사이트 정보

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

접속자집계

오늘
3,033
어제
5,081
최대
7,259
전체
1,282,198
Copyright (c) 株式会社YHPLUS. All rights reserved.