유용한 팁 공유 게시판
팁공유라고 해서 아주 특별하거나 기발한거 아니어도 됩니다.
자신이 제로보드를 사용하면서 생긴 자신만의 노하우나 아주 사소한 팁이어도 좋습니다.
자신에겐 아무것도 아니더라도 다른분들께는 분명 중요하고 소중한 팁이 될수 있을겁니다.
게시판에 new 아이콘 나타내기
<?
// new 아이콘
$reg_date="<span title='".date("Y? m? d? H? i? s?", $data[reg_date])."'>".date("Y/m/d", $data[reg_date])."</span>";
$date=date("Y-m-d H:i:s", $data[reg_date]);
$new = " ";
$check_time=(time()-$data[reg_date])/60/60;
if($check_time>24)$new.=" "; // 24시간안에 게시물을 쓸경우 표시,시간은 맘데로 조정하세요.
if($check_time<=24)$new.="<img src=new.gif border=0>";
//cool 아이콘
$cool="";
if($hit>=10 & $hit<=29)$cool.="<img src=cool.gif border=0>"; //게시물10번이상 클릭할경우cool아이콘출력
if($hit>=30)$cool.="<img src=hot.gif border=0>"; //게시물30번이상 클릭할경우hot아이콘출력,
// 출력횟수는 php연산자(<>=.....)를 이용하여 각자에 맞게 횟수를 고쳐 쓰세요.
?>
위부분을
skin폴더에서 관리자게시판에서 선택한 게시판 스킨폴더로 들어가서
list_main.php 파일 열으시고
맨 윗부분에 붙여넣기 하세요.
.="<img src=new.gif border=0>";
.="<img src=cool.gif border=0>";
.="<img src=hot.gif border=0>";
이미지 3개를 각자 이쁘게 만드셔셔 bbs폴더에 올리세요.
그리고 밑 부분을 보시면
<td valign="top"><b>
<?=$subject?><?=$new?><?=$cool?> //게시판에서 글 제목 뒤에 아이콘이 출력됩니다.
</b> <font class=daerew_s>
<?=$comment_num?>
</font></td>
아이콘을 나타 내고저 하는 위치에 <?=$new?> <?=$cool?> 을 붙여넣기하세요
new아이콘,cool아이콘 쓰고 싶으신것만 쓰시고 필요없으시면 삭제 하셔셔 사용하세요.
다른분들 것을 참고하여 제가 필요하게 고친것입니다.
http://www.hwf.co.kr/bbs/zboard.php?id=shangpin_view (제가 사용하는 예)
최근게시물에 new 아이콘 나타내기
먼저 제로보드 bbs의 outlogin.php을 엽니다...
이부분을 찾습니다.
while($data=mysql_fetch_array($result)) {
$name = stripslashes($data[name]);
$subject = cut_str(stripslashes($data[subject]),$textlen)."</font></b>";
$date = date($datetype, $data[reg_date]);
if($data[total_comment]) $comment = "[".$data[total_comment]."]"; else $comment="";
// 이부분 복사하기시작
$new = " ";
$check_time=(time()-$data[reg_date])/60/60;
if($check_time>24)$new.= ""; // 24시간안에 게시물을 쓸경우 표시,시간은 맘데로 조정하세요.
if($check_time<=24)$new.="<img src=new.gif border=0>"; //이미지 경로는 bbs폴더 안에 index가있는곳에 업로드
// 이부분 복사하기끝(첫번째로 이부분을 중간에 복사하여 추가 하세요.)
$main = $loop;
$main = str_replace("[new]", $new, $main); //두번째로 이부분 복사하여$main = str_replace행 아무데나 붙여넣기
$main = str_replace("[name]",$name,$main);
$main = str_replace("[date]",$date,$main);
$main = str_replace("[subject]","<a href='".$_zb_url.$target."&no=$data[no]'>".$subject."</a>",$main);
$main = str_replace("[comment]",$comment,$main);
$main_data .= "\n".$main;
}
$list = $header.$main_data.$footer;
$list = str_replace("[title]","<a href='".$_zb_url."zboard.php?id=".$id."'>".$title."</a>",$list);
$list = str_replace("[dir]",$_zb_url."latest_skin/".$skinname."/images/",$list);
echo $list;
}
붙여넣기 하셨으면 outlogin.php 저장 하시고
세번째로
최근게시물 스킨의 main.html을 열고 원하는 곳에 [new]라고 써 넣습니다.
<table border=0 width=330 cellspacing=0 cellpadding=0>
[loop]
<tr>
<td height=22 valign="middle"> <font face="Wingdings">w</font> [subject][comment][new]</td>
</tr>
<tr>
<td>
<table style="border-bottom:dotted 1 #cccccc;" width=100% cellspacing=0 cellpadding=0 border=0>
<tr>
<td height="1"></td>
</tr>
</table>
</td>
</tr>
[/loop]
</table>
main.html 파일은 제가 쓰고 있어서 경로를 예를 들었습니다.
/bbs/latest_skin/default/bbs_01
각자 자신이 쓰시는 스킨에 붙여넣기 하시면 됩니다.
다른분들 것을 참고하여 제가 필요하게 고친것입니다.
http://www.hwf.co.kr/bbs/index.php (제가 사용하는 예)
메뉴에 new 아이콘 나타내기
<?
$_zb_url = "제로보드가 설치된 url";
$_zb_path = "제로보드가 설치된 절대경로";
include $_zb_path."outlogin.php"; //각자에 맞게 제로보드경로를 페이지 상단에 넣어주세요.
?>
// 아래 부분을 바로 밑에 붙여넣기 하세요.
<?
function list_new($zb_id) {
global $connect, $t_board;
$new_icon = "<img src=bbs/new1.gif border=0>"; //본인의 이미지 경로
$recent_time = 60*60*24; //24안에 올라온 게시물,시간은 본인이 알아서 바꾸세요.
$data=mysql_fetch_array(mysql_query("select reg_date from $t_board"."_".$zb_id." order by no desc limit 1", $connect));
$reg_time = $data[reg_date];
if(time() - $reg_time < $recent_time) echo "$new_icon";
}
?>
//여기까지
본인이 사용하는 메뉴 리스트에 <? list_new(ch_spoon_chop) ?> 을 옆 붙여넣기하세요.
<? list_new(본인의 게시판 ID) ?>
아래는 제가 사용하는 예를 들었습니다.
프리보드라는 메뉴 옆에 아이콘이 출력 되게 만들었습니다.
<a href="http://www.hwf.co.kr/bbs/zboard.php?&id=ch_spoon_chop" target="main">
프리보드</a> <? list_new(ch_spoon_chop) ?>
다른분들 것을 참고하여 제가 필요하게 고친것입니다.
http://www.hwf.co.kr/m_products.htm (제가 사용하는 예)
이미지 첨부했으니 필요하시면 받아 쓰세요.
skin폴더에서 관리자게시판에서 선택한 게시판 스킨폴더가 어디있는지 모르겠어요. 스킨폴더에는 그냥 스킨들만 있는데
각각의 게시판 스킨들 속에 있다는건지 아님 bbs에서 찾아야 하는건지 모르겠네요.
이어서
그리고 밑 부분을 보시면
<td valign="top"><b>
<?=$subject?><?=$new?><?=$cool?> //게시판에서 글 제목 뒤에 아이콘이 출력됩니다.
</b> <font class=daerew_s>
<?=$comment_num?>
</font></td>
라고 나오는데 list_main.php에 저런 주석이 달린곳이 없는데 어떻하죠?
<?
if($member[level]<=$setup[grant_view]||$is_admin) {
$comment_num="$data[total_comment]";
/* Check New Comment <?=$comment_new?> */
if(!$comment_num==0) {
$last_comment = mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date desc limit 1"));
$last_comment_time = $last_comment['reg_date'];
if(time()-$last_comment_time<60*60*12) $comment_new = " <font class=comment12>[".$comment_num."]</font>";
elseif(time()-$last_comment_time<60*60*24) $comment_new = " <font class=comment24>[".$comment_num."]</font>";
else $comment_new = " <font class=comment>[".$comment_num."]</font>";
}
else $comment_new = "";
}
else {
$comment_num="$data[total_comment]";
/* Check New Comment <?=$comment_new?> */
if(!$comment_num==0) {
$last_comment = mysql_fetch_array(mysql_query("select * from $t_comment"."_$id where parent='$data[no]' order by reg_date desc limit 1"));
$last_comment_time = $last_comment['reg_date'];
if(time()-$last_comment_time<60*60*12) $comment_new = " <font class=comment12>[".$comment_num."]</font>";
elseif(time()-$last_comment_time<60*60*24) $comment_new = " <font class=comment24>[".$comment_num."]</font>";
else $comment_new = " <font class=comment>[".$comment_num."]</font>";
}
else $comment_new = "";
}
$subject = str_replace(">","><font class=t_list>",$subject);
$name= str_replace(">","><font class=t_name>",$name);
$date="<span title='".date("Y년 m월 d일 D H시 i분 s초", $data[reg_date])."'><font class=t_date>".date("y.m.d", $data[reg_date])."</font></span>";
?>
<tr align=center class=listline onmouseover="this.style.backgroundColor='f7f7f7'" onmouseout="this.style.backgroundColor=''">
<td></td>
<td class=t_num><?=$number?></td>
<td align=left nowrap class=t_list>
<?=$hide_cart_start?><input type=checkbox name=cart value="<?=$data[no]?>"><?=$hide_cart_end?>
<?=$insert?><?=$icon?><?=$hide_category_start?><?=$category_name?> | <?=$hide_category_end?>
<?=$subject?> <?=$comment_new?></td>
<td style='padding-top:3;' class=t_name><nobr><?=$face_image?> <?=$name?></nobr></td>
<td nowrap><?=$date?></td>
<td nowrap class=t_num><?=$hit?></td>
<td></td>
</tr>
<tr>
<td class='bar1' colspan=7></td>
</tr>
좋은 소스라 사용하고 싶은데....저는 <?=$subject?> 없어요...ㅠㅠ
스킨은 DQ'Style 님의 갤러리 스킨인데....소스 올릴께요 좀 봐주세요
<?
if(!file_exists(getcwd().'/zboard.php')) die("정상적인 접근이 아닙니다.");
// 코멘트 재설정
$css = (get_newComment($data[no]))? 'list_comment2' : 'list_comment';
$comment_num = ($comment_num) ? '<font class='.$css.'> '.$data[total_comment].' </font>' : '';
//$comment_num = ($comment_num) ? " <font class=list_comment>$comment_num</font>" : '';
// 제목 재설정
$chk_subj = cut_str($data[subject],$setup[cut_length]);
$subject = str_replace(" >$chk_subj"," ><font class=thumb_list_title>$chk_subj</font>",$subject);
// 재설정
$category_name = "<font class=thumb_list_cate>".$category_name;
$name = str_replace('>'.$data[name].'<','><font class=thumb_list_name style=font-weight:normal>'.$data[name].'</font><',$name);
if(!$setup[use_alllist]) $_zb_exec="view.php"; else $_zb_exec="zboard.php";
//$subject = $subject."</font></b>";
if($_notice_visible) {
echo "<img src=$dir/t.gif border=0 height=10>\n";
$_notice_visible = false;
}
if($su=="on" && $keyword) {
$show_name_old=$skin_setup['show_name'];
$skin_setup['show_name']=false;
}
unset($thumb_x);
unset($thumb_y);
$_xx++;
$_hcol++;
$_temp = ($_xx) % $skin_setup['thumb_hcount'];
if($skin_setup['thumb_hcount'] == '1') $_temp = '1';
if ($_temp==1) {?>
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<?}
if($skin_setup['thumb_hcount'] == '1') $_temp = '0';
// 썸네일 설정
$dqEngine['thumb_resize'] = isset($skin_setup['thumb_resize'])? $skin_setup['thumb_resize'] : 0;
// 섬네일 생성
$thumb_tag = get_thumbTag($data,$skin_setup['thumb_imagex'],$skin_setup['thumb_imagey'],$dir);
$thumb_frame = $skin_setup['thumb_frame_width'];
$thumb_bPadding = ($thumb_frame == 1)? 0 : $thumb_frame;
if($thumb_frame) {
$border_tag = "<div class='thumb_frame' style='width:$thumb_tag[0];height:$thumb_tag[1]; padding:".$thumb_bPadding."px'>[THUMB_TAG]</div>";
}
// 섬네일이 들어가는 셀의 크기계산
$_ta_width = 100/$skin_setup['thumb_hcount'];
// 섬네일 세로정렬에 따른 셀 높이 계산
if($skin_setup[thumb_valign] != "top") $th_height = $skin_setup[thumb_imagey]+2+$add_bPixel+($thumb_bPadding*2);
// 섬네일 정렬에 따른 여백 계산
if($skin_setup['thumb_align'] == 'left')
$_thumb_area_padding = "padding-right:10px;";
if($skin_setup['thumb_align'] == 'right')
$_thumb_area_padding = "padding-left:10px;";
if($skin_setup['thumb_align'] == 'center')
$_thumb_area_padding = "padding-left:10px;padding-right:10px;";
// 새 창으로 띄우기 위한 원본 이미지파일 결정
if($skin_setup[using_newWindow]) {
if(!$_zb_url) $_zb_url = str_replace(basename($PHP_SELF),"",$PHP_SELF);
// 업로드된 이미지 목록가져오기
$tmp = get_uploadImages($data,1);
if($tmp[0][0]) $tfile = $_zb_url.$tmp[0][0]; else $tfile = "";
// 업로드파일이 없을경우 HTML태그 분석
if(!$tfile) {
$tfile = get_imgTag($data[memo]);
$tfile = get_urlPath($tfile[0]);
$tfile = str_replace("&","dq_amp_temp",$tfile);
}
// 이미지 파일을 못찾았을때
if(!$tfile) $_thumbnail_tag = $thumb_tag[2];
// 이미지 파일을 찾았을때
else $_thumbnail_tag = "<a href=# onclick=\"view_img('$tfile','$data[ismember]','$dir','$id')\">$thumb_tag[2]</a>";
} else {
if($setup[grant_view]<$member[level]&&!$is_admin) $_thumbnail_tag = "<a href=# onClick=\"alert('".$_strSkin[is_secret]."')\" onfocus=blur()>$thumb_tag[2]</a>";
else $_thumbnail_tag = "<a href=$_zb_exec?$href&$sort&no=$data[no] onfocus=blur()>$thumb_tag[2]</a>";
}
if($thumb_frame) {
$_thumbnail_tag = str_replace('[THUMB_TAG]',$_thumbnail_tag,$border_tag);
}
?>
<td width="<?=$_ta_width?>%" valign="top">
<table border="0" cellspacing="0" cellpadding="0" style="table-layout:fixed;" width="100%">
<tr><td style="<?=$_thumb_area_padding?>" height="<?=$th_height?>" align="<?=$skin_setup['thumb_align']?>" valign="<?=$skin_setup['thumb_valign']?>"><?=$_thumbnail_tag?></td>
</tr>
<?
if($skin_setup[show_thumbInfo]) {
include $dir."/include/analysis_01.php";
?>
<tr align=<?=$skin_setup['thumb_align']?>>
<td style="padding-top:6px;line-height:120%;<?=$_thumb_area_padding?>">
<?=$tInfo?>
</td></tr>
<? } ?>
</table>
</td>
<?if (!$_temp) {?>
</tr>
<tr><td colspan=<?=$_hcol?> height=30 class=thumb_area_bg></td></tr>
</table>
<?$_hcol=0;?>
<?
}
if($su=="on" && $keyword) {
$skin_setup['show_name']=$show_name_old;
}
// 썸네일 설정
$dqEngine['thumb_resize'] = '';
?>



