최신글 소스에 가격을 뽑아 오고 싶은데요... 정보
최신글 소스에 가격을 뽑아 오고 싶은데요...본문
아래 제가 물은 질문에 도우미님께서 도움을 주셨는데요..제가 아무것도 모르는 초보라서 다시한번 ....질문드릴꼐요..
상품등록 게시판에서 가격을 뽑아 올려고 하거든요(기존 최신글 스킨에서)
==========================================
도우미님 답변에서....
latest.skin.php 불필요한 코드는 제외 하였습니다. ^ ^
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<? for ($i=0; $i<count($list); $i++) { ?>
<div style='word-break:break-all;height:20px;padding:0 0 0 5px;'>
<?
echo "{$list[$i][wr_4]}";
?>
</div>
<? } ?>
================================================================
이렇게 답변을 주셨는데요......
좀 길지만 제가 최근 게시물 뽑아올때 쓸소스 전체를 넣겠습니다...
==============================================================
<?
$g4_path = ".";
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once("$g4_path/_common.php");
list($height, $row_cnt) = explode(",", $options);
$all_cnt = 0;
?>
<link rel='stylesheet' type='text/css' href='./mall_style.css'>
<script src='../mall/html.js'></script>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='left'>
<form name=fmallbuy method=post action="javascript:fmallbuy_submit(document.fmallbuy)" enctype="multipart/form-data">
<input type=hidden name="bo_table" value="<?=$bo_table?>">
<input type=hidden name="wr_id" value="<?=$wr_id?>">
<input type=hidden name="mo_name" value="<?=$mo_name?>">
<input type=hidden name="mo_hp" value="<?=$mo_hp?>">
<input type=hidden name="mo_address" value="<?=$mo_address?>">
<input type=hidden name="se_id" value="<?=$bo_mall[mb_id]?>">
<input type=hidden name="mo_cash" value="<?=$mo_cash?>">
<input type=hidden name="mo_point" value="<?=$mo_point?>">
<input type=hidden name="mo_cnt" value="<?=$mo_cnt?>">
<input type=hidden name="mo_msg" value="<?=$mo_msg?>">
<tr><td align='center'>
<table width='100%' border='0' cellspacing='0' cellpadding='0' align='left'>
<tr>
<td width='226'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font color=#000000><?=$board[bo_subject]?></font></a></strong></td>
<td width='49'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
</tr>
<tr>
<td colspan=2 height=2 bgcolor='#b5a789'></td>
</tr>
</table>
</td></tr>
<tr><td align='center'>
<table width='95%'>
<? for ($k=0; $k<$row_cnt; $k++ ) { ?>
<tr>
<?
for ($i=0; $i<count($list)/$row_cnt; $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$all_cnt][wr_subject]);
$content = cut_str(get_text($list[$all_cnt][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
if (!file_exists($img) || !$list[$all_cnt][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='<?=$subject_len?>' valign='top' align='center'>
<table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='<?=$height?>' align='center'>
<div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a>
</div>
<td width=32></td><td width=5><img src='./img/bgline.gif'></td><td width=5></td>
</td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$list[$all_cnt][subject]}</a></td>
</tr>
<tr>
<td>
//이곳에 가격을 뽑아 오고 싶습니다....===========
</td>
</tr>
</table>
</td>
HEREDOC;
$all_cnt++;
}
?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align='center' height=25>게시물이 없습니다.</td></tr>
<? } ?>
</table>
</td></tr>
</form>
</table>
=======================================================
하단부 //이곳에 가격을 뽑아 오고 싶습니다....===========표시에 가격을 뽑아 오고 싶습니다... 도우미님 코드를 그대로 넣어서 출력 했을때는 가격이 정확히 나옵니다...
근데..제가 이리저리 해봐도...위 최신글 소스와 합치니 가격은 않나옵니다...
제발좀 도와주세요 ...어느부분에 어떻게 넣어야 하는지요..
상품등록 게시판에서 가격을 뽑아 올려고 하거든요(기존 최신글 스킨에서)
==========================================
도우미님 답변에서....
latest.skin.php 불필요한 코드는 제외 하였습니다. ^ ^
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<? for ($i=0; $i<count($list); $i++) { ?>
<div style='word-break:break-all;height:20px;padding:0 0 0 5px;'>
<?
echo "{$list[$i][wr_4]}";
?>
</div>
<? } ?>
================================================================
이렇게 답변을 주셨는데요......
좀 길지만 제가 최근 게시물 뽑아올때 쓸소스 전체를 넣겠습니다...
==============================================================
<?
$g4_path = ".";
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once("$g4_path/_common.php");
list($height, $row_cnt) = explode(",", $options);
$all_cnt = 0;
?>
<link rel='stylesheet' type='text/css' href='./mall_style.css'>
<script src='../mall/html.js'></script>
<!-- <?=$board[bo_subject]?> (<?=$board[bo_table]?>) 최신글 -->
<table width='100%' cellpadding='0' cellspacing='0' border='0' align='left'>
<form name=fmallbuy method=post action="javascript:fmallbuy_submit(document.fmallbuy)" enctype="multipart/form-data">
<input type=hidden name="bo_table" value="<?=$bo_table?>">
<input type=hidden name="wr_id" value="<?=$wr_id?>">
<input type=hidden name="mo_name" value="<?=$mo_name?>">
<input type=hidden name="mo_hp" value="<?=$mo_hp?>">
<input type=hidden name="mo_address" value="<?=$mo_address?>">
<input type=hidden name="se_id" value="<?=$bo_mall[mb_id]?>">
<input type=hidden name="mo_cash" value="<?=$mo_cash?>">
<input type=hidden name="mo_point" value="<?=$mo_point?>">
<input type=hidden name="mo_cnt" value="<?=$mo_cnt?>">
<input type=hidden name="mo_msg" value="<?=$mo_msg?>">
<tr><td align='center'>
<table width='100%' border='0' cellspacing='0' cellpadding='0' align='left'>
<tr>
<td width='226'> <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><font color=#000000><?=$board[bo_subject]?></font></a></strong></td>
<td width='49'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
</tr>
<tr>
<td colspan=2 height=2 bgcolor='#b5a789'></td>
</tr>
</table>
</td></tr>
<tr><td align='center'>
<table width='95%'>
<? for ($k=0; $k<$row_cnt; $k++ ) { ?>
<tr>
<?
for ($i=0; $i<count($list)/$row_cnt; $i++)
{
if ($i > 0)
echo '<td width=20> </td>';
$title = get_text($list[$all_cnt][wr_subject]);
$content = cut_str(get_text($list[$all_cnt][wr_content]), 80);
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$all_cnt][file][0][file]);
if (!file_exists($img) || !$list[$all_cnt][file][0][file])
$img = "$latest_skin_path/img/no_image.gif";
$href = "$g4[bbs_path]/board.php?bo_table=$bo_table";
echo <<<HEREDOC
<td width='<?=$subject_len?>' valign='top' align='center'>
<table width='<?=$subject_len?>' border='0' cellpadding='0' cellspacing='0' align='center'>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='<?=$height?>' align='center'>
<div style='width:<?=$subject_len?>px;height:<?=$height?>px;border:1px solid #CCCCCC;padding:3px' align='center'>
<a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'><img src='{$img}' width='$subject_len' height='$height' border='0' align='absmiddle' title='$title'></a>
</div>
<td width=32></td><td width=5><img src='./img/bgline.gif'></td><td width=5></td>
</td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='5' align='center'></td>
</tr>
<tr>
<td width='<?=$subject_len?>' height='20' align='center'><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id={$list[$all_cnt][wr_id]}'>{$list[$all_cnt][subject]}</a></td>
</tr>
<tr>
<td>
//이곳에 가격을 뽑아 오고 싶습니다....===========
</td>
</tr>
</table>
</td>
HEREDOC;
$all_cnt++;
}
?>
</tr>
<? } ?>
<? if (count($list) == 0) { ?>
<tr><td colspan=2 align='center' height=25>게시물이 없습니다.</td></tr>
<? } ?>
</table>
</td></tr>
</form>
</table>
=======================================================
하단부 //이곳에 가격을 뽑아 오고 싶습니다....===========표시에 가격을 뽑아 오고 싶습니다... 도우미님 코드를 그대로 넣어서 출력 했을때는 가격이 정확히 나옵니다...
근데..제가 이리저리 해봐도...위 최신글 소스와 합치니 가격은 않나옵니다...
제발좀 도와주세요 ...어느부분에 어떻게 넣어야 하는지요..
댓글 전체
{$list[$i][wr_4]}
감사합니다..해결됬습니다..