잘 생각 안나는 부분 있어서 여러분께 질문... 정보
그누보드 잘 생각 안나는 부분 있어서 여러분께 질문...본문
우선 의도를 말씀 드리겠습니다.
이벤트 기간동안 가장 많은 활동을 한 사람을 뽑는데요.
일단 본래의 글, 즉 답변글및 쪽글을 제외한
순수 원본글을 대상으로
조회수, 밑에 달린 쪽글수, 추천수, 비추수를 각기 더하고 빼서
점수를 매기구요.
그 게시물의 해당 아이디에 그 점수가 적립되어야 하는데요.
디비를 쓰지 않고 하려니 좀 답답하네요.
즉 아이디를 기준으로 프로그램을 돌리는디, 똑같은 아이디로 글쓴것
즉, 여러개의 글의 점수를 합산해야되거든요...
방법이 없을까요. 머리속에서 될듯될듯 떠오를듯 말듯..왔다갔다 하는게...
어제 오늘 머리속이 온통 멍한 기분이네요..
바보가 되어 가는건가...ㅡㅡ;;
<?
include "lib.inc.php";
function mb_contest($bn){
global $cfg;
$table=$cfg[write_table_prefix].$bn;
$query=mysql_query("select mb_id from $table where wr_comment = '0'");
echo "<table width=800 border=0 cellspacing=0 cellpadding=0>";
for($j=0;$row=mysql_fetch_array($query);$j++){
if($row[mb_id]){
$member=get_member($row[mb_id]);
echo "<tr>";
$qry2=mysql_query("select * from $table where wr_name='$member[mb_name]' and wr_comment = '0'");
$row2=mysql_fetch_array($qry2);
$hit=$row2[wr_hit];
$cnt=$row2[wr_commentcnt];
$good=$row2[wr_good];
$nogood=$row2[wr_nogood];
$total_point=(($cnt*2)+($good*2))-$nogood;
echo "<td width=100> $member[mb_name] $member[mb_id]</td>";
echo "<td> 총조회수 : $hit, 총쪽글수 : $cnt, 총추천수 : $good, 총비추수 : $nogood, 총합점수 : $total_point </td>";
echo "</tr>";
}
}
echo "</table>";
}
?>
<? echo mb_contest("freetalk");?>
정 안되면...디비쓰는쪽으로 바꿔봐야조.ㅡㅡ;;
이벤트 기간동안 가장 많은 활동을 한 사람을 뽑는데요.
일단 본래의 글, 즉 답변글및 쪽글을 제외한
순수 원본글을 대상으로
조회수, 밑에 달린 쪽글수, 추천수, 비추수를 각기 더하고 빼서
점수를 매기구요.
그 게시물의 해당 아이디에 그 점수가 적립되어야 하는데요.
디비를 쓰지 않고 하려니 좀 답답하네요.
즉 아이디를 기준으로 프로그램을 돌리는디, 똑같은 아이디로 글쓴것
즉, 여러개의 글의 점수를 합산해야되거든요...
방법이 없을까요. 머리속에서 될듯될듯 떠오를듯 말듯..왔다갔다 하는게...
어제 오늘 머리속이 온통 멍한 기분이네요..
바보가 되어 가는건가...ㅡㅡ;;
<?
include "lib.inc.php";
function mb_contest($bn){
global $cfg;
$table=$cfg[write_table_prefix].$bn;
$query=mysql_query("select mb_id from $table where wr_comment = '0'");
echo "<table width=800 border=0 cellspacing=0 cellpadding=0>";
for($j=0;$row=mysql_fetch_array($query);$j++){
if($row[mb_id]){
$member=get_member($row[mb_id]);
echo "<tr>";
$qry2=mysql_query("select * from $table where wr_name='$member[mb_name]' and wr_comment = '0'");
$row2=mysql_fetch_array($qry2);
$hit=$row2[wr_hit];
$cnt=$row2[wr_commentcnt];
$good=$row2[wr_good];
$nogood=$row2[wr_nogood];
$total_point=(($cnt*2)+($good*2))-$nogood;
echo "<td width=100> $member[mb_name] $member[mb_id]</td>";
echo "<td> 총조회수 : $hit, 총쪽글수 : $cnt, 총추천수 : $good, 총비추수 : $nogood, 총합점수 : $total_point </td>";
echo "</tr>";
}
}
echo "</table>";
}
?>
<? echo mb_contest("freetalk");?>
정 안되면...디비쓰는쪽으로 바꿔봐야조.ㅡㅡ;;
댓글 전체
글올린지 얼마 안되 해결해 부럿네요^^
간단한것을 왜 꼭 생각날듯 말듯 하고 그러냔 말이지.ㅋㅋ
아무튼 조만간 강좌에서 팁으로 올리겠씁니다^^
간단한것을 왜 꼭 생각날듯 말듯 하고 그러냔 말이지.ㅋㅋ
아무튼 조만간 강좌에서 팁으로 올리겠씁니다^^