https://www.070805.com/blog/48453 << 출처
다음 코드를 module_srl번호에 따라서 n 표현을 하고싶습니다.
현재 180 ,174 번에 새글이 올라오면 시간을 1500초(테스트를위해서..)이내에 글은 n으로 표현되어있습니다.
{@
$args = new stdClass();
$args->module_srl = '180','174';
$args->list_count = 1;
$output = executeQuery('document.getDocumentList', $args);
}
<!--@foreach($output->data as $doc)-->
{@ $regdate = strtotime($doc->regdate);}
<!--@end-->
{@
if(!$output->data) unset($regdate);
$newdoc = false;
$yesterdaytime = time() - 1500;
if($regdate > $yesterdaytime) $newdoc = true;
}
<span cond="$newdoc" class="new" style="position:relative;top:50px;left:200px;">N</span>
{@
unset($newdoc);
}
이런 코드를 다음과 같이 둘로 나누어서 사용하려고합니다.
{@
$args = new stdClass();
$args->module_srl = '180';
$args->list_count = 1;
$output = executeQuery('document.getDocumentList', $args);
}
<!--@foreach($output->data as $doc)-->
{@ $regdate = strtotime($doc->regdate);}
<!--@end-->
{@
if(!$output->data) unset($regdate);
$newdoc = false;
$yesterdaytime = time() - 1500;
if($regdate > $yesterdaytime) $newdoc = true;
}
<span cond="$newdoc" class="new" style="position:relative;top:50px;left:200px;">N</span>
{@
unset($newdoc);
}
{@
$args = new stdClass();
$args->module_srl = '174';
$args->list_count = 1;
$output = executeQuery('document.getDocumentList', $args);
}
<!--@foreach($output->data as $doc)-->
{@ $regdate = strtotime($doc->regdate);}
<!--@end-->
{@
if(!$output->data) unset($regdate);
$newdoc = false;
$yesterdaytime = time() - 1500;
if($regdate > $yesterdaytime) $newdoc = true;
}
<span cond="$newdoc" class="new" style="position:relative;top:250px;left:200px;">N</span>
{@
unset($newdoc);
}
이런식으로 둘로 나눠서 사용하려고 합니다.
다만 게시판이 많아질수록 코드또한 길어지게되어서 해당내용을 반복문으로 변경하여 module_srl 번호에따라 span 내용을 변경하고싶습니다. 코드 수정좀 부탁드리겟습니다
출력
}
요런식으로 하면 되지 않을까 싶은ㄷ