마

게시판별 글쓰기, 추천 많은 회원 알아보기

· 2003-07-04 (금) 11:40:11 · 2313
조만간 분석을 강좌란에 올리도록 하겠습니다.
<?
include "lib.inc.php";
function mb_contest($bn){
global $cfg;
$table=$cfg[write_table_prefix].$bn;
$query=mysql_query("select distinct mb_id from $table where wr_comment = '0' order by mb_id");

echo "<table width=800 border=0 cellspacing=0 cellpadding=0>";
echo "<tr><td colspan=2 height=50>   안내 입니다. 회원님께서 작성하신 모든글의 조회수, 쪽글수<br> 추천수, 비추천수를 합산한 내역입니다</td></tr>";

for($j=0;$row=mysql_fetch_array($query);$j++){

echo "<tr>";
$qry2=mysql_query("select * from $table where mb_id='$row[mb_id]' and wr_comment = '0'");
$hit="";
$cnt="";
$good="";
$nogood="";
for($i=0;$row2=mysql_fetch_array($qry2);$i++){
$hit=$hit+$row2[wr_hit];
$cnt=$cnt+$row2[wr_commentcnt];
$good=$good+$row2[wr_good];
$nogood=$nogood+$row2[wr_nogood];
$name=$row2[wr_name];
}
if($row[mb_id]=="") $name="손님";
$total_point=($hit+($cnt*2)+($good*2))-$nogood;
echo "<td width=120> $name $row[mb_id]</td>";
echo "<td> 조회 : $hit, 쪽글 : $cnt, 추천 : $good, 비추 : $nogood, 총합 : $total_point </td>";
echo "</tr>";
}

echo "</table>";
}


?>
<?
if(!$p_table) alert("게시판을 지정하여 주십시요"); // 임의로 지정하거나 혹은 값을 넘겨받는 방식중 택일
echo mb_contest("$p_table");?>
|
댓글을 작성하시려면 로그인이 필요합니다.
+
제목 글쓴이 날짜 조회
배배부른꿀꿀이
03-07-07 조회 2,678
03-07-06 조회 7,366
03-07-04 조회 3,262
배배부른꿀꿀이
03-07-04 조회 1,907
03-07-04 조회 1,861
03-07-04 조회 2,314
03-07-03 조회 2,344
03-07-03 조회 2,321
03-07-03 조회 1,830
03-07-03 조회 2,414
03-07-03 조회 3,040
03-07-03 조회 1,806
03-07-02 조회 1,943
03-07-02 조회 1,850
03-07-02 조회 1,936
03-07-01 조회 2,315
03-07-01 조회 2,706
03-06-30 조회 4,252
03-06-30 조회 1,794
MMando
03-06-30 조회 3,577