소스가 잘되어 있는지요? 링크2로 이미지 넣는부분요... > 그누3질답

그누3질답

소스가 잘되어 있는지요? 링크2로 이미지 넣는부분요... 정보

그누보드 소스가 잘되어 있는지요? 링크2로 이미지 넣는부분요...

본문

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



// HTML 이면
if ($write[wr_html])
    $content = preg_replace("/(\<img)([^\>]*)(\>)/i", "\\1 name=target_resize_image[] onclick=image_window2(this) style='cursor:hand;' tmp_width=0 tmp_height=0 \\2 \\3", $content);
?>

<?
//$content = str_replace("<table border=0 cellspacing=0 cellpadding=0 width=100% style=\"table-layout:fixed;\"><col width=100%></col><tr><td valign=top>","<table border=0 cellspacing=0 cellpadding=0 width=100% style=\"table-layout:fixed;\"><col width=100%></col><tr><td valign=top class=tt>",$content);
$backimg = "./data/file/$bo_table/$write[wr_file1]";
?>

<style type=text/css>
    .tt {font-size:9pt;COLOR: #575757;}

</style>

<!-- 원글 내용 -->
<table width=<?=$width?> border=0 align=center cellpadding=4 cellspacing=0>
<tr>
<td>
    <img name=main_table width=<?=$width?> height=0 border=0>
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr>
        <td rowspan=6 width=3><img src='<?=$board_skin?>/viewbar_01.gif' width=3 height=54></td>
        <td colspan=2 bgcolor=#C9759F></td>
        <td rowspan=6 width=3><img src='<?=$board_skin?>/viewbar_02.gif' width=3 height=54></td>
    </tr>
    <tr height=25>
        <td>&nbsp;&nbsp;<span class=tt><b><? if ($is_category) echo "[$category_name] "; ?><?=$subject?></b></span></td>
        <td align=right><img src='<?=$board_skin?>/icon_watch.gif' width=10 height=13> <font color=#DC7899><?=$datetime?></font>&nbsp;&nbsp;</td>
    </tr>
    <tr><td colspan=2 background='<?=$board_skin?>/bg_linein.gif'></td></tr>
    <tr><td colspan=2 height=23>&nbsp;&nbsp;이름 : <?=$name?> &nbsp;(<?=$ip?>) &nbsp;조회: <?=$hit?>&nbsp;&nbsp;<? if ($is_good) echo "<font color='#cf4900'>추천</font> : " . $good; ?>&nbsp;&nbsp;<? if ($is_nogood) echo "<font color='#cf4900'>비추천</font> : " . $nogood; ?></td></tr>
    <tr><td colspan=2 style='background-color:#AFAFAF; height:1px'></td></tr>
    <tr><td colspan=2 style='background-color:#EDEDED; height:3px'></td></tr>
    </table>
</td>
</tr>
</table>


<table border=0 cellspacing=0 cellpadding=0 width=100%>
  <tr class='lh'>
      <td style='word-break:break-all;' align=center>
     
    <TABLE WIDTH=550 HEIGHT=380 BORDER=0 CELLPADDING=0 CELLSPACING=0 align=center>
      <TR>
    <TD><IMG SRC='<?=$board_skin?>/top_l.gif' WIDTH=19 HEIGHT=30></TD>
    <TD WIDTH=500 colspan='3' background='<?=$board_skin?>/top_c.gif'>&nbsp;</TD>
    <TD><IMG SRC='<?=$board_skin?>/top_r.gif' WIDTH=31 HEIGHT=30></TD>
      </TR>
      <TR>
    <TD WIDTH=19 HEIGHT=320 background='<?=$board_skin?>/center_l.gif'>&nbsp;</TD>
    <TD WIDTH=500 HEIGHT=320 colspan='3' align=center>
                                                   
<?
$t_width=500;
$t_height=320;

if ($write[wr_3]) {
$f_color_b="$write[wr_3]";
} else {
$f_color_b="#ffffff";
}

if ($write[wr_link1]) $zzzz = str_replace(" ", "%20", $write[wr_link1]);
if ($zzzz) echo"<EMBED src='$zzzz'  hidden='true' loop='true'></embed>";
if (preg_match($cfg[flash_extension], $backimg)){//플래시
echo "
<table border='0' width='$t_width' height='$t_height' align='center'>                   
<tr><td width='490' style='word-break:break-all'>
<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='490' height='320' id='$file1'>
<param name='movie' value='$backimg'>
<param name='quality' value='high'>
<param name='bgcolor' value='#ffffff'>
<PARAM NAME=wmode VALUE=transparent>
<embed src='$backimg' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='pplication/x-shockwave-flash' width='490' height='320' </embed> </object>
<div id=content style='position:absolute;top:250;left:350;width:100%;height:100%;'>
<!-- 내용 출력 -->
<marquee onMouseOver='stop();' onMouseOut='start();' direction='up' scrollamount='1.2' scrolldelay='100' TRUESPEED loop='ture' width='460' height='260'>
<p align='$write[wr_1]'>

<span style='font-family:굴림;font-size:9pt;color:$f_color_b;filter:glow(color=#111111,strength:2);height:0px;font-weight:bold;line-height=180%;'>
$content</span></p></marquee>
</div>";
} else if (preg_match($cfg[image_extension], $backimg)){//이미지
echo"<table border='0' width='$t_width' height='$t_height' align='center' background='$backimg'>                   
<tr><td width='490' style='word-break:break-all'>";



<!-- 여기에서ㅣ////////////////////////////////이부분을 제가 수정했거든요----------------------->

if ($write[wr_link1]) echo"<EMBED src='$zzzz'  hidden='true' loop='true'></embed>";
echo"<marquee onMouseOver='stop();' onMouseOut='start();' direction='up' scrollamount='1.2' scrolldelay='100' TRUESPEED loop='ture' width='460' height='260'>
<p align='$write[wr_1]'>
<span style='font-family:굴림;font-size:9pt;color:$f_color_b;filter:glow(color=#111111,strength:2);height:0px;font-weight:bold;line-height=180%;'>
$content</span></p></marquee>";
}

else if ($write[wr_link2]) { // 링크 2 가 있다면
  echo"
  <table border='0' width='$t_width' height='$t_height' align='center' background='$write[wr_link2]'>                   
      <tr>
        <td width='490' style='word-break:break-all'>"; 
  echo"
  <marquee onMouseOver='stop();' onMouseOut='start();' direction='up' scrollamount='1.2' scrolldelay='100' TRUESPEED loop='ture' width='460' height='260'>
      <p align='$write[wr_1]'>
        <span style='font-family:굴림;font-size:9pt;color:$f_color_b;filter:glow(color=#111111,strength:2);height:0px;font-weight:bold;line-height=180%;'>
            $content
        </span>
      </p>
  </marquee>";
}

else {
echo"<table border='0' width='$t_width' height='$t_height' align='center' background='$board_skin/no_img.jpg'>                   
<tr><td width='490' style='word-break:break-all'>";

<!-- 여기///////////////////////////////////////////////////////////까지 잘되었나 봐주세요---->



if ($write[wr_link1]) echo"<EMBED src='$zzzz'  hidden='true' loop='true'></embed>";
echo"<marquee onMouseOver='stop();' onMouseOut='start();' direction='up' scrollamount='1.2' scrolldelay='100' TRUESPEED loop='ture' width='460' height='260'>
<p align='$write[wr_1]'>
<span style='font-family:굴림;font-size:9pt;color:$f_color_b;filter:glow(color=#111111,strength:2);height:0px;font-weight:bold;line-height=180%;'>
$content</span></p></marquee>";
}
?>
                  </td>
                  </tr>
                </table>
                </TD>
    <TD><IMG SRC='<?=$board_skin?>/center_r.gif' WIDTH=31 HEIGHT=320></TD>
        </TR>
        <TR>
      <TD><IMG SRC='<?=$board_skin?>/b_l_l.gif' WIDTH=19 HEIGHT=30></TD>
      <TD><IMG SRC='<?=$board_skin?>/b_l.gif' WIDTH=125 HEIGHT=30></TD>
      <TD WIDTH=251 background='<?=$board_skin?>/b_c.gif'>&nbsp;</TD>
      <TD><IMG SRC='<?=$board_skin?>/b_r.gif' WIDTH=124 HEIGHT=30></TD>
      <TD><IMG SRC='<?=$board_skin?>/b_r_r.gif' WIDTH=31 HEIGHT=30></TD>
        </TR>
          </TABLE>
      </td>
      </tr>       
      <? if ($write[wr_2]) { echo "<tr><td colspan=5 align=center><IMG SRC='$board_skin/song_1.gif' border=0 align=absmiddle>&nbsp;&nbsp;<b><font color=#8F8F8F>TITLE SONG</font> : <font color=0099cc size=3>$write[wr_2]</font></b>&nbsp;&nbsp;<IMG SRC='$board_skin/song_2.gif' border=0 align=absmiddle></td></tr>"; }
      ?>
     
<?
// 글 내용 용량표시
//echo round(strlen($data[memo])/1024, 2); 뒤 숫자 2는 용량의 반올림, 1은 소수도 표시
//$wr_yong = strlen($write[wr_content]);
//echo "<div align=right> <font color='#777777' style='font-size:8pt'>$wr_yong bytes </font></div>";
if ($is_signature) {
echo "<tr><td><table width=100% cellpadding=0 cellspacing=0 border=0>
<tr bgcolor='#eeeeee'><td valign=top width=50>$avatar_show</td><td valign=top width='' style=padding:10px>$signature</td>
</tr></table></td></tr>";
}
?>
</table>
<br>

<? if ($is_comment) { ?>
    <!-- 코멘트 내용 -->
    <? for ($i=0; $i<count($list); $i++) { ?>
    <a name='c<?=$list[$i][wr_id]?>'></a>

    <table width=<?=$width?> border=0 align=center cellpadding=0 cellspacing=0>
    <tr>
        <td height=25 bgcolor=#F1F1F1>&nbsp;&nbsp;<?=$list[$i][name]?>&nbsp;(<?=$list[$i][ip]?>)</td>
        <td align=right bgcolor=#F1F1F1><?=$list[$i][datetime]?>&nbsp;<? if ($list[$i][is_del]) { echo "{$list[$i][del_href]}<img src='$board_skin/com_del.gif' border=0 width=9 height=9 align=absmiddle></a>&nbsp;"; } ?></td>
    </tr>
    <tr>
        <td colspan=2 valign=top>
            <table width=100% cellpadding=7 cellspacing=0>
            <tr>
                <td style='word-break:break-all; text-align:justify;' class='lh tt'><?=$list[$i][content]?></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
    <? } // for ?>

    <? if ($is_comment_write) { ?>
    <!-- 코멘트 쓰기 -->
    <table width=<?=$width?> align=center cellpadding=10 cellspacing=0 border=0 bgcolor=#F5F5F5>
    <form name=fgbview method=post action='./?doc=bbs/gbupdate.php'>
    <input type=hidden name=w        value='c'>
    <input type=hidden name=bo_table value='<?=$bo_table?>'>
    <input type=hidden name=sselect  value='<?=$sselect?>' >
    <input type=hidden name=stext    value='<?=$stext?>'>
    <input type=hidden name=wr_id    value='<?=$wr_id?>'>
    <input type=hidden name=page    value='<?=$page?>'>
    <input type=hidden name=section  value='<?=$section?>'>
    <tr>
        <td align=center>
            <table width=100% cellpadding=0 cellspacing=0 bgcolor=#FFFFFF border=0>
                <tr>
                    <td height=35>&nbsp;&nbsp;이름 : <?=preg_replace("/class=input/", "class=ib", $c_name)?>&nbsp;&nbsp;
                    <? if ($is_guest) { ?>
                    비밀번호 : <input type=password name=wr_passwd size=10 class=ib required itemname='비밀번호'></td>
                    <? } ?>
                    <td align=right><a href='javascript:textarea_size(document.fgbview.wr_content, 5)'><img src='<?=$board_skin?>/icon_down.gif' border=0 align=absmiddle></a> <a href='javascript:textarea_size(document.fgbview.wr_content, -5)'><img src='<?=$board_skin?>/icon_up.gif' border=0 align=absmiddle></a>&nbsp;&nbsp;&nbsp;</td>
                </tr>
                <tr>
                    <td colspan=2 align=center>
                        <table width=98% cellpadding=0 cellspacing=0>
                            <tr><td><textarea name=wr_content style='border: 1px solid #C2C2C2; word-break:break-all; width:100%;' rows=5 required itemname='내용'></textarea></td><td width=64><input type=image src='<?="$board_skin/btncomment.gif"?>' border=0 align=absmiddle></td></tr>
                            <tr><td colspan=2 height=5></td></tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    </form>
    </table><br>
    <? } // if ?>

<? } // if ?>


<!-- 링크 -->
<table width=<?=$width?> align=center border=0 cellpadding=0 cellspacing=0>
<tr>
    <td width=75% height=35>
        <? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin/searchlist.gif' border=0 alt='검색목록' align=absmiddle></a>"; } ?>
        <? echo "<a href=\"$list_href\"><img src='$board_skin/list.gif' border=0 alt='목록' align=absmiddle></a>"; ?>

        <? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin/write.gif' border=0 alt='글쓰기' align=absmiddle></a>"; } ?>
        <? if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin/reply.gif' border=0 alt='답변' align=absmiddle></a>"; } ?>

        <? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin/edit.gif' border=0 alt='수정' align=absmiddle></a>"; } ?>
        <? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin/delete.gif' border=0 alt='삭제' align=absmiddle></a>"; } ?>

        <? if ($good_href) { echo "<a href=\"$good_href\"><img src='$board_skin/good.gif' border=0 alt='추천' align=absmiddle></a>"; } ?>
        <? if ($nogood_href) { echo "<a href=\"$nogood_href\"><img src='$board_skin/nogood.gif' border=0 alt='비추천' align=absmiddle></a>"; } ?>

    <!--    <? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin/copy.gif' border=0 alt='복사' align=absmiddle></a>"; } ?>
        <? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin/move.gif' border=0 alt='이동' align=absmiddle></a>"; } ?> -->
    </td>
    <td width=25% align=right>
        <? if ($prev_href) { echo "<a href=\"$prev_href\" title=\"$prev_wr_subject\"><img src='$board_skin/prev.gif' border=0 alt='이전글' align=absmiddle></a>"; } ?>
        <? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin/next.gif' border=0 alt='다음글' align=absmiddle></a>"; } ?>
    </td>
</tr>
</table>

<script language="JavaScript">
<!--
    // HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다.
    // 제로보드 참고
    function resize_image()
    {
        var target = document.getElementsByName('target_resize_image[]');
        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 > document.main_table.width)
                target[i].width = document.main_table.width;
        }
    }
    window.onload = resize_image;
//-->
</script>

위의소스가 데이타베이스에 부하를 많이 줄까요?
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로