내가 작성한 최근글 보여주기
내가 작성한 최신글을 보여주는 방법입니다.
css 디자인은 따로 해야하지만,
제 홈페이지 상단에 있는 형태로 출력이 됩니다.
http://www.3dmshop.com 상단에 "로그인" 부분을 누르면 보입니다.
아래가 소스부분입니다.
출력되는 개수는 $new_count = 7; 이 부분을 수정하면 됩니다.
( 그누보드4의 스킨 내용 중에 있는 부분을 수정했습니다. 어떤 분 것인지는 기억이 나지 않아서요. 죄송합니다. )
<div style="width:100%; font-size:1em; padding:10px 0px 0px 0px; text-align:center; height:24px; border-top:1px solid #ddd; border-bottom:1px solid #ddd;"><b>내가 작성한 최근글</b></div>
<div style="margin-top:4px; border:1px solid #ddd; padding:7px; background:#fff;">
<?php // 나의 최신게시물
if ($member[mb_id])
{
$new_count = 7;
$cnt = 0;
$sql = " select bo_table, wr_parent from $g5[board_new_table] a
where mb_id = '$member[mb_id]'
-- and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
$res = sql_query($sql);
echo "<table width=169 border=0 cellspacing=0 cellpadding=0>";
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g5[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subj = cut_str(get_text($row2[wr_subject]), 15);
$comment = "";
if ($row2[wr_comment])
$comment = "<span class=new>* $row2[wr_comment]</span>";
echo "<td height='25' style='letter-spacing: -1px;'>";
echo "<nobr>";
echo "<a href='/bbs/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>$subj $comment </a>";
echo "</nobr></td></tr>";
$cnt++; } if (!$cnt) echo "<tr><td colspan='2' height='100px' align='center'>게시글이 없습니다.<br>
<font color='#EF2B5A'><b>글 좀 남겨주세요 (^_^)</b></font></td></tr>";
echo "</table>";
} else {
echo "<table width=169 border=0 cellspacing=0 cellpadding=0>";
echo "<tr><td colspan='2' height='100px' align='center'><font color='#979797'>로그인해 주세요.</font></td></tr>";
echo "</table>";
}
?>
</div>
css 디자인은 따로 해야하지만,
제 홈페이지 상단에 있는 형태로 출력이 됩니다.
http://www.3dmshop.com 상단에 "로그인" 부분을 누르면 보입니다.
아래가 소스부분입니다.
출력되는 개수는 $new_count = 7; 이 부분을 수정하면 됩니다.
( 그누보드4의 스킨 내용 중에 있는 부분을 수정했습니다. 어떤 분 것인지는 기억이 나지 않아서요. 죄송합니다. )
<div style="width:100%; font-size:1em; padding:10px 0px 0px 0px; text-align:center; height:24px; border-top:1px solid #ddd; border-bottom:1px solid #ddd;"><b>내가 작성한 최근글</b></div>
<div style="margin-top:4px; border:1px solid #ddd; padding:7px; background:#fff;">
<?php // 나의 최신게시물
if ($member[mb_id])
{
$new_count = 7;
$cnt = 0;
$sql = " select bo_table, wr_parent from $g5[board_new_table] a
where mb_id = '$member[mb_id]'
-- and a.wr_id = a.wr_parent
group by bo_table, wr_parent
order by bn_id desc
limit $new_count ";
$res = sql_query($sql);
echo "<table width=169 border=0 cellspacing=0 cellpadding=0>";
for ($i=0; $row=sql_fetch_array($res), $i<$new_count; $i++)
{
if (!$row[bo_table])
{
continue;
}
$tmp_table = $g5[write_prefix].$row[bo_table];
$sql2 = " select wr_subject, wr_comment from $tmp_table where wr_id = '$row[wr_parent]' ";
$row2 = sql_fetch($sql2);
$subj = cut_str(get_text($row2[wr_subject]), 15);
$comment = "";
if ($row2[wr_comment])
$comment = "<span class=new>* $row2[wr_comment]</span>";
echo "<td height='25' style='letter-spacing: -1px;'>";
echo "<nobr>";
echo "<a href='/bbs/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_parent]'>$subj $comment </a>";
echo "</nobr></td></tr>";
$cnt++; } if (!$cnt) echo "<tr><td colspan='2' height='100px' align='center'>게시글이 없습니다.<br>
<font color='#EF2B5A'><b>글 좀 남겨주세요 (^_^)</b></font></td></tr>";
echo "</table>";
} else {
echo "<table width=169 border=0 cellspacing=0 cellpadding=0>";
echo "<tr><td colspan='2' height='100px' align='center'><font color='#979797'>로그인해 주세요.</font></td></tr>";
echo "</table>";
}
?>
</div>
댓글 11개
11년 전
감사합니다 ^^
11년 전
그누보드4에도 사용할 수 있나요??
11년 전
그누4는 따로 스킨이 있습니다. 기억이 나지 않아서.. 죄송합니다.
g5 부분을 g4로 수정하면 사용 가능할 거예요.
g5 부분을 g4로 수정하면 사용 가능할 거예요.
11년 전
아~ 그렇군요~ 감사합니다~
11년 전
고맙습니다^^
10년 전
아주 좋으네요~~~ 감사합니다. 잘쓸게요~~
10년 전
감사합니다. 잘사용중입니다. ^^
8년 전
매우 좋아요~ 잘쓸게요!
7년 전
감사합니다, 잘 쓰겠습니다!
SmudiBra
6년 전
감사요
5년 전
좋은자료 감사합니다
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 2664 |
선택과집중
|
4개월 전 | 572 | |
| 2663 |
|
4개월 전 | 619 | |
| 2662 |
|
4개월 전 | 574 | |
| 2661 |
선택과집중
|
4개월 전 | 508 | |
| 2660 | 4개월 전 | 588 | ||
| 2659 |
Modify
|
4개월 전 | 653 | |
| 2658 |
선택과집중
|
4개월 전 | 415 | |
| 2657 | 4개월 전 | 452 | ||
| 2656 |
|
4개월 전 | 964 | |
| 2655 |
선택과집중
|
4개월 전 | 548 | |
| 2654 | 5개월 전 | 403 | ||
| 2653 |
선택과집중
|
5개월 전 | 585 | |
| 2652 | 5개월 전 | 394 | ||
| 2651 | 5개월 전 | 446 | ||
| 2650 |
선택과집중
|
5개월 전 | 327 | |
| 2649 |
선택과집중
|
5개월 전 | 423 | |
| 2648 | 5개월 전 | 441 | ||
| 2647 |
welcome
|
5개월 전 | 545 | |
| 2646 |
디지털홍익인간
|
5개월 전 | 453 | |
| 2645 | 5개월 전 | 467 | ||
| 2644 |
선택과집중
|
5개월 전 | 512 | |
| 2643 | 5개월 전 | 456 | ||
| 2642 | 5개월 전 | 372 | ||
| 2641 | 5개월 전 | 358 | ||
| 2640 | 5개월 전 | 394 | ||
| 2639 | 5개월 전 | 1358 | ||
| 2638 |
|
5개월 전 | 510 | |
| 2637 |
세르반데스
|
5개월 전 | 398 | |
| 2636 |
선택과집중
|
5개월 전 | 568 | |
| 2635 |
선택과집중
|
6개월 전 | 682 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기