여유필드값 최신글에 출력문의 채택완료
안녕하세요 도움을좀 받고자 이렇게 글 올리네요 아시는분 답변좀 부탁드립니다.
latest.skin.php 에 보면 글쓴이 출력시 {$list[$i]['wr_name']} 이렇게 되어 있고 정상적으로 게시판 아니 메인페이지로
출력이 됩니다.
그런데 여유필드를통해 저장된 wr_2 에 정보는 {$list[$i]['wr_2']} 이렇게 해도 출력이 안되네요.
그래서 정보를 찾아보니 lib/latest.lib.php 에서 w_2 을 추가해주면 된다하여 추가해도 역시 최신글에는 출력이 안됩니다.
$list[$i]['wr_2'] 대가로를 빼고 넣어 봤더니 Array['wr_2'] 이렇게 출력 됩니다.
wr_2 로 받은 값들은 게시판에서는 정상적으로 잘 출력 됩니다.
게시판이 아닌 메인으로 출력시에만 값이 노출되지 않고 있습니다.
latest.skin.php 파일과 latest.lib.php 파일을 정상적으로 처리한건지 한번 봐주셨으면 합니다..
//--------------------latest.skin.php ------------------//</STRONG>
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?></P>
<P> </P>
<P><div class="latestList h2bg">
<ul class="btnPage">
<li><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"></a></li>
</ul>
<ul class="text">
<? for ($i=0; $i<count($list); $i++) {
</P>
<P> ?>
<li>
<?
echo $list[$i]['icon_reply'];
echo "<!---<a href='{$list[$i]['href']}'>--->";
if ($list[$i]['is_notice'])
echo "<strong>{$list[$i]['wr_name']}</strong>";
else if($list[$i][wr_is_comment])
echo cut_str(get_text(strip_tags($list[$i][wr_content])),$subject_len,"…");
else</P>
<P>
// 관리자
if ($is_admin) {
echo $list[$i]['name'];
} else {
// 기타 </P>
<P>
"
<table><tr>
<td width='250' align='left'>$list[$i]['wr_2']</td>
<td width='100' align='left'></td>
<td width='160' align='right'><span style='font-size:8pt; color:#999999;text-align:right;'> {$list[$i]['datetime2']} </span></td>
</tr></table>
";</P>
<P>
}
echo "<!---</a>--->";</P>
<P>
//if ($list[$i]['comment_cnt'])
//echo " <a href=\"{$list[$i]['comment_href']}\"><span class='cmt'>{$list[$i]['comment_cnt']}</span></a>";</P>
<P> // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }</P>
<P> //echo " " . $list[$i]['icon_new'];
//echo " " . $list[$i]['icon_file'];
//echo " " . $list[$i]['icon_link'];
//echo " " . $list[$i]['icon_hot'];
//echo " " . $list[$i]['icon_secret'];
?>
</li>
<? } ?>
<? if (count($list) == 0) { ?><li>게시물이 없습니다.</a></li><? } ?></P>
<P> </ul>
</div></P>
<P><STRONG>
//--------------------latest.lib.php ------------------//
</STRONG></P>
<P><?
if (!defined('_GNUBOARD_')) exit;</P>
<P>// 최신글 추출
function latest($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="")
{
global $g4;</P>
<P> if ($skin_dir)
$latest_skin_path = "$g4[path]/skin/latest/$skin_dir";
else
$latest_skin_path = "$g4[path]/skin/latest/basic";</P>
<P> $list = array();</P>
<P> $sql = " select * from $g4[board_table] where bo_table = '$bo_table'";
$board = sql_fetch($sql);</P>
<P> $tmp_write_table = $g4['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows ";
// 위의 코드 보다 속도가 빠름
//$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";</P>
<P>// 위의 코드 보다 속도가 빠름
$sql = " select wr_id, wr_subject, wr_option, wr_content, wr_2, wr_comment, wr_parent, wr_datetime, wr_last, wr_homepage, wr_name, wr_reply, wr_link1, wr_link2, ca_name, wr_hit from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows "; </P>
<P>
//explain($sql);
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
$list[$i] = get_list($row, $board, $latest_skin_path, $subject_len);
ob_start();
include "$latest_skin_path/latest.skin.php";
$content = ob_get_contents();
ob_end_clean();</P>
<P> return $content;
}
?>
</P>
<P><STRONG>
답변 3개
32행 |
|
|
34행
| |
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";
댓글을 작성하려면 로그인이 필요합니다.
select 와 from 사이에 넣어준 필드명들 다 지우시고 * 넣어주시고,
print_r($list); 한번출력해보세요. 재대로 값이 배열에 담겨져 있는지 확인먼저해보세요.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
{$list[$i][wr_2]}