보드 스킨폴더내 다른 문서에서 보드 변수 그대로 사용하려면? 정보
보드 스킨폴더내 다른 문서에서 보드 변수 그대로 사용하려면?본문
보드 스킨 폴더안에서..
listall.skin.php 라는 파일을 만든후에..
list.skin.php 내용과 동일한 내용을 넣었습니다.
근데 listall.skin.php 에는 아무것도 표시가 안되네요.
곰곰히 생각해보니..
스킨내에 변수사용이 안되는거라 생각이 들었습니다.
보통 리스트화면으로 가기 위해서는..
board.php?bo_table=보드명 이렇게 이동되는데..
새로만든 파일은..
스킨경로/listall.skin.php 이렇게 링크를 걸었거든요.
그래서 listall.skin.php 위에..
인클루드를 해서도 해보고..
이런식으로
http://스킨경로/listall.skin.php?bo_table=보드명
으로 경로명을 사용해보기도 했는데..
아무것도 표시가 안됩니다.
최종적으로
<?
$g4_path = "../../..";
include_once("$g4_path/_common.php");
include_once("$g4[path]/head.php");
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
?>
이부분은 list.skin.php 내용과 동일
<?include_once("$g4[path]/tail.php");?>
이렇게 까지 했습니다.
그러나 리스트는 나오지 않는데요 ㅡ___ㅡ?
어떻게 해야 스킨폴더내 다른문서에서 보드 변수를 그대로 사용할 수 있나요?
listall.skin.php 라는 파일을 만든후에..
list.skin.php 내용과 동일한 내용을 넣었습니다.
근데 listall.skin.php 에는 아무것도 표시가 안되네요.
곰곰히 생각해보니..
스킨내에 변수사용이 안되는거라 생각이 들었습니다.
보통 리스트화면으로 가기 위해서는..
board.php?bo_table=보드명 이렇게 이동되는데..
새로만든 파일은..
스킨경로/listall.skin.php 이렇게 링크를 걸었거든요.
그래서 listall.skin.php 위에..
인클루드를 해서도 해보고..
이런식으로
http://스킨경로/listall.skin.php?bo_table=보드명
으로 경로명을 사용해보기도 했는데..
아무것도 표시가 안됩니다.
최종적으로
<?
$g4_path = "../../..";
include_once("$g4_path/_common.php");
include_once("$g4[path]/head.php");
// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;
?>
이부분은 list.skin.php 내용과 동일
<?include_once("$g4[path]/tail.php");?>
이렇게 까지 했습니다.
그러나 리스트는 나오지 않는데요 ㅡ___ㅡ?
어떻게 해야 스킨폴더내 다른문서에서 보드 변수를 그대로 사용할 수 있나요?
댓글 전체

