홈빌드


그누보드의 유용한 변수들 예문




컨텐츠 정보


본문

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

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

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

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]?


humansoft.kr

php 파일 다운로드 (열기, 저장, 취소)

download.php 

<?
$file = "./file/Battery.pdf"; // 파일 저장위치
$filename = "Battery.pdf"; // 파일 이름
if ( file_exists($file) )
{
header("Content-Type: doesn/matter");
header("Content-length: ".filesize("$file"));
header("Content-Disposition: attachment; filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
if ( is_file("$file") )
{
$fp = fopen("$file", "r");
if ( !fpassthru($fp) )
{
fclose($fp);
}
}
} else
{
echo "<script>alert('첨부파일이 존재하지 않습니다.'); history.go(-1);</script>";
}
?>
-------------------------------------------------------------------------------------------
링크 부분
<map name="Map" id="Map">
<area shape="rect" coords="495,1,609,24" href="download.php?filename=Battery.pdf" target="_self" />
</map>


아주 간단한거입니다. 나중에 함수 만들어서 사용할수도 있고 입맛에 잘 골라 쓰세요.

글저장 버튼 추가 shimss 20180211 20200503 추가 시작 글작성완료 저장 / 취소

<!-- 글저장 버튼 추가 shimss 20180211 20200503 추가 시작 -->
<button type="submit" id="btn_submit" accesskey="s" class="btn btn-blue btn-sm"><i class="fa fa-check"></i> <b>작성완료 저장</b></button>
<a href="./board.php?bo_table=<?php echo $bo_table ?>" class="btn btn-color btn-sm" role="button">취소</a>
<!-- 글저장 버튼 추가 shimss 20180211 추가 끝-->

■ ▶ ☞ 정보찾아 공유 드리며 출처는 링크 참조 바랍니다 ♠ . ☞ 본자료는 https://11q.kr 에 등록 된 자료 입니다♠.

[이 게시물은 11qkr님에 의해 2021-06-16 02:50:41 11.Nas_1에서 이동 됨]
뷰PDF add1,add2



관련자료

댓글 0
등록된 댓글이 없습니다.



♥간단_메모글♥


최근글


새댓글



PHP 안에 HTML ☞ 홈페이지 화면갱신 시간은 ♨
▶ 2024-05-19 03:23:05

오늘의 홈 현황


  • 현재 접속자♨ 75 명
  • 오늘 가입자※ 0 명
  • 어제 가입자※ 5 명
  • 주간 가입자※ 14 명
  • 오늘 방문자 268 명
  • 어제 방문자 1,975 명
  • 최대 방문자 13,042 명
  • 전체 방문자 4,330,255 명
  • 전체 게시물※ 8,578 개
  • 전체 댓글수※ 24,624 개
  • 전체 회원수 10,975 명

QR코드


☞ QR코드 스캔은 kakao앱 자체 QR코드

알림 0








최신글↑