하이슬라이더최근게시물의 썸네일을 가로세로 일정비율로 고정하려고합니다. > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

하이슬라이더최근게시물의 썸네일을 가로세로 일정비율로 고정하려고합니다. 정보

하이슬라이더최근게시물의 썸네일을 가로세로 일정비율로 고정하려고합니다.

본문

하이슬라이더최근게시물의 썸네일을 가로세로 일정비율로 고정하려고합니다.
도와주세요

오류 주소 : http://new.ottchil.co.kr/gallery.php


<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// 제목길이 잘 맞추세요.
$thu_width = '80';  //썸네일 폭
$thu_height = '80'; //썸네일 높이
$thu_quality = '100'; //썸네일 퀄리티_100 이하

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';

@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);

$mod = $board[bo_gallery_cols];
$td_width = (int)(100 / $mod);

// 선택옵션으로 인해 셀합치기가 가변적으로 변함
$colspan = 5;
if ($is_category) $colspan++;
if ($is_checkbox) $colspan++;
if ($is_good) $colspan++;
if ($is_nogood) $colspan++;

// 제목이 두줄로 표시되는 경우 이 코드를 사용해 보세요.
// <nobr style='display:block; overflow:hidden; width:000px;'>제목</nobr>

/*
$tmp_bo_table = "cm_gallery_request";
$tmp_write_table = $g4[write_prefix] . $tmp_bo_table;
$sql = " select wr_id, wr_subject from $tmp_write_table where wr_is_comment = 0 and wr_comment = 0 order by wr_id desc ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
    echo "<div align=center><a href='$g4[bbs_path]/board.php?bo_table=$tmp_bo_table&wr_id=$row[wr_id]'><span style='height:18px; color:crimson; cursor:pointer;'>★ 이미지 요청 : $row[wr_subject] ★</span></a></div><br>";
}
*/
?>

<script type="text/javascript" src="<?=$latest_skin_path?>/highslide/highslide.js"></script>

<script type="text/javascript">   

// remove the registerOverlay call to disable the controlbar
hs.registerOverlay(
    {
    thumbnailId: null,
    overlayId: 'controlbar',
    position: 'top right',
    hideOnMouseOut: true
}
);

    hs.graphicsDir = '<?=$latest_skin_path?>/highslide/graphics/';
    hs.outlineType = 'rounded-white';
    window.onload = function() {
        hs.preloadImages(5);
    }
</script>

<style type="text/css">
.highslide {
cursor: url(<?=$latest_skin_path?>/highslide/graphics/zoomin.cur), pointer;
    outline: none;
}
.highslide img {
border: 2px solid gray;
}
.highslide:hover img {
border: 2px solid white;
}

.highslide-image {
    border: 2px solid white;
}
.highslide-image-blur {
}
.highslide-caption {
    display: none;
   
    border: 2px solid white;
    border-top: none;
    font-family: Verdana, Helvetica;
    font-size: 10pt;
    padding: 5px;
    background-color: white;
}
.highslide-loading {
    display: block;
color: white;
font-size: 9px;
font-weight: bold;
text-transform: uppercase;
    text-decoration: none;
padding: 3px;
border-top: 1px solid white;
border-bottom: 1px solid white;
    background-color: black;
    /*
    padding-left: 22px;
    background-image: url(highslide/graphics/loader.gif);
    background-repeat: no-repeat;
    background-position: 3px 1px;
    */
}
a.highslide-credits,
a.highslide-credits i {
    padding: 2px;
    color: silver;
    text-decoration: none;
font-size: 10px;
}
a.highslide-credits:hover,
a.highslide-credits:hover i {
    color: white;
    background-color: gray;
}

.highslide-move {
    cursor: move;
}

.highslide-overlay {
display: none;
}
/* Controlbar example */
.controlbar {
background: url(<?=$latest_skin_path?>/highslide/graphics/controlbar4.gif);
width: 167px;
height: 34px;
}
.controlbar a {
display: block;
float: left;
margin: 0px 0 0 4px;
height: 29px;
width: 34px;
}

/* Necessary for functionality */
.highslide-display-block {
    display: block;
}
.highslide-display-none {
    display: none;
}
</style>

<div><?

for ($i=0; $i<count($list); $i++){

  $filename = $list[$i]['file'][0]['file'];

  $dest_file = $data_path .'/'. $filename;

  if (preg_match("/\.(jp[e]?g|gif|png)$/i", $filename) && file_exists($dest_file)){

    $thumb = $thumb_path.'/'. $filename;
    if (!file_exists($thumb)) {

      $size = getimagesize($dest_file);
      if ($size[2] == 1)
        $src = imagecreatefromgif($dest_file);
      else if ($size[2] == 2)
        $src = imagecreatefromjpeg($dest_file);
      else if ($size[2] == 3)
        $src = imagecreatefrompng($dest_file);
      else
        break;

      //가로,세로 최대사이즈 제한
      if ($size[0] >= $size[1]) {
        $rate = $board[bo_1] / $size[0];
        $width = $board[bo_1];
        $height = (int)($size[1] * $rate);
        }
        else {
        $rate = $board[bo_1] / $size[1];
        $width = (int)($size[0] * $rate);
        $height = $board[bo_1];
        }
        $dst = imagecreatetruecolor($width, $height);
        imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
        imagepng($dst, $thumb, $board['bo_2']);
        chmod($thumb, 0707);
        }
      }     
  //---------------------------------
  $no_image = $latest_skin_path."/img/noimage.gif";

  $tumblink = file_exists($thumb)? $thumb:$no_image;

  $subject = ($list[$i]['is_notice'])?"<a href='".$list[$i]['href']."' style='color:#2C8CB9;font-weight:bold;'>".$list[$i]['subject']."</a>":"<a href='".$list[$i]['href']."' style='color:#CCC;'>".$list[$i]['subject']."</a>";
  //---------------------------------

  //목록 출력
  ?><a id="thumb_<?=$list[$i]['wr_id']?>" href="<?=$dest_file?>" class="highslide" onclick="return hs.expand(this, { captionId: 'caption_<?=$list[$i]['wr_id']?>' } )">
    <img src="<?=$tumblink?>" alt="Highslide JS" title="Click to enlarge" /></a>

  <div class='highslide-caption' id='caption_<?=$list[$i]['wr_id']?>'>
    <?=$subject?>
    <p><? echo "Date:".$list[$i]['datetime']; echo ($list[$i]['datetime2'] != $list[$i]['last2'])?" 댓글:".$list[$i]['last2']."":'';?> Hit:<?=$list[$i]['wr_hit']?></p>
  </div><?

}//for

?><div id="controlbar" class="highslide-overlay controlbar">
<a href="#" onclick="return hs.previous(this)" title="Previous (left arrow key)"></a>
<a href="#" onclick="return hs.next(this)" title="Next (right arrow key)"></a>
    <a href="#" class="highslide-move" title="Click and drag to move"
    style="margin-left: 10px"></a>
    <a href="#" onclick="return hs.close(this)" title="Close"></a>
</div>

</div><?

if (count($list) == 0){
  ?><div style='width:100%;border:0px solid silver;margin:0;'>자료가 없습니다.</div><?
}
?>

댓글 전체

전체 20 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT