게시판의 include > 그누4 질문답변

그누4 질문답변

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

게시판의 include 정보

게시판의 include

본문

게시판을 head.php와 tail.php 사이에 예를 들어 (board.php)등으로 include 하고 싶은데요, 아니면 다른 어떠한 방법으로라도 독립적인 파일로 출력하고 싶은데요(물로 연동은 되야겠죠!), 그게 가능할까요??
  • 복사

댓글 전체

게시판 관리자에 들어 가보시면 하단 부분에

"상단 파일 경로" => ./_head.php
"하단 파일 경로" => ./_tail.php

이렇게 넣어 주시면 됩니다!!

head 및 tail부분이 지속적으로 게시판과 같이 붙어 다닙니다!!

그리고 첫 메인 페이지는 index.php파일을 수정하시면 됩니다!!

index.php파일은 기본 디렉토리안에 있습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%B0%D4%BD%C3%C6%C7+%B4%D9%B8%A5+head&sop=and

같은 게판이지만

경우에 따라서 다른 형태로 보여 줘야 하는 거죠?

스킨을 달리 한다든가, 헤더를 경우에 따라 다른 것일 include하는 것으로 생각해 보세요.
원하시는 파일은 만드신후에 상단에
<?
include_once("./_common.php");
include_once("$g4[path]/head.php");
?>
하단에
<?
include_once("$g4[path]/tail.php");
?>
넣으시면 되는데요...._common.php파일이 필요한데 이건
<?
$g4_path = ".."; // common.php 의 상대 경로
include_once("$g4_path/common.php");
?>
식으로 만드시면 되요...$g4_path값으로 그누보드를 깐 위치를 설정해주면 됩니다
====================================================================================
include 하고 싶은데요, 아니면 다른 어떠한 방법으로라도 독립적인 파일로 출력하고 싶은데요(물로 연동은 되야겠죠!), 그게 가능할까요??
===================================================================================
아래 방식의 장점
1. 보여주는 페이지가 간결합니다. (include와 동일)
2. include 기능의 확대: 좌측메뉴를 서로 다르게 구사할경우......무지~~ 편합니다.

==>> 지금까지 나온 스킨중에 좌측메뉴 서로 다르게 표현하기의 최 절정(??) 이라고 자부합니다.  자랑은 해야죠..  온라인이니.. 다른 고수님이 인정(?) 해준방법입니다.

include  방법 말고 다른 방법을 말씀드릴게요..
저는 include 를 안쓰고 아래처럼 function 을 써서 만듭니다. 
<?
include_once("./_common.php");
include_once("../docs/design.php");

  go_main_head();  // 머리말을 불러옵니다.
  go_main_left($mpath='./board.php',$mtable='m_za',$mid='m_za',$mname='m_za_name',$mwidth='127',$malign='left');  // 왼쪽메뉴를 불러옵니다... 각각의 불러올 변수만 달리하면.. 좌측메뉴를 페이지마다 다르게 구사할수 있습니다.  ^^ ㅎㅎ.. 여태 스킨란에 좌측메뉴 서로 다르게 하는 기능을 일시에 잠재울수 있는 방법 ^^



// 구현하고 싶은 내용
dis_main();


  go_main_footer();  // 꼬리말을 불러옵니다.


?>
docs/design.php

<?php


function go_main_head($title)
{
?>

<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title><?=$title;?></title>
  <meta http-equiv="Content-Language" content="ko">
  <meta http-equiv="Content-Type" content="text/html; charset=ks_c_5601-1987">
  <meta HTTP-EQUIV="REFRESH" CONTENT="120">
  <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
  <meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="../style.css" type="text/css">
</head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">
<div align="left">
    <table border="0" width="100%" height="75" cellspacing="0" bordercolordark="white" bordercolorlight="#CCCCCC" cellpadding="0">
        <tr>
            <td colspan="2" height="4" align="left" valign="top"></td>
        </tr>
        <tr>
            <td height="65" align="left" valign="top" colspan="2">
<table border="0"  cellspacing="0" bordercolordark="white" bordercolorlight="black">
    <tr><td width="870" height="2" bgcolor="#E3E4F0"></td></tr>
<tr><td><TABLE><tr><td><H2>My Home</H2></td><td><?echo $title;?></td></tr></table></td></tr>
    <tr><td height="1" bgcolor="#E3E4F0"></td></tr>
</table>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">

<?
}


function go_main_left($mpath,$mtable,$mid,$mname,$mwidth,$malign)
{

{?><tr><td width="145" align=<?=$malign?> valign="top">
<table cellspacing="10" cellpadding="0" leftmargin="10" marginwidth="10" topmargin="10" marginheight="10">
<tr><td><td></tr>
<tr><td colspan=<?=$colspan?> height="1" bgcolor=#ECEAEA></td></tr>
<?}
$cat_array = cat_all($mta=$mtable);
$mid = $mid;
$mpath = $mpath;
foreach($cat_array as $row)
{?>
  <tr><td width=<?=$mwidth?>>  · <a href="<?=$mpath?>?bo_table=m_product&mcat=<?=$row[$mid]?>"><?=$row[$mname]?></a></td></tr>
  <tr><td colspan=<?=$colspan?> height="1" bgcolor=#ECEAEA></td></tr>
    <?}
{?><tr><td><td></tr>
</table>
</td>
<td width="85%" align="left" valign="top"><?}

}

function go_main_footer()
{
?>

</td>
        </tr>
        <tr>
            <td width="100%" colspan="2">tail</td>
        </tr>
    </table>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>

</html>

<?
}


?>

구누보드 명예상담직원으로 채용되는 그날까지~
무슨 내용인지 잘은 모르겠지만, 일단은 답변으로 채택했습니다.  감사드립니다!!

사실 제가 원하는 것은 head부분과 tail부분은 상관이 없고, body 부분에 게시판을
(/bbs/board.php?bo_table=게시판이름)등과 같이 링크로 적용하는 것이 아니라, 다른 파일들 처럼 include를 이용하여 추출하는 것입니다.  게시판 관리에서 head와 tail을 적용하면 다른 부분에서 게시판만 단독으로 띄워야 할 필요가 있어서 안되기 때문에요. 

가능한 것인지, 원래가 안되는 건지 무지한 중생은 답답하기만 하군요!!
© SIRSOFT
현재 페이지 제일 처음으로