그누보드 최신글 추출....ㅠ ㅠ제발도와주세요.. > 그누4 질문답변

그누4 질문답변

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

그누보드 최신글 추출....ㅠ ㅠ제발도와주세요.. 정보

그누보드 최신글 추출....ㅠ ㅠ제발도와주세요..

본문

다른글 검색해서 똑같이해봤는데도 저는 계속 오류만 나네요..지금 하루 꼬박 이거에
매달렸는데도 별다른 방법을 찾지못했어요..ㅠ ㅠ ㅠ ㅠ


index.php안에 main/main.php를 인크루드시켜놓은 상태라서 그런건지....

일단latest안에 스킨은 적용해두었구요
main.php안에 적용할부분에
<?=latest("basic_simple", "notice", 5, 30)?>
적용시켰어요.

그리구 main.php안 상단에
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php"); // latest() 함수를 사용하여야 하므로 이 프로그램을 포함시킵니다.

echo latest("basic_simple", "notice", 5, 30); // basic 스킨으로 free 라는 게시판을 출력합니다.
?>
이걸 적용하라고하는데 어느위치에적용을 시켜야 하는지를 잘모르겠어요..일단 어느곳에든
적용만하면 오류가 계속뜨니...


제발제발 답변좀 부탁드립니다...ㅠ ㅠ ㅠ ㅠ ㅠ ㅠ ㅠ ㅠ 도와주셔요
  • 복사

댓글 전체

에러메세지를 보진 못했지만  에러메세지의 이유는

1. main.php 에서 common 파일을 불러오는 경로가 잘못됨
2. 최신글 출력부가 중복

이거 두개로 추정됩니다.

/main/main.php 경로에 있으므로
common ㅍ파일은 ../ 위치에 있겠지요.


수정하실 내용은
main.php 문서 젤 앞부분에 (공백이 있으면 안됩니다.)

<?
include_once("../_common.php");  // 경로 수정..
include_once("$g4[path]/lib/latest.lib.php"); // 최신글 출력 함수불러옴
?>

이걸 넣으시고

출력을 원하는 부분에

<?=latest("basic_simple", "notice", 5, 30)?>

이걸 넣으시면 됩니다.



<? echo latest("basic_simple", "notice", 5, 30); ?>
<?=latest("basic_simple", "notice", 5, 30)?>
이거 두개는 같은 뜻이예요...

오류가 뜰때는 오류 메세지를 올려주셔야 정확한 답변을 얻으실 수 있습니다.

즐똥
모조키님 답변감사드립니다!!^^


common.php가 gnuboard4폴더안에 있는 common.php말씀하시는건가요??
아니면 새로 한개 만들어야하는건가요..ㅠ ㅠ
문서제일앞부분이라면
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="En" lang="En">
<head>
<title>Caritas Technical Secondary School</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Publisher" content="park-bohe" />
<meta name="author" content="park-bohe" />
<meta name="Author-Date(Date)" content="2013/01/07" />
<meta name="Copyright" content="hello-add" />
<meta name="keywords" content="hello-add" />
<meta name="robots" content="all" />
<link rel="stylesheet" type="text/css" href="../../css/contents_main.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<script type="text/javascript" src="../../js/jquery.menu.js"></script>

</head>

<body>
<div id="ly_wrap">
.
.
이중 어디에넣어야하는지..ㅠ ㅠ 아...게시판다는건 참 힘드네요..ㅠ ㅠ
<?
include_once("../_common.php");  // 경로 수정..
include_once("$g4[path]/lib/latest.lib.php"); // 최신글 출력 함수불러옴
?>

부분을 main.php에 넣지 마시고 index.php 상단에만 추가해서 테스트해 보세요.
port님 답변감사드립니다!^^

<?
include_once("../_common.php");  // 경로 수정..
include_once("$g4[path]/lib/latest.lib.php"); // 최신글 출력 함수불러옴
?> 부분을 index.php에 넣고

main.php에  <?=latest('basic_simple', 'notice', 5, 39)?> 를 div안에 넣었습니다.

하지만 여전히아래의 오류가 뜨네요...ㅠ

Fatal error: Call to undefined function latest() in /host/home/test00/html/coding/main/main.php on line 107

'notice'부분은 게시판의 이름이 맞죠?
균이님 답변감사드립니다..!!^^

<?
$g4_path = ".."; // common.php 의 상대 경로
include_once("$g4_path/common.php");
?>이 들어있는 _common.php를 main.php파일이있는 main폴더에 넣고
main.php에  <?=latest('basic_simple', 'notice', 5, 39)?> 를
div안에 넣었는데

Fatal error: Call to undefined function latest() in /host/home/test00/html/coding/main/main.php on line 107

위의 오류가 뜨네요.. ㅠ ㅠ
복사해 넣었다면 아래처럼 하면 무조건 됩니다
<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");
echo latest("basic_simple", "notice", 5, 30);
?>
main php 내용이....

head는 그누보드의  head.sub.php 에서 다 불러오는데  중복선언 하시네요

저렇게 하면 에러 안뜨던가요??

index 안에서 main을 불러오는거면

body 안쪽 내용만 넣으셔야 할건데..



meta는 되도록 head.sub.php 쪽으로 인클루드 시키시고 ...
제가 개념 자체를 이해못하는 모양이에요..ㅠ ㅠ
아직 main.php의 head는 인크루드시커놓지않은 상태인데..
저는 inc폴더만들어서 거기에 인크루드시켜놓을생각이었거든요
그누보드게시판 넣으려면 그렇게하면안되는건가봐요.ㅠ ㅠ 넘 어려움..ㅠ
© SIRSOFT
현재 페이지 제일 처음으로