그누보드5 include_once

그누보드5 include_once

QA

그누보드5 include_once

답변 2

본문

index.html 문서를 만들고 최신글불러올때는

 

<?
$g4_path="../gnuboard4";
include_once("../gnuboard4/common.php");
include_once("$g4[path]/lib/latest.lib.php");
?>

이와같이했었는데


그누보드5


 1번 같이하라는....


<?

$g5_path="./g5";
  include_once("./g5/common.php");        
  include_once("./g5/head.sub.php");

?>

 

2번 같이하라는...

 

<?
include_once("./_common.php");
include_once(G5_URL."/head.sub.php");
include_once(G5_LIB_PATH."/outlogin.lib.php");
include_once(G5_LIB_PATH."/latest.lib.php");
include_once(G5_LIB_PATH."/visit.lib.php");

?>

둘다 제대로 않되요.


그누보드4에서는 쉽게 했었는데

그누보드5에서는 도무지 어떻게 하는지 모르겠습니다. 

이 질문에 댓글 쓰기 :

답변 2

별도의 하위 폴더에 g5를 설치하셨다면..

루트 index 파일이 있는 곳에 _common.php 이름으로 파일을 하나 새로 만들고 

파일 안의 내용은 이렇게 하세요.

 

<?php

include_once('./g5/common.php');

?>

 

그리고 index 파일 상단에는 이렇게..

 

<?php

include_once("./_common.php");

include_once(G5_PATH.'/head.sub.php');

include_once(G5_LIB_PATH.'/latest.lib.php');

?>

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/lib/common.lib.php on line 135

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 620

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 622

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 623

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 624

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 625

Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/km_hgsusan/www/index.php:1) in /home/hosting_users/km_hgsusan/www/g5/common.php on line 626

답변에 감사드립니다.
위에 알려주신대로 했는데 이런식으로되네요.
인덱스 파일있는데 g5폴더만든거 맞아요

소스는 대략이런거요

<?php

include_once("./_common.php");

include_once(G5_PATH.'/head.sub.php');

include_once(G5_LIB_PATH.'/latest.lib.php');

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>무제 문서</title>
<link href="pre.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="wrap">
  <header id="header">
  <p>익스프레스</p>
    <nav id="nav">
      <ul>
        <li><a href="#">포장이사</a></li>
        <li><a href="#">원룸이사</a></li>
        <li><a href="#">기업이전</a></li>
        <li><a href="#">사무실이사</a></li>
        <li><a href="#">이사서비스</a></li>
        <li><a href="#">사다리차문의</a></li>
        <li><a href="#">회원가입</a></li>
        <li><a href="#">로그인</a></li>
      </ul>
    </nav>
  </header>
  <section id="section">
    <article class="article1">
      <div>여기에 새 Div 태그의 내용 입력</div>
    </article>
      <article class="article2">
        <div>
          <?=latest("basic","not",5,15);?>
        </div>
      </article>
        <article class="article3">
          <div></div>
        </article>
          <aside class="aside">
            <div>사이드</div>
          </aside>
       
     
   
  </section>
  <footer id="footer">
    <article>
    <div> <h1>익스프레스</h1></div>
    <div>
    <ul>
      <li>copyRIGHT &copy;2016 익스프레스.com </li>
      <li>ALLRIGHTS RESERVED</li>
      <li>이삿짐센터/주소:00000000</li>
      <li>대표전화:000-000-0000/</li>
      <li>화물운송허가번호:제000호</li>
      <li>통신판매업:00000전자상거래등록</li>
      </ul>
      </div>
    </article>
  </footer>
</div>
</body>
</html>

새로 만든 _common.php 파일 시작 부분 <?php  과 아래 끝 부분 ?> 에 공백 있나 먼저 체크를 해보세요. 그리고 올려주신 형태의 구조는 좋지 못한 구조입니다.
head.sub.php 파일을 보면 <html>태그부터 해서 <body>태그까지 이미 있기 때문에
여기는 전부 중복되므로 삭제하고 head.sub.php 파일 하나로 통합하는 게 낫습니다.

삭제해야 할 부분..
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>무제 문서</title>
<link href="pre.css" rel="stylesheet" type="text/css">
</head>
<body>

하단도 </body></html> 여기를 삭제하고 tail.sub.php 파일을 인클루드해서 사용하는 게 좋고요.

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 1
© SIRSOFT
현재 페이지 제일 처음으로