메인에 최신글 추출하는 방법좀 부탁드려요~

메인에 최신글 추출하는 방법좀 부탁드려요~

QA

메인에 최신글 추출하는 방법좀 부탁드려요~

답변 1

본문

 
메인에 최신글 추출하는 방법좀 부탁드려요~
 
그누보드 게시판에 있는 글을
 
보드가 아닌 다른곳에 있는 index.html (메인)이라는 파일에
 
몇줄 추출하고 싶습니다.
 
이런저런 방법을 듣고 해보았더니,
 
 
 
<?
include_once("./_common.php");
include_once("$g4_path/lib/latest.skin.php");

?>
 
 
<div class="notice">
<?=latest("basic2",test2, 5, 20); ?>
</div>
 
 
 
이렇게 넣었더니 아예 div가 사라져버립니다.
 
 
아래는 index.html파일 전체입니다.
 
 
 
<?
include_once("./_head.php")
?>
<!--
<script language='JavaScript' type='text/javascript'>
<!--
function resizeFrame(iframeObj){
/* 아이프레임에서 읽어들인 페이지의 body */
var innerBody = iframeObj.contentWindow.document.body;
/* 높이 다시설정 */
var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
iframeObj.style.height = innerHeight;
/*---------- 넓이도 함께 자동조정되야 한다면 주석을 풀어주세요~--------------------------------
// 넓이 다시설정
var innerWidth = innerBody.scrollWidth + (innerBody.offsetWidth - innerBody.clientWidth);
iframeObj.style.width = innerWidth;    
---------------------------------------------------------------------------------------------------*/
this.scrollTo(1,1); //[락위듀]아렌티 님의 지적
}
//
</script>-->
<script type="text/javascript">
// iframe resize
function autoResize(i)
{
    var iframeHeight=
    (i).contentWindow.document.body.scrollHeight;
    (i).height=iframeHeight+20;
}
</script>
 
<?
include_once("./_common.php");
include_once("$g4_path/lib/ttbasic_l/latest.skin.php");
?>
 
<?
include_once("./head.php")
?>

<div class="content">
<div class="mainimg">
<figure data-media="./img/main320.jpg" data-media440="./img/main520.jpg" data-media600="./img/main680.jpg" title="메인이미지">
        <noscript>  
            <img src="./img/main680.jpg" alt="메인이미지"> 
        </noscript>
 
</figure>
</div>
 
<!--  이아래로 다 사라져버립니다 -->
<div class="notice">
<?=latest("basic",notice, 5, 20); ?>
</div>

<div class="content1">
<h1></h1>
<iframe src="http://주소/bbs/board.php?bo_table=test" onload="autoResize(this)" scrolling="no" width="100%" frameborder="0"></iframe>
</div>
</div>
 
 
<?
include_once("./tail.php")
?>
 
 
 
 

이 질문에 댓글 쓰기 :

답변 1

<?=latest("basic",notice, 5, 20); ?> => <?=latest("basic", "notice", 5, 20); ?>

<?=latest("basic",notice, 5, 20); ?> => <?=latest("basic", "notice", 5, 20); ?>


링크주소/index.php 

요기 들어있구요~~

게시판은

링크주소/build/lib/ ...


요기에 들어있는건데요~
이소스가~ 그누보드가 게시판이 아닌 index.php 페이지에서도 작동을 하는건가요~?


error_reporting(E_ALL);
ini_set("display_errors", 1);

제가초보라서 이건 어디에 들어가야 하는건가욥~?

<?
error_reporting(E_ALL);
ini_set("display_errors", 1);

include_once("./_common.php");
include_once("$g4_path/lib/latest.skin.php");
?>
이렇게 넣어보세요~
링크주소/build/lib/ ...  이렇게는 작업해본 적이 없어서...;;

Warning: include_once(../common.php): failed to open stream: No such file or directory in /home/hosting_users/infocomz/www/memul/_common.php on line 3 Warning: include_once(): Failed opening '../common.php' for inclusion (include_path='.:/usr/local/php53/lib/php') in /home/hosting_users/infocomz/www/memul/_common.php on line 3 Warning: include_once(../lib/latest.skin.php): failed to open stream: No such file or directory in /home/hosting_users/infocomz/www/memul/index.php on line 39 Warning: include_once(): Failed opening '../lib/latest.skin.php' for inclusion (include_path='.:/usr/local/php53/lib/php') in /home/hosting_users/infocomz/www/memul/index.php on line 39

이런메시지가 뜨네욥~//

include_once("./_common.php");  <= 이 파일에서 g4_path 설정이랑 common.php 파일 불러오는 경로를 수정해줘야 할 듯 생각됩니다.  예전에 이런 폴더 형태로 된 작업이 들어와서 해본 적이 있는데 어떻게 했는지 기억이 안 나네요~;;

_common.php 안에는이렇게 되어있어욥//
<?
$g4_path = ".."; // common.php 의 상대 경로
include_once("$g4_path/common.php");
?>

이경로가 메인인덱스 있는곳이구요~
http://url주소/index.php


최신글 불러오려는 게시판은

http://url주소/build/skin/board/게시판명

이경로에 들어있습니다.

latest.skin.php 요거는
http://url주소/build/lib/latest.skin.php 요기구용~


ㅠㅠ경로가 어떻게 들어가야할까요//

index.html 파일과 같은 폴더에 아래 파일들을 만들어 놓으셨고
_common.php ,  _head.php

이 _common.php 파일에 아래처럼 되어 있으면(경로가) 안됩니다.
<?
$g4_path = ".."; // common.php 의 상대 경로
include_once("$g4_path/common.php");
?>
$g4_path = ".."; 이면 www 폴더를 가리키게 됩니다.

$g4_path = "/build"; 로 해보세요~
근데 이렇게 해도 제 기억엔 다른 에러가 뜨고 그 에러보고 다시 수정하고 했던 거 같네요

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