사용자: 인덱스 최신글 완료 #173

This commit is contained in:
whitedot
2013-01-24 16:38:56 +09:00
parent 121557fc82
commit 0a64d941e6
3 changed files with 16 additions and 11 deletions

View File

@ -2,13 +2,9 @@
if (!defined('_GNUBOARD_')) exit;
// 최신글 추출
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $position='left')
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40)
{
global $g4;
static $lt_count=0;
if ($position == 'right')
$lt_count++;
if (!$skin_dir) $skin_dir = 'basic';
$latest_skin_path = skin_path().'/latest/'.$skin_dir;

View File

@ -12,12 +12,21 @@ include_once('./_head.php');
$sql = " select bo_table from {$g4['board_table']} order by gr_id, bo_table ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
$lt_style = "";
if ($i%2==1) $lt_style = "margin-left:20px";
else $lt_style = "";
?>
<div style="float:left;<?=$lt_style?>">
<?
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("neo", $row['bo_table'], 5, 25, 'right');
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("neo", $row['bo_table'], 5, 25);
?>
</div>
<?
}
?>
<!-- 메인화면 최신글 끝 -->

View File

@ -2,7 +2,7 @@
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
?>
<div class="lt" style="<?=$lt_count%2==0?'margin-left:20px;':'';?>">
<div class="lt">
<strong class="lt_title"><a href="<?=$g4['bbs_path']?>/board.php?bo_table=<?=$bo_table?>"><?=$bo_subject?></a></strong>
<ul>
<? for ($i=0; $i<count($list); $i++) { ?>