3.0버전 전체회원 포인트조회 입니다. > 그누3 팁자료실

그누3 팁자료실

3.0버전 전체회원 포인트조회 입니다. 정보

그누호환 3.0버전 전체회원 포인트조회 입니다.

본문

이름은 원하시는 대로 저장하세요.....
ex] point.php
업로드할 곳은
bbs/point.php로 저장하세요.....
그리고 3.0에서부터는 불러오는 방식이 달라졌죠.....*^^*
head.php에
아래처럼 입력하세요...
/*********************************************************************
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 공백 -->
 &nbsp; &nbsp; &nbsp; &nbsp;<table width=100% height=5><tr><td></td></tr></table>
<a href='<?="./?doc=$cfg[bbs_dir]/point.php"?>'>전체회원포인트조회</a>
*********************************************************************/

/************************************************
* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 포인트 소스입니다... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *
************************************************/

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

header_cache();

$subject = "POINT 순위";

$html_title = "예수안의 세상 POINT 순위";
$res_count = mysql_num_rows(mysql_query("select * from $cfg[table_member]")); // 총 데이터 수
?>

<p>
<table width='100%'>
<tr><td height=3 bgcolor=DADADA colspan=2></td></tr>
<tr>
<td height=30><b>전체회원 총 <?=$res_count?> 명 포인트 순위</b></td>
<td height=30>
<table width=100% cellpadding=3 cellspacing=1>
<form name=fsearch method=get action='./' autocomplete='off'>
<input type=hidden name=doc value='<?=$doc?>'>
<tr>
<td align=left><? echo $listall ?></td>
<td align=right>
<select name=sselect class=cssselect>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<option value='mb_name'>이름</option>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<option value='mb_point'>포인트</option>
</select>
<input type=text name=stext class=input required itemname='검색어' value='<? echo $stext ?>'>
<input type=submit value='검색' class=cssbutton></td>
</tr>
</form>
</table>
</td>
</tr>
<tr><td height=1 bgcolor=DADADA colspan=2></td></tr>
</table>

<br>

<table width=99% align=center>
<tr><td valign=top style='line-height:150%;'>
<?
$sql_common = " from $cfg[table_member] ";

$sql_search = " where (1) ";
if ($stext) {
 &nbsp; &nbsp;$sql_search .= " and ( ";
 &nbsp; &nbsp;switch ($sselect) {
 &nbsp; &nbsp; &nbsp; &nbsp;case "mb_level" :
 &nbsp; &nbsp; &nbsp; &nbsp;case "mb_point" :
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql_search .= " ($sselect >= '$stext') ";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;
 &nbsp; &nbsp; &nbsp; &nbsp;default :
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql_search .= " ($sselect like '%$stext%') ";
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;
 &nbsp; &nbsp;}
 &nbsp; &nbsp;$sql_search .= " ) ";
}

if (!$ssort) {
 &nbsp; &nbsp;$ssort &nbsp;= "mb_datetime";
 &nbsp; &nbsp;$sorder = "desc";
}
$sql_order = " order by $ssort $sorder ";

$sql = " select count(*)
 &nbsp; &nbsp; &nbsp; &nbsp; $sql_common
 &nbsp; &nbsp; &nbsp; &nbsp; $sql_search
 &nbsp; &nbsp; &nbsp; &nbsp; $sql_order ";
$row = sql_fetch($sql);
$total_count = $row[0];

$rows = 40;
$total_page &nbsp;= ceil($total_count / $rows); &nbsp;// 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함

$mod = 10;

$sql = " select *
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sql_common
&nbsp;$sql_search
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;order by mb_point desc
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;limit $from_record, $rows ";
$result = sql_query($sql);

$qstr = "sselect=$sselect&stext=$stext";

for ($i=0; $row=mysql_fetch_array($result); $i++) {
 &nbsp; &nbsp;if ($i && $i%$mod==0) {
 &nbsp; &nbsp; &nbsp; &nbsp;echo "</td><td valign=top style='line-height:150%;'>";
 &nbsp; &nbsp;}

 &nbsp; &nbsp;$name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], "bbs");
 &nbsp; &nbsp;$point = number_format($row[mb_point]);
 &nbsp; &nbsp;$level = $row[mb_level];
echo "<table width=85% align=center><tr>";
 &nbsp; &nbsp;echo "<td height=20><font color=777777>".((($page-1)*$rows)+$i+1).".</font> $name</td>";
 &nbsp; &nbsp;echo "<td align=right><font color=777777>{$point}점</font></td>";
 &nbsp; &nbsp;echo "</tr></table>";
}
?>
<!-- 53번째 줄인 <font color=777777>".((($page-1)*$rows)+$i+1).".</font>을 /* &nbsp;*/ 처리 하시면 현재 그누보드포인트조회처럼 표현 됩니다. 즉 숫자(순위)표시가 안됩니다. -->
</td></tr>
</table>

<?
$pagelist = get_paging($default[de_write_pages], $page, $total_page, $rows, "./?doc=$doc&$qstr&page=");
if ($pagelist) {
 &nbsp; &nbsp;echo "<table width=100% cellpadding=3 cellspacing=1 height=1 bgcolor=DADADA><tr><td align=center></td></tr></table>\n";
 &nbsp; &nbsp;echo "<table width=100% cellpadding=3 cellspacing=1 height=7><tr><td align=center></td></tr></table>\n";
 &nbsp; &nbsp;echo "<table width=100% cellpadding=3 cellspacing=1><tr><td align=center>$pagelist</td></tr></table>\n";
}

if ($stext) {
 &nbsp; &nbsp;echo "<script language='javascript'>document.fsearch.sselect.value = '$sselect';</script>\n";
}
?>

<script language='javascript'>
 &nbsp; &nbsp;document.fsearch.stext.focus();
</script>
추천
0
  • 복사

댓글 전체

$rows = 40;<====요넘이 뽑을 회원  명수를 결정하죠
$mod = 10; <==== 요넘이 회원명단이 10개가 출력을 아래의 소스로 제한합니다....

  if ($i && $i%$mod==0) {
      echo "</td><td valign=top style='line-height:150%;'>";
  }
그 결과 정렬이 됩죠.........10개씩 4줄로.......*^^*
© SIRSOFT
현재 페이지 제일 처음으로