조회수 top, bottom 10 에서 히트수 말고 작성자 출력하고 싶은데.. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

조회수 top, bottom 10 에서 히트수 말고 작성자 출력하고 싶은데.. 정보

조회수 top, bottom 10 에서 히트수 말고 작성자 출력하고 싶은데..

본문

히트수 말고 작성자를 표시 할려면 어떻게 해야 돼나요..?

{$list2[$key][wr_hit]}이거 대신 {$list2[$key][wr_id]}

넣으니깐 이상한 숫자만 표시 되더라구요.

히트수 말고 글 작성자 표시 할려면  wr_name 인가!! 이코드를 추가 해야 되나요?




<?
include_once("./_common.php");

define("_CO_INDEX_", TRUE);

$html_title = "커뮤니티";
$g4[title] = "" . $html_title;
include_once("./_head.php");

$before_day = 1;
$before_time = date("Y-m-d H:i:s", $g4[server_time] - (86400 * $before_day));

$list1 = array();

$top1 = $top2 = 10;
$gr_id = "community";
$sql = " select bo_table, bo_notice from $g4[board_table]
          where gr_id = '$gr_id'
            and bo_use_search = 1 ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result))
{
    $sql2 = " select * from $g4[write_prefix]$row[bo_table]
              where wr_comment > -1
                and wr_datetime >= '$before_time' ";
    $result2 = sql_query($sql2);
    while ($row2 = sql_fetch_array($result2))
    {
        $key = substr('00000'.$row2[wr_comment],-5) . '-' . $row2[wr_id];
        $list1[$key][subject] = conv_subject($row2[wr_subject],40,'…');
        $list1[$key][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
        $list1[$key][bo_table] = $row[bo_table];
        $list1[$key][wr_id] = $row2[wr_id];
        $list1[$key][is_notice] = preg_match("/[^0-9]{0,1}{$row2[wr_id]}[\r]{0,1}/",$row[bo_notice]);
        $list1[$key][comment] = $row2[wr_comment];
        $list1[$key][comment_cnt] = "($row2[wr_comment])";

        $key = substr('00000'.$row2[wr_hit],-5) . '-' . $row2[wr_id];
        $list2[$key][subject] = conv_subject($row2[wr_subject],40,'…');
        $list2[$key][href] = "$g4[bbs_path]/board.php?bo_table=$row[bo_table]&wr_id=$row2[wr_id]";
        $list2[$key][bo_table] = $row[bo_table];
        $list2[$key][wr_id] = $row2[wr_id];
        $list2[$key][is_notice] = preg_match("/[^0-9]{0,1}{$row2[wr_id]}[\r]{0,1}/",$row[bo_notice]);
        $list2[$key][wr_hit] = $row2[wr_hit];
        $list2[$key][hit] = "($row2[wr_hit])";
    }
}
$list3 = $list1;
$list4 = $list2;

krsort($list1);
krsort($list2);

ksort($list3);
ksort($list4);

$latest_skin_path = "$g4[path]/skin/latest/basic";
?>


<table width="710" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="345" valign=top>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="29" height="38"><img src="<?=$latest_skin_path?>/img/board_title_left.gif" width="29" height="38"></td>
            <td background="<?=$latest_skin_path?>/img/board_title_bg.gif">  <font
                style='font-family:돋움; font-size:9pt; color:#696969;'><strong>코멘트 BOTTOM <?=$top1?></strong></font> </td>
            <td width="60" align="right" background="<?=$latest_skin_path?>/img/board_title_bg.gif"></td>
            <td width="19"><img src="<?=$latest_skin_path?>/img/board_title_right.gif" width="19" height="38"></td>
        </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $i=0;
        foreach($list3 as $key=>$value) {
            if ($i++>=($top1-1)) break;
        ?>
        <tr>
            <td width="40" height="35" align="center" valign="middle" background="<?=$latest_skin_path?>/img/board_bg_line.gif"><img src="<?=$latest_skin_path?>/img/board_icon.gif" width="9" height="13"></td>
            <td background="<?=$latest_skin_path?>/img/board_bg_line.gif" style='word-break:break-all;'>
                <?
                echo $list3[$key][icon_reply] . " ";
                echo "<a href='{$list3[$key][href]}'>";
                if ($list3[$key][is_notice])
                    echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list3[$key][subject]}</strong></font>";
                else
                    echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list3[$key][subject]}</font>";
                echo "</a>";

                if ($list3[$key][comment_cnt])
                    echo " <span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list3[$key][comment_cnt]}</span>";
                ?>
            </td>
        </tr>
        <? } ?>

        <? if (count($list3) == 0) { ?>
        <tr><td colspan=2 align=center height=30 background="<?=$latest_skin_path?>/img/board_bg_line.gif">게시물이 없습니다.</td></tr>
        <? } ?>
        </table>
    </td>
    <td width="20"> </td>
    <td width="345" valign=top>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="29" height="38"><img src="<?=$latest_skin_path?>/img/board_title_left.gif" width="29" height="38"></td>
            <td background="<?=$latest_skin_path?>/img/board_title_bg.gif">  <font
                style='font-family:돋움; font-size:9pt; color:#696969;'><strong>조회수 BOTTOM <?=$top1?></strong></font> <span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>(hit)</span> </td>
            <td width="60" align="right" background="<?=$latest_skin_path?>/img/board_title_bg.gif"></td>
            <td width="19"><img src="<?=$latest_skin_path?>/img/board_title_right.gif" width="19" height="38"></td>
        </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $i=0;
        foreach($list4 as $key=>$value) {
            if ($i++>=($top1-1)) break;
        ?>
        <tr>
            <td width="40" height="35" align="center" valign="middle" background="<?=$latest_skin_path?>/img/board_bg_line.gif"><img src="<?=$latest_skin_path?>/img/board_icon.gif" width="9" height="13"></td>
            <td background="<?=$latest_skin_path?>/img/board_bg_line.gif" style='word-break:break-all;'>
                <?
                echo $list4[$key][icon_reply] . " ";
                echo "<a href='{$list4[$key][href]}'>";
                if ($list4[$key][is_notice])
                    echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list4[$key][subject]}</strong></font>";
                else
                    echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list4[$key][subject]}</font>";
                echo "</a>";

                if ($list4[$key][hit])
                    echo " <span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list4[$key][hit]}</span>";
                ?>
            </td>
        </tr>
        <? } ?>

        <? if (count($list4) == 0) { ?>
        <tr><td colspan=2 align=center height=30 background="<?=$latest_skin_path?>/img/board_bg_line.gif">게시물이 없습니다.</td></tr>
        <? } ?>
        </table>
    </td>

