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,273  
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 167
번호 제   목 글쓴이 날짜 조회
77 [그누소스] 게시판에 필드늘리는 소스 Morning 01-14 3538
76 [소스문법] if a=b or c=d (3) Morning 01-14 4204
75 [그누스킨] morning_webzine Morning 01-13 4143
74 [그누소스] 여분필드 나눠쓰기 Morning 01-13 3423
73 [그누소스] 블로그최신글 Morning 01-12 3189
72 [그누소스] 홈관리페이지 Morning 01-12 3434
71 [소스변경] 블로그에 그림이 나타나게하기위해서 Morning 01-12 4274
70 [그누소스] 내블로그 바로가기 Morning 01-12 3714
69 [소스변경] 검색 강화를 위해 (1) Morning 01-12 4152
68 [그누소스] key word (1) morning 01-10 3602
67 [그누소스] bbs/scrap.php morning 01-10 3912
66 [소스문법] 제외그룹설정방법, 특정그룹설정방법 Morning 01-01 4107
65 [그누스킨] 짤방_dq morning 01-01 4502
64 [그누스킨] 그룹최신글스킨 morning 01-01 3877
63 [그누소스] 그룹최신글 morning 01-01 3596
 1  2  3  4  5  6  7  8  9  10    

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