2026 년 4 월

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

 
그누스킨 그누소스 소스변경 소스문법 홈준비 기타
 
작성일 : 07-01-12 22:58
[소스변경] 블로그에 그림이 나타나게하기위해서
 글쓴이 : Morning (124.♡.110.138)
조회 : 4,274  
1.  blog.lib.php 의 아래 부분을 찾아서 바꿉니다..

바꾸기전 :

/*
-----------------------------------------------------------
    게시글에 첨부된 파일을 얻는다. (배열로 반환)
-----------------------------------------------------------
*/
function get_blog_file($post_id)
{
    global $g4, $gb4, $qstr, $current;
   
    $file = array();
    $file["count"] = 0;
    $sql = " select * from {$gb4['file_table']} where blog_id = '{$current['id']}' and post_id = '{$post_id}' order by file_num ";
    $result = sql_query($sql);
    while ($row = sql_fetch_array($result))
    {
        $no = $row['file_num'];
        $file[$no]['href'] = "./download.php?mb_id={$current['mb_id']}&post_id={$post_id}&file_num={$row['file_num']}";
        $file[$no]['download'] = $row['download_count'];
        $file[$no]['path'] = "{$g4[path]}/data/blog/file/{$current['mb_id']}";
        $file[$no]['size'] = get_filesize($row['file_size']);
        $file[$no]['datetime'] = $row['datetime'];
        $file[$no]['save_name'] = $row['save_name'];
        $file[$no]['real_name'] = $row['real_name'];
        $file['count']++;
    }

    return $file;
}



바꾼후 :

/*
-----------------------------------------------------------
    게시글에 첨부된 파일을 얻는다. (배열로 반환)
-----------------------------------------------------------
*/
function get_blog_file($post_id)
{
    global $g4, $gb4, $qstr, $current;
   
    $file = array();
    $file["count"] = 0;
    $sql = " select * from {$gb4['file_table']} where blog_id = '{$current['id']}' and post_id = '{$post_id}' order by file_num ";
    $result = sql_query($sql);
    while ($row = sql_fetch_array($result))
    {
        $no = $row['file_num'];
        $file[$no]['href'] = "./download.php?mb_id={$current['mb_id']}&post_id={$post_id}&file_num={$row['file_num']}";
        $file[$no]['download'] = $row['download_count'];
        $file[$no]['path'] = "{$g4[path]}/data/blog/file/{$current['mb_id']}";
        $file[$no]['size'] = get_filesize($row['file_size']);
        $file[$no]['datetime'] = $row['datetime'];
        $file[$no]['save_name'] = $row['save_name'];
        $file[$no]['real_name'] = $row['real_name'];
        $file[$no]['imgsize'] = @getimagesize("{$file[$no][path]}/$row[save_name]"); //by 천상재회(http://triplecubic.com)
$img_width = $file[$no][imgsize][0]; //by 천상재회(http://triplecubic.com)
$img_height = $file[$no][imgsize][1]; //by 천상재회(http://triplecubic.com)
$file[$no]['view'] = view_blog_file_link($row['save_name'], $img_width, $img_height); //by 천상재회(http://triplecubic.com)
        $file['count']++;
    }

    return $file;
}


// 그블로그의 첨부화일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
// by 천상재회 (http://triplecubic.com)
function view_blog_file_link($file, $width, $height){
    global $config, $g4, $gb4, $qstr, $current;
    static $ids; 

    if (!$file) return;

    $ids++;

    // 파일의 폭이 게시판설정의 이미지폭 보다 크다면 게시판설정 폭으로 맞추고 비율에 따라 높이를 계산
    if ($width > $upload_image_width && $upload_image_width)
    {
        $rate = $upload_image_width / $width;
        $width = $upload_image_width;
        $height = (int)($height * $rate);
    }

   
    if (preg_match("/\.($config[cf_image_extension])$/i", $file))
        // 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
        // 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
        return "<img src='$g4[path]/data/blog/file/{$current[mb_id]}/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;'>";
    else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
        //return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
        return "<script-x-x>doc_write(flash_movie('$g4[path]/data/blog/file/{$current[mb_id]}/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script-x-x>";
    else if (preg_match("/\.($config[cf_movie_extension])$/i", $file))
        //return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
        return "<script-x-x>doc_write(obj_movie('$g4[path]/data/blog/file/{$current[mb_id]}/$file', '_g4_{$ids}', '$width', '$height'));</script-x-x>";
}



2.  skin/blog/basic/index.skin.php 의 아래 부분을 변경한다.


바꾸기전 :

<!-- 본문 -->
        <div class="article">
            <?=nl2br($post[$i]['content'])?>
        </div>


바꾸기후 :

<!-- 본문 -->
        <div class="article">
          <?for($j=0; $j<count($post[$i]['file']); $j++) {
if ($post[$i]['file'][$j]['view'])
                echo $post[$i]['file'][$j]['view'] . "<p>";
} ?>
            <?=nl2br($post[$i]['content'])?>
        </div>
[이 게시물은 morning님에 의해 2009-11-22 17:49:48 홈관리자료실에서 이동 됨]
[이 게시물은 morning님에 의해 2009-11-22 17:56:43 알림판에서 이동 됨]
주님과 함께 모닝커피를

 
 

Total 10
번호 제   목 글쓴이 날짜 조회
10 [소스변경] 스케줄을 위한 날자설정 추가 Morning 08-05 6036
9 [소스변경] 팝업칼렌다 스타일조정 Morning 04-01 6173
8 [소스변경] index 와 bbs/_head.php , _tail.php, group.php 수정 (1) Morning 03-17 61
7 [소스변경] 온라인문의 (1) Morning 02-22 6692
6 [소스변경] 블로그단축주소를 위한 소스변경 Morning 02-19 4486
5 [소스변경] 펼침카테고리 사용시 Morning 02-15 3894
4 [소스변경] 까페를 위한 소스변경사항 Morning 02-07 4184
3 [소스변경] 블로그에 그림이 나타나게하기위해서 Morning 01-12 4275
2 [소스변경] 검색 강화를 위해 (1) Morning 01-12 4153
1 [소스변경] 겔러리게시판(thumb_gallery) 썸네일기능 (1) morning 12-09 4193

Therefore, holy brothers, who share in the heavenly calling,
fix your thoughts on Jesus, the apostle and high priest whom we confess.
Let us fix our eyes on Jesus, the author and perfecter of our faith,
who for the joy set before him endured the cross, scorning its shame,
and sat down at the right hand of the throne of God