적용된 테마의 게시판에 적용한다.




/html/theme/temp1/skin/board/gallery/view.skin.php

--> 기존 설정 영역을 주석처리하고...아래 코드로 변경한다.




        //  이미지 가로배치 시작  ( 첨부로 올린 이미지에 적용됨, 에디터 삽입 이미지는 적용 안됨 )---------------------------

        $n = 3;  //  <-------------------- 한줄당 표시하고픈 이미지 갯수 

        //$wid = (int)(1/$n*100); 

        $wid = (int)($board[bo_image_width]/$n);

        echo "<table width='100%' cellpadding=3 cellspacing=0 border=0 align='center'>";

        echo "<tr align='center'>";

        for ($i=0; $i<=count($view[file]); $i++) {

                if (($view[file][$i][view]) && $i>0 && ($i%$n == 0)) {

                        echo "</tr><tr>";

                }

        if ($view[file][$i][view]) {

                echo "<td width='370px' align='center'>";

                echo get_view_thumbnail($view[file][$i][view]);

                echo "<br><br>". get_view_thumbnail($view[file][$i][content]); // 이미지 설명글 

           }

        }


        // 부족한 <td> 갯수 맞추는 작업 

        if ((count($view[file])-1) % $n != 0) {

        $td_cnt = $n - ((count($view[file])-1)%$n);

        for ($t=0; $t<$td_cnt; $t++) {

        echo "<td width='370px'>&nbsp;</td>";

        }

        }


        echo "</tr></table>";

        echo "<p>";

        // 여기까지  이미지 가로 배치 수정 끝. ---------------------------------------------------------------------------------  



'배워서 남주자 > PHP' 카테고리의 다른 글

[php.ini] 용량 설정  (0) 2018.09.07

+ Recent posts