그누보드의 유용한 변수들 > Board Tip

본문 바로가기
 

그누보드의 유용한 변수들

페이지 정보

작성자 휴먼 댓글 0건 조회 22,069회 작성일 12-02-21 16:17

본문


최신글이나 게시판등을 수정하실때~

유용한 함수들을 적어봅니다~ ^^

맨 마지막에 출처도 적혀있습니다...

1. 해당게시판에서 제목불러오기
  <a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a>

2. 해당게시판에서 목록 불러오기
  <a href='<?=$list[$i][href]?>'><?=$list[$i][subject]?></a>

3. 해당게시판에서 작성일자 불러오기
  <?=$list[$i][datetime]?> // 1999-12-31 형식
  <?=$list[$i][datetime2]?> // 12-31 형식.

4. 해당게시판에서 작성자 불러오기
  <?=$list[$i][name]?>

5. 해당게시판에서 코멘트숫자 불러오기
  <?=$list[$i][comment_cnt]?>

6. 해당게시판에서 코멘트 새창 띄우기 링크
  <a href="<?=$list[$i][comment_href?>" target="_blank"><?=$list[$i][comment_cnt]?></a>

7. 해당게시판에서 새글표시 그림 나타내기
  <?=$list[$i][icon_new]?>

8. 본문내용 모양 그대로 지정길이 만큼 줄여서 출력
    <?=nl2br(stripslashes(cut_str($list[$i][content], 200, '....' )))?> //"200"이 지정길이를 의미함

9. 본문내용 모양 그대로 출력
    <?=nl2br(stripslashes($list[$i][content]))?>

10. 본문내용 붙여서 출력
    <?=$list[$i][content]?>

11. 본문내용 붙여서 지정길이 만큼 줄여서 출력
    <?=cut_str($list[$i][wr_content],200,"…");?> //"200"이 지정길이를 의미함

12. 즐겨찾기용 게시판에서 링크된 url불러오기
    <a href='<?=$list[$i][wr_link1]?>' target=_blank><?=set_http(get_text(cut_str($list[$i][wr_link1], 45)))?></a> // url길이가 "45"보다 크면 자름

13. html로 작성된 본문을 html문서 적용된 내용으로 불러오기
    <?=nl2br(stripslashes($list[$i][wr_content]))?>

14. html로 작성된 본문을 html문서 적용된 내용으로 지정한 길이만큼 불러오기
    <?=nl2br(stripslashes(cut_str($list[$i][wr_content], 200, '....' )))?>

15. 최신글에서 게시판 제목이나 이미지 랜덤으로 볼러오기
      - http://sir.co.kr/?doc=bbs/gnuboard.php&bo_table=tiptech&wr_id=7127

16. 해당 게시판에서 카테고리 불러오기
    <a href="<?=$list[$i][ca_name_href]?>"><?=$list[$i][ca_name]?></a>

17. 첨부파일 불러오기
    <?           
echo "<a href='{$list[$i][href]}'>";
        $image = urlencode($list[$i][file][0][file]); // 첫번째 파일이 이미지라면
            if (preg_match("/\.(gif|jpg|png)$/i", $image)) {
        echo "<img src='$g4[path]/data/file/$bo_table/$image' width='45' height='45' border='0'>"; // 이미지크기
            } else
        echo "<img src='$latest_skin_path/img/noimage.gif' width='45' height='45' style='border:#cdcdcd solid 1px'>"; ?>
    </a>

18. 각종 아이콘 보여주기
  <?=$list[$i][icon_file]?>
  <?=$list[$i][icon_link]?>
  <?=$list[$i][icon_hot]?>
  <?=$list[$i][icon_secret]?>

19. 추천수 보이기
<? if ($list[$i][wr_good]) echo "추천({$list[$i][wr_good]})";?>

20. 비추천수 보이기
<? if ($list[$i][wr_nogood]) echo "비추천({$list[$i][wr_nogood]})";?>


[출처] 문스타닷컴 - http://www.munstar.com/bbs/board.php?bo_table=B30_2&wr_id=50


댓글목록

등록된 댓글이 없습니다.

Total 59건 1 페이지
게시물 검색