갤러리 최근글 문제 입니다.
본문
function latest_all($skin_dir = '', $bo_tables, $rows = 10, $subject_len = 40, $cache_time = 1, $options = '')
{
global $g5;
if (!$skin_dir) $skin_dir = 'basic';
if (preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$latest_skin_path = G5_THEME_MOBILE_PATH . '/' . G5_SKIN_DIR . '/latest/' . $match[1];
if (!is_dir($latest_skin_path))
$latest_skin_path = G5_THEME_PATH . '/' . G5_SKIN_DIR . '/latest/' . $match[1];
$latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
} else {
$latest_skin_path = G5_THEME_PATH . '/' . G5_SKIN_DIR . '/latest/' . $match[1];
$latest_skin_url = str_replace(G5_PATH, G5_URL, $latest_skin_path);
}
$skin_dir = $match[1];
} else {
if (G5_IS_MOBILE) {
$latest_skin_path = G5_MOBILE_PATH . '/' . G5_SKIN_DIR . '/latest/' . $skin_dir;
$latest_skin_url = G5_MOBILE_URL . '/' . G5_SKIN_DIR . '/latest/' . $skin_dir;
} else {
$latest_skin_path = G5_SKIN_PATH . '/latest/' . $skin_dir;
$latest_skin_url = G5_SKIN_URL . '/latest/' . $skin_dir;
}
}
$list = array();
$sql_common = " from {$g5['board_new_table']} a where find_in_set(a.bo_table, '{$bo_tables}')";
$sql_common .= " and a.wr_id = a.wr_parent ";
$sql_order = " order by a.bn_id desc ";
$sql = " select a.* {$sql_common} {$sql_order} limit 0, {$rows}";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$sql = " select * from {$g5['board_table']} where bo_table = '{$row['bo_table']}' ";
$board = sql_fetch($sql);
$tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
$row2 = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ");
$list[$i] = $row2;
$list[$i] = get_list($row2, $board, $latest_skin_url, $subject_len);
//$list[$i]['bo_subject'] = $row['bo_subject'];
$list[$i]['bo_subject'] = $board['bo_subject'];
$list[$i]['bo_table'] = $row['bo_table'];
}
ob_start();
include $latest_skin_path.'/latest.skin.php';
$content = ob_get_contents();
ob_end_clean();
return $content;
}
<div class="pic_lt">
<!-- <h2 class="lat_title"><a href="<?php echo get_pretty_url($list[$i]['bo_table']); ?>"><?php echo $bo_subject ?></a></h2> -->
<ul>
<?php
for ($i=0; $i<$list_count; $i++) {
$thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $thumb_width, $thumb_height, false, true);
if($thumb['src']) {
$img = $thumb['src'];
} else {
$img = G5_IMG_URL.'/no_img.png';
$thumb['alt'] = '이미지가 없습니다.';
}
$img_content = '<img src="'.$img.'" alt="'.$thumb['alt'].'" >';
$wr_href = get_pretty_url($list[$i]['bo_table'], $list[$i]['wr_id']);
?>
<li class="gallery_li">
<a href="<?php echo $wr_href; ?>" class="lt_img"><?php echo run_replace('thumb_image_tag', $img_content, $thumb); ?></a>
<?php
if ($list[$i]['icon_secret']) echo "<i class=\"fa fa-lock\" aria-hidden=\"true\"></i><span class=\"sound_only\">비밀글</span> ";
echo "<a href=\"".$wr_href."\"> ";
if ($list[$i]['is_notice'])
echo "<strong>".$list[$i]['subject']."</strong>";
else
echo $list[$i]['subject'];
echo "</a>";
// if ($list[$i]['icon_new']) echo "<span class=\"new_icon\">N<span class=\"sound_only\">새글</span></span>";
// if ($list[$i]['icon_hot']) echo "<span class=\"hot_icon\">H<span class=\"sound_only\">인기글</span></span>";
// if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
// if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }
// echo $list[$i]['icon_reply']." ";
// if ($list[$i]['icon_file']) echo " <i class=\"fa fa-download\" aria-hidden=\"true\"></i>" ;
// if ($list[$i]['icon_link']) echo " <i class=\"fa fa-link\" aria-hidden=\"true\"></i>" ;
if ($list[$i]['comment_cnt']) echo "
<span class=\"lt_cmt\">".$list[$i]['wr_comment']."</span>";
?>
<!-- <div class="lt_info">
<span class="lt_nick"><?php echo $list[$i]['name'] ?></span>
<span class="lt_date"><?php echo $list[$i]['datetime2'] ?></span>
</div> -->
</li>
<?php } ?>
<?php if ($list_count == 0) { //게시물이 없을 때 ?>
<li class="empty_li">게시물이 없습니다.</li>
<?php } ?>
</ul>
<!-- <a href="<?php echo get_pretty_url($list[$i]['bo_table']); ?>" class="lt_more"><span class="sound_only"><?php echo $bo_subject ?></span>더보기</a> -->
</div>
여러개의 게시판에서 최근데이터가 잘 나오는데
게시글 등록시 이미지를 첨부하면 최근글에 잘 반영이 되는데.
게시글 등록시 스마트에디터로 바꾼 뒤 스마트에디터로 이미지를 첨부한 게시물은 최근글에 반영이 안되는문제가 있습니다.
<div class="box-new-gallery-area">
<h2>| 작업현황</h2>
<?php echo latest_all('pic_block', 'project_flatbed,project_lolo,project_lowbed,project_module', '3', '10'); ?>
</div>
출력은 위 처럼 적용해서 하고 있는데 스마트에디터의 게시물로 최근글에 나오게 해야 되는데 초보라 어디를 수정해야 될지 모르겠습니다.
도움 부탁드립니다.
답변을 작성하시기 전에 로그인 해주세요.