새로 만든 파일명을 listall.skin.php 로 하신걸보면 전체리스트를 불러오려고하시는것 같은데...
이 팁을 가공해서 사용하시는것이 더 좋지않을까요?
http://sir.co.kr/bbs/tb.php/g4_tiptech/2561
이 팁을 가공해서 사용하시는것이 더 좋지않을까요?
http://sir.co.kr/bbs/tb.php/g4_tiptech/2561
보통 list화면 처럼 그대로 나오기를 원하는데요.. 알려주신 팁이 좋지만..
제 실력에 사용하기 벅차네요 ㅠ_ㅠ;; 흑;;
제 실력에 사용하기 벅차네요 ㅠ_ㅠ;; 흑;;
1. 질문의 요지가 불분명합니다......
======> 답을 드리기가 어려움(어느정도는 힌트를 주셔야 답이 나오겠지요?)
2. 그누보드 링크 방식은
bbs/board.php의 하단에서 경우에 따라서 경로를 틀려집니다.
(경로가 view.php 나 list.php 나 view_comment.php로)
3. 마찬가지로 위에서 링크된 파일로 가면 하단에 스킨의 어느부분으로 연결하라는 링크가 있습니다.
4. 위의 경우를 무시한 링크라면 백지로 나오는 것은 당연하겠지요~~~~
======> 답을 드리기가 어려움(어느정도는 힌트를 주셔야 답이 나오겠지요?)
2. 그누보드 링크 방식은
bbs/board.php의 하단에서 경우에 따라서 경로를 틀려집니다.
(경로가 view.php 나 list.php 나 view_comment.php로)
3. 마찬가지로 위에서 링크된 파일로 가면 하단에 스킨의 어느부분으로 연결하라는 링크가 있습니다.
4. 위의 경우를 무시한 링크라면 백지로 나오는 것은 당연하겠지요~~~~
네잎클로버님이 도와주셔서 해결한 아까 그 스킨작업입니다 ㅡ__ㅡ;
list.skin.php 를 최신글 뷰화면으로 자동 이동시켰기 때문에..
리스트를 보기 위한것이 필요했습니다.
그래서 한가지 방법은 이전글, 다음글 사이에 1~9까지의 각각의 게시물 이동을 할 수 있게 하는것과
(이건 너무 어려워서 포기)
또한가지 방법은 새로운 리스트파일을 만드는 것이였습니다.
뷰모드에서
목록을 누르면 listall.skin.php 로 이동되서 목록을 보게 하려고 했는데요.
http://totorolife.com/bbs/bbs/board.php?bo_table=study_woo&wr_id=5
여기 가보시면 본문프린트라고 있는데요. 이 파일 같은 경우에는 본문내용이 제목등을 그대로 가져오길래..
새로 파일 생성해도 되는줄 알았습니다.
그런데 막상 새 파일을 만들고 보니 ㅡ_ㅡ; 안되는 거였습니다.
포토플라이님이 알려준 팁의 경우에는 게시물을 추출해서 가져올수는 있지만..
1~10까지의 페이지 표시가 불가능 하기 때문에..
스킨폴더내 다른 문서에서 리스트목록을 가져오거나 변수를 그대로 사용할 수 있는지?에 대한
질문을 한것입니다.
휴 ㅡ_ㅡ; 괜히 어려운걸 하는게 아닌가 싶습니다 ;;;
list.skin.php 를 최신글 뷰화면으로 자동 이동시켰기 때문에..
리스트를 보기 위한것이 필요했습니다.
그래서 한가지 방법은 이전글, 다음글 사이에 1~9까지의 각각의 게시물 이동을 할 수 있게 하는것과
(이건 너무 어려워서 포기)
또한가지 방법은 새로운 리스트파일을 만드는 것이였습니다.
뷰모드에서
목록을 누르면 listall.skin.php 로 이동되서 목록을 보게 하려고 했는데요.
http://totorolife.com/bbs/bbs/board.php?bo_table=study_woo&wr_id=5
여기 가보시면 본문프린트라고 있는데요. 이 파일 같은 경우에는 본문내용이 제목등을 그대로 가져오길래..
새로 파일 생성해도 되는줄 알았습니다.
그런데 막상 새 파일을 만들고 보니 ㅡ_ㅡ; 안되는 거였습니다.
포토플라이님이 알려준 팁의 경우에는 게시물을 추출해서 가져올수는 있지만..
1~10까지의 페이지 표시가 불가능 하기 때문에..
스킨폴더내 다른 문서에서 리스트목록을 가져오거나 변수를 그대로 사용할 수 있는지?에 대한
질문을 한것입니다.
휴 ㅡ_ㅡ; 괜히 어려운걸 하는게 아닌가 싶습니다 ;;;
결론은 먼저번의 문제된 부분을 사용하면서 아래에 전체 목록은 나타나야 한다는(?) 것으로 이해해도 문제가 많이 복잡해 지네요.....차라리 해당 게시판 리스트 화면은 그대로 두고 그 리스트 상단에 본 게시판의 최신글 1개를 본문까지 쫙 뽑는게 좋을듯 합니다. 링크로 들어와도 최신글 1개가 상단에 보이겠지요.....
물론 리스트에서 보여지는 보기화면이라면 위의 최신글은 안보이고요......^^
조금은 힌트가 되었는지 모르겠습니다.
물론 리스트에서 보여지는 보기화면이라면 위의 최신글은 안보이고요......^^
조금은 힌트가 되었는지 모르겠습니다.
네잎클로버님 힌트데로 해보았는데요. 잘 생각해보니 코멘트랄지 등등 사용못하는 경우가 생기네요.
그리고 중요한것은 본문 모양 그대로 가져오는것이 안되네요;;
정말 궁금한 한가지가 있는데요.
스킨폴더내에 있는 print_view.php 에서는 왜 변수가 먹히는건가요?
내용은 아래와 같습니다.
------------------------------------------------------------------------------------------------------------------------------------------
<?
$g4_path = "../../..";
include_once("$g4_path/common.php");
include_once("$g4[path]/head.sub.php");
$view = get_view($write, $board, $board_skin_path);
if (strstr($sfl, "subject"))
$view[subject] = search_font($stx, $view[subject]);
$html = 0;
if (strstr($view[wr_option], "html1"))
$html = 1;
else if (strstr($view[wr_option], "html2"))
$html = 2;
$view[content] = conv_content($view[wr_content], $html);
if (strstr($sfl, "content"))
$view[content] = search_font($stx, $view[content]);
$view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $view[content]);
?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<!-- <link rel='stylesheet' href='<?=$board_skin_path?>/style01.css' type='text/css'> -->
<style>
a:link, a:visited, a:active {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;}
a:hover {font-family:Tahoma,굴림,arial; color:#FF0000; font-size:12px;}
.content {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;} /* 내용보기에서 본문 */
.sub_tt {font-family:Tahoma,굴림,arial; color:#666666; font-size:11px;}
.lh { line-height:130%; } /* 내용보기에서 줄간격 */
</style>
<br>
<!-- //--{본문내용}--// -->
<table width=95% border=0 align=center cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=2 bgcolor='#cccccc'></td></tr>
<tr><td colspan=2 height=30 class=content> 제목 : <b><?=$view[subject]?></b></td></tr>
<tr><td colspan=2 height=2 bgcolor='#cccccc'></td></tr>
<tr>
<td height=22 width=50% class=content align=left> 이름 : <?=$view[name]?></td>
<td width=50% align=right class='sub_tt'>Date : <?=substr($view[wr_datetime],2,14)?></td>
</tr>
<tr><td colspan=2 height=1 bgcolor='#cccccc'></td></tr>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
if ($view[file][$i][source] && !$view[file][$i][view]) {
// 새창에서 파일다운로드시, 파일경로
$view[file][$i][href] = "{$g4[bbs_path]}/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr;
$cnt++;
echo "
<tr>
<td height=22 colspan=2>
<span class='sub_tt'>FILE #{$cnt} :</span>
<a href='{$view[file][$i][href]}'>{$view[file][$i][source]}</a>
<span class='sub_tt'>({$view[file][$i][size]}), Down:{$view[file][$i][download]}, {$view[file][$i][datetime]}</span>
</td></tr>
<tr><td colspan=2 height=1 bgcolor='#cccccc'></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=22 colspan=2>
<span class='sub_tt'>LINK #{$cnt} :</span>
<a class='v1' href='{$view[link_href][$i]}' target='_blank'>{$link}</a>
<span class='sub_tt'>({$view[link_hit][$i]})</span>
</td></tr>
<tr><td colspan=2 height=1 bgcolor='#cccccc'></td></tr>
";
}
}
?>
<tr>
<td colspan=2>
<table width=100% cellpadding=5>
<tr>
<td style='word-break:break-all;' class='lh' height=100>
<!-- 사용안함
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>" . $view[file][$i][content] . "<p>";
}
?>
-->
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$image_file="{$view[file][$i][view]}"; //<P>태그 삭제
$image_pos="<그림".($i+1).">";
$image_pos2="<그림".($i+1).">"; //추가
//수정
if( strstr($view[content],$image_pos) || strstr($view[content],$image_pos2) ){
$pattern="/($image_pos|$image_pos2)/";
$view[content]=preg_replace($pattern,$image_file,$view[content]);
}
else echo $view[file][$i][view] . "<p>";
}
}
?>
<span class="ct lh"><?=$view[content];?></span>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 -->
</xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
<? if ($is_signature) { echo "<tr><td>$signature</td></tr>"; } // 서명 출력 ?>
</table>
</td>
</tr>
<tr><td colspan='100' height='1' bgcolor='#cccccc'></td></tr>
</table>
<!-- //--{본문내용 끝}--// -->
<table width=95% border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td colspan=2 height="35" align="center"><b>+ <a href=javascript:self.close()><span style="font-size:9pt;">창닫기</span></a> <span style="font-size:9pt;">+ <a href="javascript:window.print();">프린트하기</a></span></b>
</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;
</script>
---------------------------------------------------------------------------------------------------------
http://totorolife.com/bbs/bbs/board.php?bo_table=study_woo&wr_id=5 여기서
본문 프린트 해보시면 됩니다.
ㅡ___ㅡ;
그리고 중요한것은 본문 모양 그대로 가져오는것이 안되네요;;
정말 궁금한 한가지가 있는데요.
스킨폴더내에 있는 print_view.php 에서는 왜 변수가 먹히는건가요?
내용은 아래와 같습니다.
------------------------------------------------------------------------------------------------------------------------------------------
<?
$g4_path = "../../..";
include_once("$g4_path/common.php");
include_once("$g4[path]/head.sub.php");
$view = get_view($write, $board, $board_skin_path);
if (strstr($sfl, "subject"))
$view[subject] = search_font($stx, $view[subject]);
$html = 0;
if (strstr($view[wr_option], "html1"))
$html = 1;
else if (strstr($view[wr_option], "html2"))
$html = 2;
$view[content] = conv_content($view[wr_content], $html);
if (strstr($sfl, "content"))
$view[content] = search_font($stx, $view[content]);
$view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='image_window(this)' style='cursor:pointer;' \\2 \\3", $view[content]);
?>
<script language="javascript" src="<?=$g4[path]?>/js/sideview.js"></script>
<!-- <link rel='stylesheet' href='<?=$board_skin_path?>/style01.css' type='text/css'> -->
<style>
a:link, a:visited, a:active {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;}
a:hover {font-family:Tahoma,굴림,arial; color:#FF0000; font-size:12px;}
.content {font-family:Tahoma,굴림,arial; color:#666666; font-size:12px;} /* 내용보기에서 본문 */
.sub_tt {font-family:Tahoma,굴림,arial; color:#666666; font-size:11px;}
.lh { line-height:130%; } /* 내용보기에서 줄간격 */
</style>
<br>
<!-- //--{본문내용}--// -->
<table width=95% border=0 align=center cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=2 bgcolor='#cccccc'></td></tr>
<tr><td colspan=2 height=30 class=content> 제목 : <b><?=$view[subject]?></b></td></tr>
<tr><td colspan=2 height=2 bgcolor='#cccccc'></td></tr>
<tr>
<td height=22 width=50% class=content align=left> 이름 : <?=$view[name]?></td>
<td width=50% align=right class='sub_tt'>Date : <?=substr($view[wr_datetime],2,14)?></td>
</tr>
<tr><td colspan=2 height=1 bgcolor='#cccccc'></td></tr>
<?
// 가변 파일
$cnt = 0;
for ($i=0; $i<count($view[file]); $i++) {
if ($view[file][$i][source] && !$view[file][$i][view]) {
// 새창에서 파일다운로드시, 파일경로
$view[file][$i][href] = "{$g4[bbs_path]}/download.php?bo_table=$bo_table&wr_id=$wr_id&no=$no" . $qstr;
$cnt++;
echo "
<tr>
<td height=22 colspan=2>
<span class='sub_tt'>FILE #{$cnt} :</span>
<a href='{$view[file][$i][href]}'>{$view[file][$i][source]}</a>
<span class='sub_tt'>({$view[file][$i][size]}), Down:{$view[file][$i][download]}, {$view[file][$i][datetime]}</span>
</td></tr>
<tr><td colspan=2 height=1 bgcolor='#cccccc'></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=22 colspan=2>
<span class='sub_tt'>LINK #{$cnt} :</span>
<a class='v1' href='{$view[link_href][$i]}' target='_blank'>{$link}</a>
<span class='sub_tt'>({$view[link_hit][$i]})</span>
</td></tr>
<tr><td colspan=2 height=1 bgcolor='#cccccc'></td></tr>
";
}
}
?>
<tr>
<td colspan=2>
<table width=100% cellpadding=5>
<tr>
<td style='word-break:break-all;' class='lh' height=100>
<!-- 사용안함
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view])
echo $view[file][$i][view] . "<p>" . $view[file][$i][content] . "<p>";
}
?>
-->
<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$image_file="{$view[file][$i][view]}"; //<P>태그 삭제
$image_pos="<그림".($i+1).">";
$image_pos2="<그림".($i+1).">"; //추가
//수정
if( strstr($view[content],$image_pos) || strstr($view[content],$image_pos2) ){
$pattern="/($image_pos|$image_pos2)/";
$view[content]=preg_replace($pattern,$image_file,$view[content]);
}
else echo $view[file][$i][view] . "<p>";
}
}
?>
<span class="ct lh"><?=$view[content];?></span>
<?//echo $view[rich_content]; // {이미지:0} 과 같은 코드를 사용할 경우?>
<!-- 테러 태그 방지용 -->
</xml></xmp><a href=""></a><a href=''></a>
</td>
</tr>
<? if ($is_signature) { echo "<tr><td>$signature</td></tr>"; } // 서명 출력 ?>
</table>
</td>
</tr>
<tr><td colspan='100' height='1' bgcolor='#cccccc'></td></tr>
</table>
<!-- //--{본문내용 끝}--// -->
<table width=95% border=0 align=center cellpadding=0 cellspacing=0>
<tr>
<td colspan=2 height="35" align="center"><b>+ <a href=javascript:self.close()><span style="font-size:9pt;">창닫기</span></a> <span style="font-size:9pt;">+ <a href="javascript:window.print();">프린트하기</a></span></b>
</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;
</script>
---------------------------------------------------------------------------------------------------------
http://totorolife.com/bbs/bbs/board.php?bo_table=study_woo&wr_id=5 여기서
본문 프린트 해보시면 됩니다.
ㅡ___ㅡ;
$g4_path = "../../..";
include_once("$g4_path/common.php");
include_once("$g4[path]/head.sub.php");
$view = get_view($write, $board, $board_skin_path);
을 보시고 따라가 보시면 답이 나옵니다
include_once("$g4_path/common.php");
include_once("$g4[path]/head.sub.php");
$view = get_view($write, $board, $board_skin_path);
을 보시고 따라가 보시면 답이 나옵니다

