일정의 글을 메인에 추출시 오늘일정부터 .. 정보
일정의 글을 메인에 추출시 오늘일정부터 ..관련링크
본문
지러유님의 일정스킨을 삽입했습니다.
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=84126&sca=&sfl=wr_subject&stx=%BD%BA%C4%C9%C1%EC&sop=and
일정을 과거,오늘,미래 부분을 많이 오늘날짜로 입력했다고 칩시다.
베이직스킨의 게시글을 추출하면
최근에 올린글 [오늘날짜] 즉
가장 나중등록한 일정제목 [2010-09-03]
그전에 등록한일정글제목 [2010-09-03]
그전전에 등록한 일정제목 [2010-09-03]
....
...
이런식으로 6개를 추출되는 데요.
이것을 이런식으로 추출되게 하지 않고
언제 등록을 했건간에 날짜를 따지지 않고
=====================================
● 오늘날짜 의 일정 [오늘날짜] 오늘일정최상단1개←
● 오늘날짜 +1일일정 [오늘+1일날짜] 미래일정 그밑에2개↘
● 오늘날짜 +2일일정 [오늘+2일날짜]
● 오늘날짜 -1일일정 [오늘-1일날짜] 과저일정 그밑에3개↘
● 오늘날짜 -2일일정 [오늘-2일날짜]
● 오늘날짜 -3일일정 [오늘-3일날짜]
======================================
위처럼 쉽게 말하자면
오늘일정이 무조건 1개,그밑에 미래일정2개 ,그밑에 과저일정3개 이렇게 등록되는데.
일정이 거의 매일등록이 되는데...가끔 일요일은 아무 일정도 없을 수 있습니다.
그때는 오늘-4일이 하나 나오면 될거예요.글은 6개가 나와야 디자인이 안 흐트러지니까요.
그런데 일정은 1,2,3개가 최대입니다.오늘일정이 3개면 최대3개가 노출되고 미래과거3개형식입니다.
아래의 베이직추출 소스를 어떻게 변경해야 할까요???
===========latest.skin.php 시작=============
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td width='100%' background='<?=$latest_skin_path?>/img/bg_latest.gif'> <img src='<?=$latest_skin_path?>/img/icon_t.gif'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td width=37 background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=20><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?>
</td>
<td align="right">[<?=$list[$i][datetime2]?>]</td>
</tr>
<tr><td bgcolor=#EBEBEB height=1></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
==============latest.skin.php 끝 =====
http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=84126&sca=&sfl=wr_subject&stx=%BD%BA%C4%C9%C1%EC&sop=and
일정을 과거,오늘,미래 부분을 많이 오늘날짜로 입력했다고 칩시다.
베이직스킨의 게시글을 추출하면
최근에 올린글 [오늘날짜] 즉
가장 나중등록한 일정제목 [2010-09-03]
그전에 등록한일정글제목 [2010-09-03]
그전전에 등록한 일정제목 [2010-09-03]
....
...
이런식으로 6개를 추출되는 데요.
이것을 이런식으로 추출되게 하지 않고
언제 등록을 했건간에 날짜를 따지지 않고
=====================================
● 오늘날짜 의 일정 [오늘날짜] 오늘일정최상단1개←
● 오늘날짜 +1일일정 [오늘+1일날짜] 미래일정 그밑에2개↘
● 오늘날짜 +2일일정 [오늘+2일날짜]
● 오늘날짜 -1일일정 [오늘-1일날짜] 과저일정 그밑에3개↘
● 오늘날짜 -2일일정 [오늘-2일날짜]
● 오늘날짜 -3일일정 [오늘-3일날짜]
======================================
위처럼 쉽게 말하자면
오늘일정이 무조건 1개,그밑에 미래일정2개 ,그밑에 과저일정3개 이렇게 등록되는데.
일정이 거의 매일등록이 되는데...가끔 일요일은 아무 일정도 없을 수 있습니다.
그때는 오늘-4일이 하나 나오면 될거예요.글은 6개가 나와야 디자인이 안 흐트러지니까요.
그런데 일정은 1,2,3개가 최대입니다.오늘일정이 3개면 최대3개가 노출되고 미래과거3개형식입니다.
아래의 베이직추출 소스를 어떻게 변경해야 할까요???
===========latest.skin.php 시작=============
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td width='100%' background='<?=$latest_skin_path?>/img/bg_latest.gif'> <img src='<?=$latest_skin_path?>/img/icon_t.gif'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td width=37 background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>
</table>
<table width=100% cellpadding=0 cellspacing=0>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=20><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; color:#6A6A6A;'>{$list[$i]['subject']}</font>";
echo "</a>";
if ($list[$i]['comment_cnt'])
echo " <a href=\"{$list[$i]['comment_href']}\"><span style='font-family:돋움; font-size:8pt; color:#9A9A9A;'>{$list[$i]['comment_cnt']}</span></a>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
echo " " . $list[$i]['icon_new'];
echo " " . $list[$i]['icon_file'];
echo " " . $list[$i]['icon_link'];
echo " " . $list[$i]['icon_hot'];
echo " " . $list[$i]['icon_secret'];
?>
</td>
<td align="right">[<?=$list[$i][datetime2]?>]</td>
</tr>
<tr><td bgcolor=#EBEBEB height=1></td></tr>
</table></td>
</tr>
<? } ?>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
==============latest.skin.php 끝 =====
댓글 전체
# 해당과 같은기능은 날짜 제어를 해주셔야 합니다. 제공해주신 스킨소스에서는 해결하기 힘들수 있습니다. 근본적인 소스부터 손보셔야 합니다.
latest.lib.php 에서 별도로 함수를 구현후에 출력하셔야합니다.
해당 원하시는 날짜를
## latest.lib.php 함수 글자 소팅 구문
$date_select = $today + 1일; // 포멧형태 : 2010-05-06
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_date_sector like '$date_select%' order by wr_num limit 0, $rows ";
##
-1일 이나 +1일 등의 방법은
//1일=86400초 이므로 : -1일
$unixtime_make = time() - (86400);
echo date("Y-m-d", $unixtime_make);
형태를 이용하시면 됩니다.
==> 해당 해결키는 모두 제공해드렸습니다. 어려우시다면 별도 의뢰 쪽지 주세요.
latest.lib.php 에서 별도로 함수를 구현후에 출력하셔야합니다.
해당 원하시는 날짜를
## latest.lib.php 함수 글자 소팅 구문
$date_select = $today + 1일; // 포멧형태 : 2010-05-06
$sql = " select * from $tmp_write_table where wr_is_comment = 0 and wr_date_sector like '$date_select%' order by wr_num limit 0, $rows ";
##
-1일 이나 +1일 등의 방법은
//1일=86400초 이므로 : -1일
$unixtime_make = time() - (86400);
echo date("Y-m-d", $unixtime_make);
형태를 이용하시면 됩니다.
==> 해당 해결키는 모두 제공해드렸습니다. 어려우시다면 별도 의뢰 쪽지 주세요.
이렇게 하지 않고 그냥 db에서 가져오기 해서 아래처럼 했습니다.
제목을 35자로 자르기 해서 구현하려면 아래글을 어떻게 바꾸면 될까요?
cut_str($info_list[wr_subject],30); 을 넣으니 안되네요?
제목을 35자로 자르기 해서 구현하려면 아래글을 어떻게 바꾸면 될까요?
cut_str($info_list[wr_subject],30); 을 넣으니 안되네요?
이거 이렇게 바꾸면요
//--------------------- 데이터베이스 정보 ---------------------//
보안상 노출안함
//--------------------- 데이터베이스 정보 ---------------------//
//------------------ 데이터베이스에 연결 ----------------------//
$connect = mysql_connect($host, $username, $userpass) or die("데이터베이스 연결에 실패했습니다.");
mysql_select_db($dbname, $connect) or die("데이터베이스 연결에 실패했습니다.");
$boardname = "schedule"; //관리자모드에서 지정한 게시판명(예 notice)
$query = "select * from g4_write_".$boardname." order by wr_datetime DESC limit 0,6"; //6개까지만 추출
$result_list = mysql_query($query, $connect);
while($info_list = mysql_fetch_array($result_list)) {
echo("
<tr height='26'>
<td bgcolor='#ffffff'>
<a href='/board/bbs/board.php?bo_table=schedule&wr_id=$info_list[wr_id]'>
$info_list[wr_subject]
</a></td>
</tr>
");
}
?>
</td>
</tr>
</table>
</td>
</tr>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
여기서 $info_list[wr_subject] 이걸 35자로 자르기 할려면 어떻게 해야 하나요?
echo문 어떻게 바꾸나요?
//--------------------- 데이터베이스 정보 ---------------------//
보안상 노출안함
//--------------------- 데이터베이스 정보 ---------------------//
//------------------ 데이터베이스에 연결 ----------------------//
$connect = mysql_connect($host, $username, $userpass) or die("데이터베이스 연결에 실패했습니다.");
mysql_select_db($dbname, $connect) or die("데이터베이스 연결에 실패했습니다.");
$boardname = "schedule"; //관리자모드에서 지정한 게시판명(예 notice)
$query = "select * from g4_write_".$boardname." order by wr_datetime DESC limit 0,6"; //6개까지만 추출
$result_list = mysql_query($query, $connect);
while($info_list = mysql_fetch_array($result_list)) {
echo("
<tr height='26'>
<td bgcolor='#ffffff'>
<a href='/board/bbs/board.php?bo_table=schedule&wr_id=$info_list[wr_id]'>
$info_list[wr_subject]
</a></td>
</tr>
");
}
?>
</td>
</tr>
</table>
</td>
</tr>
<? if (count($list) == 0) { ?><tr><td colspan=4 align=center height=50><font color=#6A6A6A>게시물이 없습니다.</a></td></tr><? } ?>
</table>
여기서 $info_list[wr_subject] 이걸 35자로 자르기 할려면 어떻게 해야 하나요?
echo문 어떻게 바꾸나요?