테스트 사이트 - 개발 중인 베타 버전입니다

[초보]원하는 그룹 id 별로 최신글 자동으로 추출하기

<?
include_once("./_common.php");
include_once("$g4[path]/lib/latest.lib.php");

$g4[title] = "";

include_once("./_head.php");

$list_mod = 2; // 한라인에 몇개씩 출력할것인지?
?>

<table width="100%" cellpadding=0 cellspacing=0><tr>
<?
// 최신글
$sql = " select bo_table, bo_subject from $g4[board_table] where gr_id = '그룹아이디' order by bo_table "; //그룹 id 설정
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {

// tr 바꾸기
if (($i > 0) && ($i % $list_mod == 0))
echo "</tr><tr>";

echo "
<td width=50% valign=top>
<table width=98% cellpadding=0 cellspacing=0 align=center>
<tr>
<td colspan=2>";

// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
// 스킨은 입력하지 않을 경우 운영자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
echo latest("basic", $row[bo_table], 5, 50);

echo "</td></tr></table></td>";
}

if ($i > 0 && ($i % $list_mod == 1))
echo "<td width=50% valign=top>&nbsp;</td>";
?>
</td></tr></table>

<?
include_once("./_tail.php");
?>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 5개

중복자료면 코멘트 남겨 주세요. 삭제하겠습니다.

맨위에 gr_id 를 한번 써주고..

$g4[title] = ""; 이곳에 해당 그룹 id 의 그룹 제목을 자동으로 뽑아왔으면 싶은데.. 혹시 아시면 한수 가르침을...
휴일에도 열심이시네요 ㅎ

감사하게 쓰겠습니다
영자 자료실
20년 전
[초보]원하는 그룹 id 별로 최신글 자동으로 추출하기
&lt;? include_once(\"./_common.php\"); include_once(\"$g4[path]/lib/latest.lib.php\"); $g4[title] = \"\"; include_once(\"./_head.php\"); $list_mod = 2; // 한라인에 몇개씩 출력할것인지? ?&gt; &lt;table width=\"100%\" cellpadding=0 cells…
좋은 정보 감사합니다~~!

게시글 목록

번호 제목
620
605
594
590
589
578
563
551
550
542
536
531
529
522
511
497
471
467
466
479