[member.php]관리자님이 배포하신 현재접속자 코드[수정]

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

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

$mod = 6; // 6명이 출력되면 한줄 아래로 출력
?>

<table width=100% cellpadding=1 cellspacing=1>
&nbsp; &nbsp; &nbsp; <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
&nbsp; &nbsp; &nbsp; <tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
&nbsp; &nbsp; &nbsp; <tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
&nbsp; &nbsp; &nbsp; <tr>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <td>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <table width=100% cellpadding=0 cellspacing=0><tr><td>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?
&nbsp; include "./$cfg[bbs_dir]/gblayer.php";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $guest_count = 0;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; order by a.mb_id desc, a.lo_ip ";
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result = sql_query($sql);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0; $row=mysql_fetch_array($result); $i++) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($row[mb_id]) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
echo "<table width=85% align=left><tr>";
echo "<td height=20><font color=777777>".(($rows)+$i+1).".</font> $tmp_name</td>";
&nbsp; &nbsp;echo "</tr></table>";
&nbsp; &nbsp;if ($i && $i%$mod==0) {
echo "</td></tr><tr><td>";
}
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mysql_free_result($result);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ?>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </table>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </td>
&nbsp; &nbsp; &nbsp; </tr>
&nbsp; &nbsp; &nbsp; </table>


많은 테스트를 해보지 못해서 즉 접속자가 많이 접속을 해야 되는데...
테스트 해보시고 글올려주세요...
|

댓글 10개

22년 전
역시 박갑성님은 부지런하시고 알찬내용을 많이 올려주시는 군요..
많은 도움받고 있습니다............^^
죄송합니다....
열심히 올리렸는데....
그런실수를...
허~~~~님이 저를 성가시게 하는게 아니라 제가 님을 성가시게하고
좋은팁을 올렸는데 올바르게 사용하지 못하는 제가 미안합니다.
해결했습니다.....
올리신 내용중 하나가 빠졌군요...

올리신 팁....
---------------------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

$mod = 6; // 6명이 출력되면 한줄 아래로 출력
?>

<table width=100% cellpadding=1 cellspacing=1>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr>
<td>
<table width=100% cellpadding=0 cellspacing=0><tr><td>
<?
include "./$cfg[bbs_dir]/gblayer.php";
$guest_count = 0;
$sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
order by a.mb_id desc, a.lo_ip ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
if ($row[mb_id]) {
$tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
echo "<table width=85% align=left><tr>";
echo "<td height=20><font color=777777>".(($rows)+$i+1).".</font> $tmp_name</td>";
echo "</tr></table>";
if ($i && $i%$mod==0) {
echo "</td></tr><tr><td>";
}
}
} <--------------------------------------------------------------요거이 빠졌습니다.
mysql_free_result($result);
?>
</table>
</td>
</tr>
</table>
-------------------------------------------------------------------------------------------

무지한 저를 용서하세요....
님의 관심에 몸둘바를 모르겠습니다.
감사합니다.
괜시리 팁을 올려가지구 님을 더욱 성가시게 하고 있는듯하군뇨

echo "<table width=85% align=left><tr>";
echo "<td height=20><font color=777777>".(($rows)+$i+1).".</font> $tmp_name</td>";
echo "</tr></table>";
위의 내용을

echo "<font color=777777>".(($rows)+$i+1).".</font>{$tmp_name} &nbsp;&nbsp;&nbsp;";

이렇게 해보시지요
박갑성님 자꾸 귀찮게 하는군요
님이 올리신 소스를 그대로 적용후 member.php라하고 gnu폴더에 올리고 호출하면...
http://도메인/gnu/?doc=member.php

_DOCTYPE_ 오류 : NONE , STYLE , DESIGN 중 하나를 사용하세요.
Parse error: parse error in /home/도메인/gnu/member.php on line 39

님이 올리신 소스는 요렇게 뜨는군요...
위에 된다구 하는건 세로로 한명씩 주~욱 회원 명단이 나오고 밑에 비회원 **명...이렇게 나옵니다.
어케해야되죠?
어떻게 안되는지 궁금하군요....ㅡ,.ㅜ;;
아마도 sir에서는 아래 처럼 하는시는 듯하군요...

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

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

?>

<table width=100% cellpadding=1 cellspacing=1>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr>
<td>
<table width=100% cellpadding=0 cellspacing=0><tr><td>
<?
include "./$cfg[bbs_dir]/gblayer.php";
$guest_count = 0;
$sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
order by a.mb_id desc, a.lo_ip ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
if ($row[mb_id]) {
$tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
echo "$tmp_name &nbsp;&nbsp;";
}
mysql_free_result($result);
?>
</table>
</td>
</tr>
</table>
안되는 군요....
_DOCTYPE_ 오류 : NONE , STYLE , DESIGN 중 하나를 사용하세요.
얼마전 좌측하단에 나타나던 접속회원표시는 됩니다.
요거는.....

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

define("_DOCTYPE_", "DESIGN");

$html_title = "접속회원";

?>

<table width=100% cellpadding=1 cellspacing=1>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr><td class='subject subjectbg ht arial' align=center>현재 접속자</td></tr>
<tr><td height=1 background='./<?=$cfg[bbs_dir]?>/line.gif'></td></tr>
<tr>
<td>
<table width=100% cellpadding=0 cellspacing=0><tr><td>
<?
include "./$cfg[bbs_dir]/gblayer.php";
$guest_count = 0;
$sql = " select a.mb_id, b.mb_name, b.mb_icon, b.mb_email, b.mb_homepage, b.mb_open, a.lo_ip
from $cfg[table_login] a left join $cfg[table_member] b on (a.mb_id = b.mb_id)
order by a.mb_id desc, a.lo_ip ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
if ($row[mb_id]) {
$tmp_name = gblayer($row[mb_id], cut_str($row[mb_name],12), $row[mb_email], $row[mb_homepage], $row[mb_open]);
echo "<tr><td align=center height=20>$tmp_name</td></tr>";
} else {
$guest_count++;
}
}
mysql_free_result($result);
echo "<tr><td align=center height=20>비회원 {$guest_count}명</td></tr>";
if ($i==0) {
echo "<tr><td align=center>없음</td></tr>";
}
?>

</table>
</td>
</tr>
</table>

그런데 님이 올리신팁을 사용하면 안됩니다.
안된다니요?

사용의 예입니다....

http://www.yesooin.com/?doc=include/memberlist.php
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3 팁자료실

+
제목 글쓴이 날짜 조회
22년 전 조회 2,165
22년 전 조회 2,889
네모똘
22년 전 조회 1,960
22년 전 조회 1,724
22년 전 조회 1,672
22년 전 조회 2,131
아기수리
22년 전 조회 2,065
22년 전 조회 3,472
22년 전 조회 1,906
22년 전 조회 2,567
22년 전 조회 2,313
22년 전 조회 3,271
22년 전 조회 3,141
22년 전 조회 2,178
22년 전 조회 2,047
22년 전 조회 1,938
22년 전 조회 3,432
22년 전 조회 2,120
22년 전 조회 2,611
22년 전 조회 2,456
🐛 버그신고