게시글 정렬수정방법 채택완료
리스트에서 별표5개와 0/100점 이 뜨는 부분입니다.
리스트순서를 별점이 높은 순서대로 불러오고 싶은데
adm/board_form.php에 어찌 수정해야되는지요/..?
$use_count = 0;
for ($jj=3; $jj<11; $jj++) {
if($board['bo_'.$jj.'_subj']==''){
continue;
}
$use_count++;
}
$point_parent_id = $list[$i]['wr_id'];
$point_sql = " select sum(wr_2+wr_3+wr_4+wr_5+wr_6+wr_7+wr_8+wr_9+wr_10) sum_point, (select count(*) from $write_table where wr_parent = '$point_parent_id' and wr_is_comment = '1') point_count from $write_table where wr_parent = '$point_parent_id' and wr_is_comment = '1' ";
$point_cmt = sql_fetch($point_sql);
$sum_point = $point_cmt['sum_point']==''? 0 : $point_cmt['sum_point'];
$point_count = $point_cmt['point_count']==''? 0 : $point_cmt['point_count'];
$calc_point = $point_count==0 ? 0 : $sum_point/($point_count*$use_count)/$board['bo_1']*100;
?>
이부분을 어찌 수정해야되는지요..?별점이 높은 순으로 글을 불러오고 싶습니다.
답변 3개
https://sir.kr/main/request/">https://sir.kr/main/request/ 에 10~20만원정 도 면 해결 됩니다
댓글을 작성하려면 로그인이 필요합니다.
저번에도 코멘트 단 것 같은데, 별점을 더해서 저장을 하시고 작업을 해야 합니다.
현재 방식에서는 그냥 간단하게 몇 줄 바꾼다거나 추가한다고 되는 문제가 아닙니다.
공부해서 저장쪽부터 손을 보시거나 제작의뢰 추천드립니다.
댓글을 작성하려면 로그인이 필요합니다.
질문하신 내용에서 순서를 정렬하시려면
</p><p>
</p><p><span style="font-family: Arial, 돋움, Dotum; color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">$point_sql = " select sum(wr_2+wr_3+wr_4+wr_5+wr_6+wr_7+wr_8+wr_9+wr_10) sum_point, (select count(*) from $write_table where wr_parent = '$point_parent_id' and wr_is_comment = '1') point_count from $write_table where wr_parent = '$point_parent_id' and wr_is_comment = '1' </span></p><p><span style="font-family: Arial, 돋움, Dotum; color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">order by sum_point desc </span><span style="background-color: rgb(247, 247, 247); color: rgb(51, 51, 51); font-family: Arial, 돋움, Dotum; font-size: 12px;">"; // 정렬 기준으로 역숙(높은것부터)</span></p><p><span style="font-family: Arial, 돋움, Dotum; color: rgb(51, 51, 51); font-size: 12px; background-color: rgb(247, 247, 247);">$point_cmt = sql_fetch($point_sql); </span> </p><p><font color="#333333" face="Arial, 돋움, Dotum"><span style="font-size: 12px; background-color: rgb(247, 247, 247);">
로 변경하시면 됩니다
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
어디부분에 변경하면 된다는건지용