새글등록시 전체글(new.php)리스트에 'new' 아이콘을 출력하는 방법 좀 알려주세요!!
본문
최신글처럼 새글 등록시 전체글리스트에 'new'아이콘을 노출시키고 싶은데요...
고수님들의 관련 팁 부탁드립니다...!
고수님들의 관련 팁 부탁드립니다...!
답변 2
따로 빼니까 해결이 되네요..
비슷한 경우 계시분들 응용하세요...
<?
// new icon 표시
$new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));
$icon_new = '';
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))
$icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';
?>
비슷한 경우 계시분들 응용하세요...
<?
// new icon 표시
$new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));
$icon_new = '';
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))
$icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';
?>
new.skin.php 아래 코드를 수정해 보세요.
수정된 코드
icon 이미지 경로는 수정하셔야 합니다.
그리고 수정된 코드에서는 24시간을 기준으로 처리하고 있는데요
시간을 변경하시려면 G4_SERVER_TIME - (24 * 3600))) 부분의 24를 다른 시간을 변경하시면 됩니다.
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i]['gr_subject'], 20);
$bo_subject = cut_str($list[$i]['bo_subject'], 20);
$wr_subject = get_text(cut_str($list[$i]['wr_subject'], 80));
?>
수정된 코드
<?
for ($i=0; $i<count($list); $i++)
{
$gr_subject = cut_str($list[$i]['gr_subject'], 20);
$bo_subject = cut_str($list[$i]['bo_subject'], 20);
$wr_subject = get_text(cut_str($list[$i]['wr_subject'], 80));
// new icon 표시
$new_skin_url = G4_URL.str_replace("\\", "/", str_replace(G4_PATH, "", $new_skin_path));
$icon_new = '';
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", G4_SERVER_TIME - (24 * 3600)))
$icon_new = '<img src="'.$new_skin_url.'/img/icon_new.gif" alt="새글">';
?>
icon 이미지 경로는 수정하셔야 합니다.
그리고 수정된 코드에서는 24시간을 기준으로 처리하고 있는데요
시간을 변경하시려면 G4_SERVER_TIME - (24 * 3600))) 부분의 24를 다른 시간을 변경하시면 됩니다.
답변을 작성하시기 전에 로그인 해주세요.