</tr></table>
<br><br>


<table width="710" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td width="345" valign=top>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="29" height="38"><img src="<?=$latest_skin_path?>/img/board_title_left.gif" width="29" height="38"></td>
            <td background="<?=$latest_skin_path?>/img/board_title_bg.gif">  <font
                style='font-family:돋움; font-size:9pt; color:#696969;'><strong>코멘트 TOP <?=$top1?></strong></font> </td>
            <td width="60" align="right" background="<?=$latest_skin_path?>/img/board_title_bg.gif"></td>
            <td width="19"><img src="<?=$latest_skin_path?>/img/board_title_right.gif" width="19" height="38"></td>
        </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $i=0;
        foreach($list1 as $key=>$value) {
            if ($i++>=($top1-1)) break;
        ?>
        <tr>
            <td width="40" height="35" align="center" valign="middle" background="<?=$latest_skin_path?>/img/board_bg_line.gif"><img src="<?=$latest_skin_path?>/img/board_icon.gif" width="9" height="13"></td>
            <td background="<?=$latest_skin_path?>/img/board_bg_line.gif" style='word-break:break-all;'>
                <?
                echo $list1[$key][icon_reply] . " ";
                echo "<a href='{$list1[$key][href]}'>";
                if ($list1[$key][is_notice])
                    echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list1[$key][subject]}</strong></font>";
                else
                    echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list1[$key][subject]}</font>";
                echo "</a>";

                if ($list1[$key][comment_cnt])
                    echo " <span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list1[$key][comment_cnt]}</span>";
                ?>
            </td>
        </tr>
        <? } ?>

        <? if (count($list1) == 0) { ?>
        <tr><td colspan=2 align=center height=30 background="<?=$latest_skin_path?>/img/board_bg_line.gif">게시물이 없습니다.</td></tr>
        <? } ?>
        </table>
    </td>
    <td width="20"> </td>
    <td width="345" valign=top>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td width="29" height="38"><img src="<?=$latest_skin_path?>/img/board_title_left.gif" width="29" height="38"></td>
            <td background="<?=$latest_skin_path?>/img/board_title_bg.gif">  <font
                style='font-family:돋움; font-size:9pt; color:#696969;'><strong>조회수 TOP <?=$top1?></strong></font> <span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>(hit)</span> </td>
            <td width="60" align="right" background="<?=$latest_skin_path?>/img/board_title_bg.gif"></td>
            <td width="19"><img src="<?=$latest_skin_path?>/img/board_title_right.gif" width="19" height="38"></td>
        </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <?
        $i=0;
        foreach($list2 as $key=>$value) {
            if ($i++>=($top1-1)) break;
        ?>
        <tr>
            <td width="40" height="35" align="center" valign="middle" background="<?=$latest_skin_path?>/img/board_bg_line.gif"><img src="<?=$latest_skin_path?>/img/board_icon.gif" width="9" height="13"></td>
            <td background="<?=$latest_skin_path?>/img/board_bg_line.gif" style='word-break:break-all;'>
                <?
                echo $list2[$key][icon_reply] . " ";
                echo "<a href='{$list2[$key][href]}'>";
                if ($list2[$key][is_notice])
                    echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list2[$key][subject]}</strong></font>";
                else
                    echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list2[$key][subject]}</font>";
                echo "</a>";

                if ($list2[$key][hit])
                    echo " <span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list2[$key][hit]}</span>";
                ?>
            </td>
        </tr>
        <? } ?>

        <? if (count($list2) == 0) { ?>
        <tr><td colspan=2 align=center height=30 background="<?=$latest_skin_path?>/img/board_bg_line.gif">게시물이 없습니다.</td></tr>
        <? } ?>
        </table>
    </td>

</tr></table>
<br><br>

<?
include_once("./_tail.php");
?>
  • 복사

댓글 전체

{$list2[$key][wr_hit]} => 사용자 조회수
{$list2[$key][wr_id]} => 글작성관리번호
{$list2[$key][mb_id]} => 글작성자ID
{$list2[$key][wr_name]} => 글작성자이름
© SIRSOFT
현재 페이지 제일 처음으로