[요청]슈가스타님의 '미니필 최신글 스킨'에서 이미지를 새창으로 띄우는 방법과 gd적용.. > 그누4 질문답변

그누4 질문답변

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

[요청]슈가스타님의 '미니필 최신글 스킨'에서 이미지를 새창으로 띄우는 방법과 gd적용.. 정보

[요청]슈가스타님의 '미니필 최신글 스킨'에서 이미지를 새창으로 띄우는 방법과 gd적용..

본문

안녕하세요..... 랑이라고 합니다..


슈가스타님께서 멋진 스킨을 올려주셔서 기쁜 마음으로 사용하고 있습니다..

물론 미니홈피 스타일의 레이아웃에 맞춰진 것이긴 하나, 운 좋게도 제 홈피의 레이아웃에도

좀 어울리더군요...제가 보기에는...^^;;

근데 조금 아쉬운 부분이 있어서 그누의 여러 고수님들께 부탁 좀 드리고자 합니다..


아래는 최신글 스킨의 소스입니다.


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

<script>
var sRepeat=null;
function doScrollerIE(dir, src, amount) {
if (amount==null) amount=10;
if (dir=="up")
document.all[src].scrollTop-=amount;
else
document.all[src].scrollTop+=amount;
if (sRepeat==null)
sRepeat = setInterval("doScrollerIE('" + dir + "','" + src + "'," + amount + ")",100);
return false }
window.document.onmouseout = new Function("clearInterval(sRepeat);sRepeat=null");
window.document.ondragstart = new Function("return false");
</script>
<script language="JavaScript">
function openNewWindow(window) {
open (window,"minifile","left=200, top=200, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=320, height=350");
}
</script>
 

<?
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[0][file][0][file]);
    if (!file_exists($img) || !$list[0][file][0][file])
    $img = "$latest_skin_path/images/no_image.gif";
?>
<table cellpadding="0" cellspacing="0" width="148" align=center>
    <tr>
        <td height="110" align=center valign=middle>
            <img src="<?=$img?>" width=144 height=108 border="0" style="border-width:1px; border-color:E7E7E7; border-style:solid;"> <!-- ******************-->
        </td>
    </tr>
    <tr><td height=1 bgcolor=E7E7E7></td></tr>
    <tr><td height=5></td></tr>
    <tr>
        <td>
<table cellpadding="0" cellspacing="0" width="145" align=center><tr><td>
            <div id=scroll style="overflow:hidden; width:144; height:85;word-break:break-all;font-size:9pt;"><font color=<?=$list[0][wr_1]?>><?=nl2br(stripslashes($list[0][wr_content]))?></font></div>
</td></tr></table>
        </td>
    </tr>
    <tr><td height=5></td></tr>
    <tr>
        <td>
<table cellpadding="0" cellspacing="0" width="148">
<tr>
<td width=74 align=left><a href="javascript:openNewWindow('<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>')"><img src="<?=$latest_skin_path?>/images/todays.gif" border=0 align=absmiddle></a></td>
<td width=74 align=right>
<a href="#" onmouseover="return doScrollerIE('up','scroll',5)" onmouseout="clearInterval(sRepeat)"><img src="<?=$latest_skin_path?>/images/up.gif" border=0 align=absmiddle></a>
<a href="#" onmouseover="return doScrollerIE('down','scroll',5)" onmouseout="clearInterval(sRepeat)"><img src="<?=$latest_skin_path?>/images/down.gif" border=0 align=absmiddle></a></td>
</tr>
</table>
        </td>
    </tr>
    <tr><td height=1></td></tr>
    <tr><td height=1 bgcolor=E7E7E7></td></tr>
<tr><td height=5></td></tr>
</table>

<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
    var target = document.getElementsByName('target_resize_image[]');
    var image_width = parseInt('250');
    var image_height = 0;

    for(i=0; i<target.length; i++) {
        // 원래 사이즈를 저장해 놓는다
        target[i].tmp_width  = target[i].width;
        target[i].tmp_height = target[i].height;
        // 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
        if(target[i].width > image_width) {
            image_height = parseFloat(target[i].width / target[i].height)
            target[i].width = image_width;
            target[i].height = parseInt(image_width / image_height);
        }
    }
}

window.onload = resize_image;
</script>
-----------------------------------------------------------------------------

음.. 미니필 스킨에 있는 list.skin.php파일을 참고하여..위에 별***** 있는 부분에

name='target_resize_image[]' onclick='image_window(this);'

요거를 붙이면 나오지 않을까 싶어서 해봤거든요... 그런데.. 원본 사이즈의 크기가 안되더라구요..--;;

이거 새 창으로 띄우면서 원본사이즈로 보이게..(미X홈피랑 같은거죠 머...) 하려면 어떻게 해야 할까요..?


그리구... 음.. 이거는.. 제 욕심인데요... 최신글에서도 gd가 적용되게 할 수는 없을까요?....^^;;;

이미지는 항상 저를 긴장(?)하게 만들어서... 물론 사이즈 조절등을 통한 다이어트를 해 주면 되겠지만

그래도... 늘상 하는말이 집에서 돌리다 보니......하..하..;;;


좋은 하루 되시구요... 조언 부탁드리겠습니다.....^^

댓글 전체

위의 소스에서 <!--*************--> 부분을
=================
<img src="<?=$img?>" border="0" style="cursor:pointer; border-width:1px; border-color:E7E7E7; border-style:solid;" name='target_resize_image[]' onclick='image_window(this);'>
=================

로 바꾸고  아래 resize_image() 부분을
=================
<script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
function resize_image()
{
    var target = document.getElementsByName('target_resize_image[]');
    var image_width = parseInt('144');
    var image_height = parseInt('108');

    for(i=0; i<target.length; i++) {
        // 원래 사이즈를 저장해 놓는다
        target[i].tmp_width  = target[i].width;
        target[i].tmp_height = target[i].height;
        // 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
        if(target[i].width > image_width) {
            image_height = parseFloat(target[i].width / target[i].height)
            target[i].width = image_width;
            target[i].height = parseInt('108');
        }
if(target[i].height > image_height) {
target[i].width = parseInt('144');
            target[i].height = parseInt('108');
}
    }
}

window.onload = resize_image;
</script>
=================

와 같이 바꾸어 주니 일단 새창띄우는데에는 성공했습니다...근데...
이미지 로딩 후, 리사이즈가 되어버려서 보기가 않좋네요...
팁엔테크에 관련 글(http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=620&sca=&sfl=wr_subject&stx=%B8%AE%BB%E7%C0%CC&sop=and)이 있긴 한데..
이것을 지금의 최신글 스킨에 적용할 줄 모르겠습니다....T.T..
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

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