1000 정보
1000본문
게시판에 글쓸때 글 본문 부분에
배경에 색넣은 태그를 사용 하고 싶은데 . 안되는데..
태그 넣어도. 글 부분빼고말고. 게시판 전체에 색이 들어가드라구요
php에서 배경색을 다 넣고 싶진 않구요.
어떤 글본문에만 색을 넣어 주고 싶은데.
어떻게 해야 될까요..
이거는 php건들여서 배경을 검으케 만들어 준것입니다.
태그로 할순 없을까요? 다른 태그는 먹히는데. 왜 배경색은 안되나욤.. 

댓글 전체

여분필드를 사용해 보세요.....여분필드로 입력하고 보기화면에서 해당부분의 배경색상을 여분필드 출력값으로 하시면 어떨런지요....?
그렇게 하면 계속 쓰는글마다 색상 적용 되는것 아닌가요?;;
저는 평소엔 화이트 배경으로 가다가.
어떤 글에만 검정 배경으로 가고 싶거든요;; 그래서;
저는 평소엔 화이트 배경으로 가다가.
어떤 글에만 검정 배경으로 가고 싶거든요;; 그래서;

해당 글의 여분필드(wr_1 ~wr_10)를 사용하시면 됩니다. 게시판여분필드(bo_1~bo_10)가 아니고요....
해당 스킨 쓰기폼에서 입력토록 하고 보기스킨에서 출력시키시면 되겠지요.....
해당 스킨 쓰기폼에서 입력토록 하고 보기스킨에서 출력시키시면 되겠지요.....
제가 그런걸할줄 몰라요 ㅠㅠ;;
자세히좀 설명해 주시면 안될까욤;;
자세히좀 설명해 주시면 안될까욤;;

