묻고답하기

리디님 홈에 올린 질문입니다.
리디님 홈 : http://reedyfox.com/bbs/view.php?id=qna&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=840&read.html


바쁘신 것같아서 여기에 다시 질문을 올리니, 도와주시기 바랍니다.
+++++++++++++질문 내용+++++++++++++++
예를 들면, 홈페이지의 배경이든 테이블의 배경이든 아래처럼 쓰면 되는 것으로 알 고 있습니다.
<BODY background="그림주소">

<table background="그림주소">

이렇게 되면, 게시판이 달라지거나 메뉴가 달라질 때마다 새로운 주소나 새로운 그림 이름을 써줘야하는데....
물론 게시판 설정에서도 가능한 것으로 알고 있습니다만, 특정한 테이블의 경우는 제어하지 못해서요.
이게 아니라, 해당 게시판의 이름(id)에 따라 1개의 게시판에 body, table, td에 따라 다른 그림파일을 불러오는 것도
배경 그림을 다르게 가져올 수 있는 방법이 없을까요?

http://www.nzeo.com/bbs/zboard.php?id=cgi_tip&page=2&sn1=&divpage=1&sn=off&ss=on&sc=off&keyword=적용&select_arrange=headnum&desc=asc&no=4575
이 글을 리디님께서 올리셨길래 혹시 방법이 없을까해서 질문드립니다.

++++++++++++++++아래는 리디님 답변 내용++++++++++++++++++

<?php
switch ($id) {
case board1:
$bg_img = "bg1.gif";
$bg_img_td = "bg11.gif";
break;
case board2:
$bg_img = "bg2.gif";
$bg_img_td = "bg21.gif";
break;
case board3:
$bg_img = "bg3.gif";
$bg_img_td = "bg31.gif";
break;
default:
$bg_img = "bg4.gif";
$bg_img_td = "bg41.gif";
}
?>

<body background="http://주소/<?php echo $bg_img; ?>">
<td background="http://주소/<?php echo $bg_img_td; ?>">

++++++++++그래서 아래처럼 테스트 헤더파일을 만들었습니다.
<?
switch ($id) {
cmenu:
$bg_img_td1 = "green.jpg";
break;

}
?>


<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="2005img/<?php echo $bg_img_td1; ?>"></td>
</tr>
<tr>
<td width=800> 보드 삽입

+++안되길래....

  1. 첫째

<?php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="http://주소/2005img/<? php echo $bg_img_td1; ?>">

2. 두번째

<?php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="http://주소/2005img/<? php echo "$bg_img_td1;" ?>">

3. 세 째
<?php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background=http://주소/2005img/<? php echo "$bg_img_td1;" ?>>

4. 네 째
<?
php
switch ($id) {
case cmenu:
$bg_img_td1="gren.jpg";
break;
}
?>

<html>
<HEAD>
<meta http-equiv=Content-Type content=text/html; charset=EUC-KR>
<link rel=StyleSheet HREF=2005renewal/menu2005.css title=style>
</HEAD>

<table border=1 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td width=800 height=200 background="2005img/<? php echo $bg_img_td1; ?>">

===========이렇게 다 해보았는데도 안되네요....
http://www.archistory.org/bbs/zboard.php?id=cmenu
위의 주소처럼 나옵니다...

아무래도 헤더파일에 직접 php를 써서 그런 것같은데요...다른 방법은 없는지....

알려주시면 감사하겠습니다....
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
요플레:) 레이아웃 상단탭 메뉴추가 방법:) [1] 2009.09.30 by 감로수
마파람™ 글쓰기 하면 오류가 뜨면서 안됩니다. [1] file 2009.09.30 by 감로수
도봉인포 RSS리더 설치후...  
솔파도 1.2.5를 새로 설치했는데 xe아래 layouts 이 없네요! 어떻게 해야 하는지요? [2] 2009.09.30 by 너부리야
llppll CafeXE 레이아웃에서 로고 부분 들어가는곳 배경 높이를 수정하려는데요 [1] file 2009.09.30 by jnana
zerozerozero XE2 버전에서요 윗부분 메뉴들과 검색 로그인 항목을 위로 올리고 싶습니다 [1] file 2009.09.30 by 궁금이2
검은토끼 제 레이아웃 css인데요...  
마고 새창 열기에서 레이아웃 미사용으로 열기  
삼미철학 위젯 내용직접추가- 이미지를 넣은 경우 간격조정 [1] file 2009.09.30 by 백성찬
트루너트 새로 바뀐 xe가 이해가 되지 않아요 [1] 2009.09.30 by 백성찬
이정혁466 첨부이미지가 없음 본문에있는 이미자가 나오게 하는 방법좀요 [1] 2009.09.30 by 감로수
張漢 iepngfix 왜 안될까요  
ㅇ1슬♪ 드림위버에서 테이블 테두리요- [2] 2009.09.30 by ss
울산보이 다른계정에 파일을 저장하는 방법  
신재원903 한개의 웹호스팅에 두개 이상의 홈페이지 및 도메인 사용이 가능한가요? [4] 2009.09.30 by 백성찬
소피아7 제발 도와주세요 ㅠㅠ 게시판에서 글쓰기가 안되요  
박성철491 도와주세요. 로그인폼스킨 적용시 CSS 적용안됨 [1] file 2009.09.30 by 백성찬
jubeater 레이아웃 제작 설명 페이지 없나요? [1] 2009.09.30 by 자홍2
요우상 엑세스를 거부한다고 떠요 ㅠㅠㅠ [1] file 2009.09.30 by 백성찬
솔파도 답답하네요! 뭐가 잘못됐는지 도저히 모르겠어요!! ㅠㅠㅠ