미채택 완료

초보 최신글관련 질문좀 드립니다.

2014-02-09 (일) 13:34:29 5,312

안녕하세요 최신글관련 질문좀 드립니다.

아래 소스는  그누메인화면에 사용하고 있는 최신글 소스인데요 메인화면에서 이미지 클릭했을때

1번링크로 바로 이동하게 하고 싶은데 고수님들 한수 지도좀 부탁합니다.

"새해 복 많이 받으세요 감사합니다"

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

$cols  = 4; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=250; //표시할 이미지의 가로사이즈
$imgheight=300; //표시할 이미지의 세로사이즈
$image_h  = 0; // 이미지 상하 간격

$col_width = (int)(100 / $cols);

$data_path = $g4[path]."/data/file/$bo_table";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="F5F5F5">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
   <td width="100" align="center" bgcolor="red"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><font color="white">전체보기</font></td>
     <td height="35" style="padding-left:10px;"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><b><?=$board[bo_subject]?></b></a></td>
     <td width="30" height="35" align="center" valign="middle"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>">
     <img src="<?=$latest_skin_path?>/img/btn_more.gif" alt="전체보기" border="0" title="전체보기" /></a></td>
   </tr>
       </table>
 </td>
  </tr>
  <tr>
    <td height="0"><!--여백--></td>
  </tr>
  <tr>
    <td align="center" valign="top"> 
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr>
   <? for ($i=0; $i<count($list); $i++) {
     if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
   ?>    
   <td width="<?=$col_width?>%" align="center" valign="top" style="padding-top:10px;">
   <?
   $image = $list[$i][file][0][file]; //원본
   $img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
   
    echo $list[$i][icon_reply] . " ";
    echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
    echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:10px solid white; padding:0px'></a></td></tr>";
    echo "<tr><td align='center' height='17'><a href='{$list[$i]['href']}'><span style='font-size:9pt;'><b>{$list[$i]['subject']}</b></span></a></td></tr>";
   echo "</table>";
   ?>   
   </td>
   <? } ?>    
   <?
   $cnt = ($i%$cols);
   for ($k=$cnt; $k<$cols && $cnt; $k++) {
    echo "<td width=$col_width%></td>";
   }
   ?>
   <? if (count($list) == 0) { echo "<td align=center>게시물이 없습니다.</td>"; } ?>   
    </tr>
  </table>
 </td>
  </tr>
</table>

|

답변 6개 / 댓글 5개

많은 도움이 되었습니다. 감사합니다.

네 유튜브요 게시판에 유튜브 동영상 올리면 이미지로 출력되게 할려구여

히어님 혹시 게시판 또는 최신글에 동영상올리면 이미지따로 안올리고 동영상이미지 출력되게끔 할수는 없나요 ?

답변에 대한 댓글 2개

유튜브는 가능합니다.
네 유튜브요 게시판에 유튜브 동영상 올리면 이미지로 출력되게 할려구여
<a href='{$list[$i]['wr_link1']}' target='_blank'><img ....

답변에 대한 댓글 1개

히어님 감사요 잘돼네요 ㅎㅎ ^^
<?
   $image = $list[$i][file][0][file]; //원본
   $img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
   
    echo $list[$i][icon_reply] . " ";
    echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
    echo "<tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='center' style='width:{$imgwidth}px;height:{$imgheight}px;border:10px solid white; padding:0px'></a></td></tr>";
    echo "<tr><td align='center' height='17'><a href='{$list[$i]['href']}'><span style='font-size:9pt;'><b>{$list[$i]['subject']}</b></span></a></td></tr>";
   echo "</table>";
   ?>  
 
빨간부분을 지우고 넣으시면 됩니다.
그뒤가 이미지 출력하는부분이니깐요

답변에 대한 댓글 1개

감사요 히어님 혹시 이거 새창으로 띄울려면 'target='_blank' <--요넘을 어디에 넣어야하나여
<a href='{$list[$i]['wr_link1']}'><img ....

답변에 대한 댓글 1개

히어님 올만이네요 ㅎㅎ 근데 저거를 어디다 갔다붙여요

답변을 작성하려면 로그인이 필요합니다.