write.skin.php의 예
<tr>
<td style='padding-left:20px; height:30px;'>· 배경색</td>
<td><<input class=ed size=10 name=wr_1 id="wr_s1" itemname="배경색" value="<?=$write[wr_1]?>" maxlength=7 minlength=7>입력예)#ff4080</td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
view.skin.php 상단
$bg_color = ($view[wr_1]) ? $view[wr_1] : "#ffffff"; //배경색을 지정했다면 배경색을 아니면 기본으로 흰색을....
내용부분의 배경색 지정하고 싶은 부분에 bgcolor=<?=$bg_color?>
정도로 하시면 되겠지요. 입력을 셀렉트로하시던지 아니면 라디오 버튼이나 직접입력등은 유저의 선택입니다.
참고할만한 스킨은 제목의 글자색이나 아이콘 표시하는 스킨으로 찾아보시면 적용하시기에 도움이 되실듯 합니다.
<tr>
<td style='padding-left:20px; height:30px;'>· 배경색</td>
<td><<input class=ed size=10 name=wr_1 id="wr_s1" itemname="배경색" value="<?=$write[wr_1]?>" maxlength=7 minlength=7>입력예)#ff4080</td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
view.skin.php 상단
$bg_color = ($view[wr_1]) ? $view[wr_1] : "#ffffff"; //배경색을 지정했다면 배경색을 아니면 기본으로 흰색을....
내용부분의 배경색 지정하고 싶은 부분에 bgcolor=<?=$bg_color?>
정도로 하시면 되겠지요. 입력을 셀렉트로하시던지 아니면 라디오 버튼이나 직접입력등은 유저의 선택입니다.
참고할만한 스킨은 제목의 글자색이나 아이콘 표시하는 스킨으로 찾아보시면 적용하시기에 도움이 되실듯 합니다.
해볼게욤 ^^ !!
write.skin.php에는 적어서 글쓰기 할때 배경색상 입력하는 창이 떳는데욤
view.skin.php 에 어디다 넣어야 될지 모르겠어요 ..ㅡ,ㅡ
제 view.skin.php 내용 입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
body,td,th {
font-size: 12px;
color: #898989;
line-height: 18px;
}
a:link {
color: #898989;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #898989;
}
a:hover {
text-decoration: none;
color: #272B2E;
}
a:active {
text-decoration: none;
color: #898989;
}
.contents {
font-size: 12px;
color: #898989;
line-height: 18px;
}
.bbs_in_de {
font-size: 12px;
font-family: 굴림, Verdana;
line-height: 18px;
color:#CCCCCC;
background-color:#272B2E;
border-top-style: solid 1;
border-right-style: solid 1;
border-left-style: solid 1;
border-bottom-style: solid 1;
border-bottom-width: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-left-width: 0px;
border-top-color: #272B2E;
border-right-color:#272B2E;
border-left-color: #272B2E;
border-bottom-color: #272B2E;
}
.bbs_small {
font-family: verdana;
font-size: 10px;
color: #898989;
}
.bbs_small2 {
font-family: verdana;
font-size: 8px;
color: #898989;
}
</style>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspcing="0" style='word-break:break-all; table-layout:fixed;'><tr><td>
<!-- 링크 버튼 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0>
<tr height=35>
<td width=100%>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td height=2 bgcolor=#F3F3F3></td></tr>
<tr onMouseOver="this.style.backgroundColor='#ffffff';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;"><td height=30 style="padding:5 0 5 0;"> <strong><? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?><?=$view[subject]?></strong></td></tr>
<tr><td height=1 bgcolor=#F3F3F3></td></tr>
<tr onMouseOver="this.style.backgroundColor='#ffffff';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;"><td height=30> <b><span class=bbs_small>Name</span></b> : <?=$view[name]?><span class=bbs_small><? if ($is_ip_view) { echo " ($ip)"; } ?></span>
<b><span class=bbs_small>Date</b> : <?=date("Y/m/d", strtotime($list[$i][wr_datetime]));?></span>
<b><span class=bbs_small>Hit</b> : <?=$view[wr_hit]?></span>
<? if ($is_good) { ?><b><span class=bbs_small>Good</b> : <?=$view[wr_good]?></span> <?}?>
<? if ($is_nogood) { ?><b><span class=bbs_small>Nogood</b> : <?=$view[wr_nogood]?></span> <?}?></td></tr>
<tr><td height=1 bgcolor=#F3F3F3></td></tr>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++)
{
if ($view[file][$i][source] && !$view[file][$i][view])
{
$cnt++;
//echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href='{$view[file][$i][href]}' title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>";
echo "<tr><td height=30> <span class=bbs_small><img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></span></td></tr>";
}
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++)
{
if ($view[link][$i])
{
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "<tr><td height=30> <span class=bbs_small><img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle> <a href='{$view[link_href][$i]}' target=_blank><strong>{$link}</strong> ({$view[link_hit][$i]})</a></span></td></tr>";
}
}
?>
<tr><td height=1 bgcolor=#F3F3F3></td></tr>
<tr onMouseOver="this.style.backgroundColor='#ffffff';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;">
<td height="150" style='word-break:break-all; padding:10px;'>
<div align=center>
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?>
</div>
<div class=contents><?=$view[content];?></div>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
<tr onMouseOver="this.style.backgroundColor='#fcfcfc';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;"><td><? if ($is_signature) { echo "<br>$signature<br><br>"; } // 서명 출력 ?></td></tr>
</table><br>
<?
include_once("./view_comment.php");
?>
<?=$link_buttons?>
</td></tr></table><br>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;
function file_download(link, file)
{
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href = link;
}
</script>
<!-- 게시글 보기 끝 -->
view.skin.php 에 어디다 넣어야 될지 모르겠어요 ..ㅡ,ㅡ
제 view.skin.php 내용 입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<style>
body,td,th {
font-size: 12px;
color: #898989;
line-height: 18px;
}
a:link {
color: #898989;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #898989;
}
a:hover {
text-decoration: none;
color: #272B2E;
}
a:active {
text-decoration: none;
color: #898989;
}
.contents {
font-size: 12px;
color: #898989;
line-height: 18px;
}
.bbs_in_de {
font-size: 12px;
font-family: 굴림, Verdana;
line-height: 18px;
color:#CCCCCC;
background-color:#272B2E;
border-top-style: solid 1;
border-right-style: solid 1;
border-left-style: solid 1;
border-bottom-style: solid 1;
border-bottom-width: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-left-width: 0px;
border-top-color: #272B2E;
border-right-color:#272B2E;
border-left-color: #272B2E;
border-bottom-color: #272B2E;
}
.bbs_small {
font-family: verdana;
font-size: 10px;
color: #898989;
}
.bbs_small2 {
font-family: verdana;
font-size: 8px;
color: #898989;
}
</style>
<!-- 게시글 보기 시작 -->
<table width="<?=$width?>" align="center" cellpadding="0" cellspcing="0" style='word-break:break-all; table-layout:fixed;'><tr><td>
<!-- 링크 버튼 -->
<?
ob_start();
?>
<table width='100%' cellpadding=0 cellspacing=0>
<tr height=35>
<td width=100%>
<? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?>
<? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?>
<? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('$scrap_href');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
<td width=25% align=right>
<? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?>
</td>
</tr>
</table>
<?
$link_buttons = ob_get_contents();
ob_end_flush();
?>
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td height=2 bgcolor=#F3F3F3></td></tr>
<tr onMouseOver="this.style.backgroundColor='#ffffff';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;"><td height=30 style="padding:5 0 5 0;"> <strong><? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?><?=$view[subject]?></strong></td></tr>
<tr><td height=1 bgcolor=#F3F3F3></td></tr>
<tr onMouseOver="this.style.backgroundColor='#ffffff';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;"><td height=30> <b><span class=bbs_small>Name</span></b> : <?=$view[name]?><span class=bbs_small><? if ($is_ip_view) { echo " ($ip)"; } ?></span>
<b><span class=bbs_small>Date</b> : <?=date("Y/m/d", strtotime($list[$i][wr_datetime]));?></span>
<b><span class=bbs_small>Hit</b> : <?=$view[wr_hit]?></span>
<? if ($is_good) { ?><b><span class=bbs_small>Good</b> : <?=$view[wr_good]?></span> <?}?>
<? if ($is_nogood) { ?><b><span class=bbs_small>Nogood</b> : <?=$view[wr_nogood]?></span> <?}?></td></tr>
<tr><td height=1 bgcolor=#F3F3F3></td></tr>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++)
{
if ($view[file][$i][source] && !$view[file][$i][view])
{
$cnt++;
//echo "<tr><td height=22> <img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href='{$view[file][$i][href]}' title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>";
echo "<tr><td height=30> <span class=bbs_small><img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></span></td></tr>";
}
}
// 링크
$cnt = 0;
for ($i=1; $i<=$g4[link_count]; $i++)
{
if ($view[link][$i])
{
$cnt++;
$link = cut_str($view[link][$i], 70);
echo "<tr><td height=30> <span class=bbs_small><img src='{$board_skin_path}/img/icon_link.gif' align=absmiddle> <a href='{$view[link_href][$i]}' target=_blank><strong>{$link}</strong> ({$view[link_hit][$i]})</a></span></td></tr>";
}
}
?>
<tr><td height=1 bgcolor=#F3F3F3></td></tr>
<tr onMouseOver="this.style.backgroundColor='#ffffff';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;">
<td height="150" style='word-break:break-all; padding:10px;'>
<div align=center>
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>";
}
?>
</div>
<div class=contents><?=$view[content];?></div>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
<tr onMouseOver="this.style.backgroundColor='#fcfcfc';return true;" onMouseOut="this.style.backgroundColor='#ffffff';return true;"><td><? if ($is_signature) { echo "<br>$signature<br><br>"; } // 서명 출력 ?></td></tr>
</table><br>
<?
include_once("./view_comment.php");
?>
<?=$link_buttons?>
</td></tr></table><br>
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
var target = document.getElementsByName('target_resize_image[]');
var image_width = parseInt('<?=$board[bo_image_width]?>');
var image_height = 0;
for(i=0; i<target.length; i++) {
// 원래 사이즈를 저장해 놓는다
target[i].tmp_width = target[i].width;
target[i].tmp_height = target[i].height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(target[i].width > image_width) {
image_height = parseFloat(target[i].width / target[i].height)
target[i].width = image_width;
target[i].height = parseInt(image_width / image_height);
}
}
}
window.onload = resize_image;
function file_download(link, file)
{
<? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?>
document.location.href = link;
}
</script>
<!-- 게시글 보기 끝 -->