이미지에 링크 걸리게좀 해주세요~~~ 정보
이미지에 링크 걸리게좀 해주세요~~~본문
이미 질문을 드린 바 있으나 잘 해결이 안되서 다시 질문을 드립니다.
아래에 지난번 질문드린 내용을 다시 쓰겠습니다.
제가 사용하는 갤러리 스킨의 이미지에 링크를 걸고 싶습니다.
사실 지금 글쓰기 화면에 링크거는 필드도 없는데 이것은 write.skin.php파일을 수정해보니 나오더군요.
그런데 링크주소를 입력해도 이미지에 링크가 걸리지 않아요..
제가 php는 전혀 모르기땜에.. 어떻게 수정을 할 엄두가 안나네요.
아시는 분.. 정말 도움주시기를 부탁드립니다.
아래는 view.skin.php 파일 소스입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 ?> <? $view = get_view($write, $board, $board_skin_path); if (strstr($sfl, "subject"))
$view[subject] = search_font($stx, $view[subject]); $html = 0;
if (strstr($view[wr_option], "html1")) $html = 1; else if (strstr($view[wr_option], "html2")) $html = 2; $view[content] = conv_content($view[wr_content], $html);
if (strstr($sfl, "content")) $view[content] = search_font($stx, $view[content]); $view[content] = preg_replace("/(\<img )([^\>]*)(\>)/i", "\\1 name='target_resize_image[]' onclick='' \\2 \\3", $view[content]); //$view[rich_content] = preg_replace("/{img\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view[content]);
$view[rich_content] = preg_replace("/{이미지\:([0-9]+)[:]?([^}]*)}/ie", "view_image(\$view, '\\1', '\\2')", $view[content]); ?>
<table width="100%" cellspacing="0" cellpadding="0"> <tr><td height=30></td></tr> </table> <!-- 게시글 보기 시작 --> <table width="<?=$width?>" align="center" cellpadding="0" cellspcing="0"><tr><td> <table width="100%" cellspacing="0" cellpadding="0">
<tr><td height=2 bgcolor=#B89E7D></td></tr> <tr><td height=30 align="center"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td height=30 width="60%" style="padding-left:12" bgcolor=#F9F7EB><strong><? if ($is_category) { echo ($category_name ? "[$view[ca_name]] " : ""); } ?><?=$view[subject]?></strong></td> <td width="40%" align="right" bgcolor=#F9F7EB style="padding-right:12;font-family:Tahoma;font-size:11px"><?=substr($view[wr_datetime],0,16)?></td></tr></td> </tr> <tr> <td height=30 style="padding-left:12"><span style="font-family:Tahoma;font-size:8pt;color:#986E4D">Write by</span> <?=$view[name]?></td> <td align="right" style="padding-right:12;font-family:Tahoma;font-size:11px"><span style="font-size:8pt;color:#986E4D">Hit.</span> <?=$view[wr_hit]?></td> </tr> </table></td></tr> <tr><td height=5></td></tr> <tr><td height=1 bgcolor=#F7F7E7></td></tr> <? // 가변 파일 $cnt = 0; for ($i=0; $i<count($view[file]); $i++) { if ($view[file][$i][source] && !$view[file][$i][view]) { $cnt++; echo "<tr><td height=26 style='padding-left:12px;'><img src='{$board_skin_path}/img/icon_file.gif' align=absmiddle> <a href=\"javascript:file_download('{$view[file][$i][href]}', '{$view[file][$i][source]}');\" title='{$view[file][$i][content]}'><strong>{$view[file][$i][source]}</strong> ({$view[file][$i][size]}), Down : {$view[file][$i][download]}, {$view[file][$i][datetime]}</a></td></tr>"; echo "<tr><td height=1 bgcolor=#F7F7E7></td></tr>"; } } // 아이피 출력 if ($is_ip_view) { echo "<tr>"; echo "<td height='18' align='right' style='word-break:break-all; padding-right:12px;'><span style='font-size:8pt;color:#B89E7D'>(<b>IP</b> : $ip)</span></td>"; echo "</tr>"; } ?> <tr> <td height="40" align="center" style='word-break:break-all; padding:2px;'> <? // 파일 출력 for ($i=0; $i<=count($view[file]); $i++) { if ($view[file][$i][view]) { //이미지 링크를 없앤다. $view[file][$i][view] = str_replace("onclick='image_window(this);' style='cursor:pointer;'","",$view[file][$i][view]); echo $view[file][$i][view]."<br>"; if ($view[file][$i][bf_content]) { echo "<div style='font-family:Tahoma;font-size:11px;color:#3388DD;padding-top:4;padding-bottom:12'>".$view[file][$i][bf_content] ."</div>"; } } } ?> <?//echo $view[rich_content]; // 과 같은 코드를 사용할 경우?> </td> </tr> <tr> <td height="100" style='word-break:break-all; padding:10px;'> <span class="ct lh"><?=$view[content];?></span> <!-- 테러 태그 방지용 --></xml></xmp><a href=""></a><a href=''></a> <? if ($is_signature) { echo "<br>$signature<br><br>"; } // 서명 출력 ?></td> </tr> </table><br> <?
include_once("./view_comment.php"); ?> <!-- 링크 버튼 -->
<? ob_start(); ?> <table width='100%' cellpadding=0 cellspacing=0> <tr height=35> <td width=75%> <? if ($search_href) { echo "<a href=\"$search_href\"><img src='$board_skin_path/img/btn_search_list.gif' border='0' align='absmiddle'></a> "; } ?> <? echo "<a href=\"$list_href\"><img src='$board_skin_path/img/btn_list.gif' border='0' align='absmiddle'></a> "; ?> <? if ($write_href) { echo "<a href=\"$write_href\"><img src='$board_skin_path/img/btn_write.gif' border='0' align='absmiddle'></a> "; } ?>
<?// if ($reply_href) { echo "<a href=\"$reply_href\"><img src='$board_skin_path/img/btn_reply.gif' border='0' align='absmiddle'></a> "; } ?> <? if ($update_href) { echo "<a href=\"$update_href\"><img src='$board_skin_path/img/btn_update.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($delete_href) { echo "<a href=\"$delete_href\"><img src='$board_skin_path/img/btn_delete.gif' border='0' align='absmiddle'></a> "; } ?> <?// if ($good_href) { echo "<a href=\"$good_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_good.gif' border='0' align='absmiddle'></a> "; } ?>
<?// if ($nogood_href) { echo "<a href=\"$nogood_href\" target='hiddenframe'><img src='$board_skin_path/img/btn_nogood.gif' border='0' align='absmiddle'></a> "; } ?> <?// if ($scrap_href) { echo "<a href=\"javascript:;\" onclick=\"win_scrap('./scrap_popin.php?bo_table=$bo_table&wr_id=$wr_id');\"><img src='$board_skin_path/img/btn_scrap.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($copy_href) { echo "<a href=\"$copy_href\"><img src='$board_skin_path/img/btn_copy.gif' border='0' align='absmiddle'></a> "; } ?>
<? if ($move_href) { echo "<a href=\"$move_href\"><img src='$board_skin_path/img/btn_move.gif' border='0' 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_path/img/btn_prev.gif' border='0' align='absmiddle'></a> "; } ?> <? if ($next_href) { echo "<a href=\"$next_href\" title=\"$next_wr_subject\"><img src='$board_skin_path/img/btn_next.gif' border='0' align='absmiddle'></a> "; } ?> </td> </tr> </table> <? $link_buttons = ob_get_contents(); ob_end_flush(); ?> </td></tr></table><br> <script language="JavaScript">
// HTML 로 넘어온 <img ... > 태그의 폭이 테이블폭보다 크다면 테이블폭을 적용한다. function resize_image() { var target = document.getElementsByName('target_resize_image[]'); var image_width = parseInt('<?=$board[bo_image_width]?>'); 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;
function file_download(link, file) { <? if ($board[bo_download_point] < 0) { ?>if (confirm("'"+file+"' 파일을 다운로드 하시면 포인트가 차감(<?=number_format($board[bo_download_point])?>점)됩니다.\n\n포인트는 게시물당 한번만 차감되며 다음에 다시 다운로드 하셔도 중복하여 차감하지 않습니다.\n\n그래도 다운로드 하시겠습니까?"))<?}?> document.location.href = link; } </script> <!-- 게시글 보기 끝 --> |
|
evan (71.♡.167.201) | ![]() ![]() ![]() |
![]() | |
우선 답변에 감사를 드립니다. 그런데 위와같이 고쳐보니 이미지가 클릭이 되기는 하는데 링크가 'http://웹사이트.com/bbs/링크'로 걸리더라구요. 알려주신 부분 중 echo "<a href='링크'>"; 이부분의 '링크'가 다른것이 들어가나 하나요? 제가 잘 적용을 못하는건지... 잘 안되네요... |
저에게는 급한 문제라서... 꼭 부탁을 드립니다.
댓글 전체
//이미지 링크를 없앤다.
클릭하면 이미지를 윈도우열어서 보여주는부분<--여기 앵커태크사용
$view[file][$i][view] = str_replace("onclick='image_window(this);' style='cursor:pointer;'","",$view[file][$i][view]);
echo $view[file][$i][view]."<br>";
위의 이 부분을
$view[file][$i][view] = str_replace("onclick='image_window(this);' style='cursor:pointer;'","",$view[file][$i][view]);
echo "<a href='{$list[$i][wr_link1]}' target=_blank>"; //링크1의 링크값
echo $view[file][$i][view]."<br>";
echo "</a>";
클릭하면 이미지를 윈도우열어서 보여주는부분<--여기 앵커태크사용
$view[file][$i][view] = str_replace("onclick='image_window(this);' style='cursor:pointer;'","",$view[file][$i][view]);
echo $view[file][$i][view]."<br>";
위의 이 부분을
$view[file][$i][view] = str_replace("onclick='image_window(this);' style='cursor:pointer;'","",$view[file][$i][view]);
echo "<a href='{$list[$i][wr_link1]}' target=_blank>"; //링크1의 링크값
echo $view[file][$i][view]."<br>";
echo "</a>";
이상합니다. 알려주신대로 해도... 링크가 http://제 웹사이트 주소.com/bbs 이렇게만 걸립니다.
뭐가 문제인지.. 정말 답답하네요...
답변주셔서 감사드립니다.
뭐가 문제인지.. 정말 답답하네요...
답변주셔서 감사드립니다.
글쓰실때 링크1에 링크주소 써 주셨나요? 헐랭이님의 답변은 링크1의 링크 주소를 연결하는거니
글을 쓰실때 링크1의 링크주소를 써주셔야 합니다.
글을 쓰실때 링크1의 링크주소를 써주셔야 합니다.