[사노라가노라]상단 메뉴 게시판별 새글 이미지 출력
페이지 정보
본문
사노라가노라2013.10.28 11:59:48조회 9,730댓글 2
[code]
function tto_new_icon($bo_table) {
global $g5;
$temp = sql_fetch("select bo_new from {$g5['board_table']} where bo_table = '$bo_table'");
$time_set = date("Y-m-d H:i:s", time() - $temp[bo_new] * 60 * 60);
$row = sql_fetch("select wr_id as cnt from {$g5['write_prefix']}$bo_table where wr_is_comment = '0' and wr_datetime > '$time_set'");
if($row[cnt])
echo " <img src='$g5[path]/img/icon_new.gif' alt='' />"; // 사용 이미지에 맞게 경로.파일 수정
}
[/code]
lib/new.icon.lib.php 파일 생성 후 위 내용 추가.저장
(파일명 다르게 하는 경우 아래 include 부분 변경)
head.php 상단
[code]
include_once(G5_LIB_PATH.'/new.icon.lib.php'); // 추가
[/code]
head.php 게시판명 출력 부분에 아이콘 출력 함수 추가
[code]
<?php echo $row2['bo_subject'] ?> <?php echo tto_new_icon($row2['bo_table']) ?>
[/code]
[code]
function tto_new_icon($bo_table) {
global $g5;
$temp = sql_fetch("select bo_new from {$g5['board_table']} where bo_table = '$bo_table'");
$time_set = date("Y-m-d H:i:s", time() - $temp[bo_new] * 60 * 60);
$row = sql_fetch("select wr_id as cnt from {$g5['write_prefix']}$bo_table where wr_is_comment = '0' and wr_datetime > '$time_set'");
if($row[cnt])
echo " <img src='$g5[path]/img/icon_new.gif' alt='' />"; // 사용 이미지에 맞게 경로.파일 수정
}
[/code]
lib/new.icon.lib.php 파일 생성 후 위 내용 추가.저장
(파일명 다르게 하는 경우 아래 include 부분 변경)
head.php 상단
[code]
include_once(G5_LIB_PATH.'/new.icon.lib.php'); // 추가
[/code]
head.php 게시판명 출력 부분에 아이콘 출력 함수 추가
[code]
<?php echo $row2['bo_subject'] ?> <?php echo tto_new_icon($row2['bo_table']) ?>
[/code]
관련링크
-
https://sir.kr/g5_tip/1084
15회 연결
- 이전글메뉴 권한(출력여부)설정 추가 24.04.13
- 다음글[비타주리]그누순정용 반응형 미디어 css 23.11.15
댓글목록
등록된 댓글이 없습니다.