[수정] 최신글 스킨수정 만으로 최신글에 제목만 나오도록 처리 > 그누3 팁자료실

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!

그누3 팁자료실

[수정] 최신글 스킨수정 만으로 최신글에 제목만 나오도록 처리 정보

그누호환 [수정] 최신글 스킨수정 만으로 최신글에 제목만 나오도록 처리

본문

** 죄송합니다. 기존에 올린 아래쪽의 방식은 너무 복잡해서 생각하던중 더 쉬운 방법을 찾았습니다.
    최신글 스킨에 새로운 스킨을 하나 만드시고요 이것을 공지제목만 나오도록 스킨을 수정한후 다음처럼 호출하시면 됩니다.
    <?
        latest('새로만든최신글시킨폴더명', '뉴스테이블', 5, 40);
    ?>
ps : 기본에 충실해야 하는데... 어제저녁에 급하게 적용하느라고 위와 같이 기본적인 방법을 생각하지 못했었군요.



** 장점 : 기존 최신글 로직을 그대로 사용하면서 스킨만 수정해서 테이블별로 최신글을 적용시킬수있다.

1. news 테이블의 공지사항을 뽑고자 할경우 다음 처럼 호출한다.
<?
        latest('', news, 5, 40);
?>

2. 해당 최신글 스킨에서 latest.skin.php을 다음처럼 수정한다.
<?
    if($bo_table != 'news') { // 다음은 테이블이 news가 아닐경우 공지사항 처리...
?>
<table width=100% cellpadding=0 cellspacing=0>
<tr><td class='subjectbg ht' colspan=3> <a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table"?>'><span class=subject><?=$bo_subject?></span></a></td></tr>

<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=22>
    <td width=60><?=$list[$i][date]?></td>
    <td><?=$list[$i][icon_new]?><a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=content><?=$list[$i][subject]?></span></a> <span style='font-size:8pt;'><font class=pt7><?=$list[$i][commentcnt]?></font></span></td>
    <td width=70 align=center><?=$list[$i][name]?></td>
</tr>
<? } ?>

<? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>자료가 없습니다.</td></tr>"; } ?>
</table>

<? } else { // 여기서부터 테이블이 news 일때의 공지사항 처리가 시작 ?>

<table width=100% cellpadding=0 cellspacing=0 border=1>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=22>
    <td colspan=3><?=$list[$i][icon_new]?><a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=content><?=$list[$i][subject]?></span></a> <span style='font-size:8pt;'><font class=pt7><?=$list[$i][commentcnt]?></font></span></td>
</tr>
<? } ?>

<? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>자료가 없습니다.</td></tr>"; } ?>

<? } ?>
추천
0

댓글 전체

<?
if($bo_table != 'news') { // 다음은 테이블이 news가 아닐경우 공지사항 처리...
?>
<table width=100% cellpadding=0 cellspacing=0> 
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=22>
<td width=60>&nbsp;&nbsp;<img src='<?=$latest_skin?>/a_icon.gif' width='2' height='2' border='0'></td>
<td><a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=content><?=$list[$i][subject]?></span></a> <span style='font-size:8pt;'><font class=pt7><?=$list[$i][commentcnt]?>&nbsp;<?=$list[$i][icon_new]?></font></span></td>
<td width=70 align=center><?=$list[$i][date]?></td>
</tr>
<? } ?>

<? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>자료가 없습니다.</td></tr>"; } ?>
</table>

<? } else { // 여기서부터 테이블이 news 일때의 공지사항 처리가 시작 ?>

<table width=100% cellpadding=0 cellspacing=0 border=1>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=22>
<td colspan=3><?=$list[$i][icon_new]?><a href='<?="./$cfg[index]?doc=$cfg[bbs_dir]/gnuboard.php&bo_table=$bo_table&wr_id={$list[$i][wr_id]}"?>'><span class=content><?=$list[$i][subject]?></span></a> <span style='font-size:8pt;'><font class=pt7><?=$list[$i][commentcnt]?></font></span></td>
</tr>
<? } ?>

<? if (count($list) == 0) { echo "<tr><td colspan=3 align=center height=50>자료가 없습니다.</td></tr>"; } ?>

<? } ?>

루트님 이것좀 봐주세요..
글앞에 아이콘좀 넣을려고 하는데 안되네요...
bbs/latest/latest.skin.php 를 <---이거는 안건드렸는데...
bbs/1latest/latest.skin.php 로 고치고 <---이거는 안건드렸는데...
그냥 기존스킨에 latest.skin.php만 바꾸세요
감사합니다
root님~~~^^
그런데~~
이런 에러가 나네요~~~
Fatal error: Call to undefined function: latest1() in /home/flower/public_html/gnu/head.php on line 97

bbs/latest/latest.skin.php 를
bbs/1latest/latest.skin.php 로 고치고
위소스를 latest.skin.php 로 만들어서 저장
그리고 <? latest('', news, 5, 40); ?> 를
<? 1latest('', news, 5, 40); ?> 으로 호출 하였는데 위와 같은 에러가 나네요~~^^;;
죄송합니다 한수만 더 알려 주실수 없을까요~~?
전체 80
그누3 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT