답변 3개
첨부한 이미지를 마지막에 등록한 순서가 제일 올라가가 보이게 하고싶다는거죠?
view.skin.php파일에보시면
<?php // 파일 출력 $v_img_count = count($view['file']); if($v_img_count) { echo "<div id=\"bo_v_img\">\n"; for ($i=0; $i<=count($view['file']); $i++) { if ($view['file'][$i]['view']) { //echo $view['file'][$i]['view']; echo get_view_thumbnail($view['file'][$i]['view']); } } echo "</div>\n"; } ?>
이부분의 for문의 조건을 변경하시면 되겠습니다.
아래처럼요
<?php // 파일 출력 $v_img_count = count($view['file']); if($v_img_count) { echo "<div id=\"bo_v_img\">\n"; for ($i=count($view['file']); $i>=0; $i--) { if ($view['file'][$i]['view']) { //echo $view['file'][$i]['view']; echo get_view_thumbnail($view['file'][$i]['view']); } } echo "</div>\n"; } ?>
lib/common.lib.php
수정 하세요
// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file, $width, $height, $content='')
{
global $config, $board;
global $g5;
static $ids;
if (!$file) return;
$ids++;
// 파일의 폭이 게시판설정의 이미지폭 보다 크다면 게시판설정 폭으로 맞추고 비율에 따라 높이를 계산
if ($width > $board['bo_image_width'] && $board['bo_image_width'])
{
$rate = $board['bo_image_width'] / $width;
$width = $board['bo_image_width'];
$height = (int)($height * $rate);
}
// 폭이 있는 경우 폭과 높이의 속성을 주고, 없으면 자동 계산되도록 코드를 만들지 않는다.
if ($width)
$attr = ' width="'.$width.'" height="'.$height.'" ';
else
$attr = '';
if (preg_match("/\.({$config['cf_image_extension']})$/i", $file)) {
$img = '<a href="'.G5_BBS_URL.'/view_image.php?bo_table='.$board['bo_table'].'&fn='.urlencode($file).'" target="_blank" class="view_image">';
$img .= '<img src="'.G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'" '.$attr.'>';
$img .= '</a>';
return $img;
}
}
답변을 작성하려면 로그인이 필요합니다.