힌트만 드린다면
리스트를 불러오는것은 bbs/list.php 파일이거든요..
list.skin.php 파일은 bbs/list.php 파일에 인크루드 되어보여주기만 하는것이구요..
위의 두 파일을 하나로 합쳐서 만들어 보세요..^^
리스트를 불러오는것은 bbs/list.php 파일이거든요..
list.skin.php 파일은 bbs/list.php 파일에 인크루드 되어보여주기만 하는것이구요..
위의 두 파일을 하나로 합쳐서 만들어 보세요..^^
흑; 너무나 멀고도 먼 산인가 봅니다.
잠시 쉬면서 ㅠ_ㅠ; 정리를 좀 해봐야 겠습니다.
잠시 쉬면서 ㅠ_ㅠ; 정리를 좀 해봐야 겠습니다.
알려주신 것으로 이리저리 수정해보겠습니다.
근데 좀전에 제가 원하는 것과 가장 비슷한 게시물을 찾았습니다.
페이지 처리도 되고..
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/2572
날짜 | 카테고리명 | 제목
날짜 | 카테고리명 | 제목
날짜 | 카테고리명 | 제목
이런식으로 정렬되고 하단에는 페이지 처리되고..
그러면 딱인데 ㅠ_ㅠ; 하여간 삽질 계속 해볼께요.
답글 계속 주셔서 너무 감사해요~~~
근데 좀전에 제가 원하는 것과 가장 비슷한 게시물을 찾았습니다.
페이지 처리도 되고..
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/2572
날짜 | 카테고리명 | 제목
날짜 | 카테고리명 | 제목
날짜 | 카테고리명 | 제목
이런식으로 정렬되고 하단에는 페이지 처리되고..
그러면 딱인데 ㅠ_ㅠ; 하여간 삽질 계속 해볼께요.
답글 계속 주셔서 너무 감사해요~~~