Ejemplo n.º 1
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
// 개별 페이지 접근 불가
if ($board['as_code']) {
    apms_script('code');
}
// 게시판에서 두단어 이상 검색 후 검색된 게시물에 코멘트를 남기면 나오던 오류 수정
$sop = strtolower($sop);
if ($sop != 'and' && $sop != 'or') {
    $sop = 'and';
}
@(include_once $board_skin_path . '/view.head.skin.php');
$sql_search = "";
// 검색이면
if ($sca || $stx) {
    // where 문을 얻음
    $sql_search = get_sql_search($sca, $sfl, $stx, $sop);
    $search_href = './board.php?bo_table=' . $bo_table . '&amp;page=' . $page . $qstr;
    $list_href = './board.php?bo_table=' . $bo_table;
} else {
    $search_href = '';
    $list_href = './board.php?bo_table=' . $bo_table . '&amp;page=' . $page;
}
if (!$board['bo_use_list_view']) {
    if ($sql_search) {
        $sql_search = " and " . $sql_search;
    }
    // 윗글을 얻음
Ejemplo n.º 2
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
//자동높이조절
apms_script('imagesloaded');
apms_script('height');
//add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $widget_url . '/widget.css" media="screen">', 0);
$wset['thumb_w'] = isset($wset['thumb_w']) && $wset['thumb_w'] > 0 ? $wset['thumb_w'] : 400;
$wset['thumb_h'] = isset($wset['thumb_h']) && $wset['thumb_h'] > 0 ? $wset['thumb_h'] : 540;
$img_h = apms_img_height($wset['thumb_w'], $wset['thumb_h'], '135');
$wset['line'] = isset($wset['line']) && $wset['line'] > 0 ? $wset['line'] : 2;
$line_height = 20 * $wset['line'];
// 간격
$gap_right = isset($wset['gap']) && ($wset['gap'] > 0 || $wset['gap'] == "0") ? (int) $wset['gap'] : 15;
$minus_right = $gap_right > 0 ? '-' . $gap_right : 0;
$gap_bottom = isset($wset['gapb']) && ($wset['gapb'] > 0 || $wset['gapb'] == "0") ? (int) $wset['gapb'] : 30;
$minus_bottom = $gap_bottom > 0 ? '-' . $gap_bottom : 0;
// 가로수
$item = isset($wset['item']) && $wset['item'] > 0 ? (int) $wset['item'] : 4;
// 반응형
if (_RESPONSIVE_) {
    $lg = isset($wset['lg']) && $wset['lg'] > 0 ? $wset['lg'] : 3;
    $md = isset($wset['md']) && $wset['md'] > 0 ? $wset['md'] : 3;
    $sm = isset($wset['sm']) && $wset['sm'] > 0 ? $wset['sm'] : 2;
    $xs = isset($wset['xs']) && $wset['xs'] > 0 ? $wset['xs'] : 2;
}
// 랜덤아이디
Ejemplo n.º 3
0
function apms_syntaxhighlighter($m)
{
    $str = $m[3];
    if (!$str) {
        return;
    }
    $str = stripslashes($str);
    $str = preg_replace("/(<br>|<br \\/>|<br\\/>|<p>)/i", "\n", $str);
    $str = preg_replace("/(<div>|<\\/div>|<\\/p>)/i", "", $str);
    $str = str_replace("&nbsp;", " ", $str);
    $str = str_replace("/</", "&lt;", $str);
    if (!$str) {
        return;
    }
    $brush = strtolower(trim($m[2]));
    $brush_arr = array('css', 'js', 'jscript', 'javascript', 'php', 'xml', 'xhtml', 'xslt', 'html');
    $brush = $brush && in_array($brush, $brush_arr) ? $brush : 'html';
    apms_script('code');
    return '<pre class="brush: ' . $brush . ';">' . $str . '</pre>' . PHP_EOL;
}
Ejemplo n.º 4
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
// 스크립트
apms_script('imagesloaded');
apms_script('infinite');
//add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $widget_url . '/widget.css" media="screen">', 0);
// 더보기 링크
$more_href = $widget_url . '/widget.rows.php?thema=' . urlencode(THEMA) . '&amp;wname=' . urlencode($wname) . '&amp;wid=' . urlencode($wid);
if ($opt) {
    $more_href .= '&amp;opt=' . urlencode($opt);
}
if ($mopt) {
    $more_href .= '&amp;mopt=' . urlencode($mopt);
}
if (isset($wdir) && $wdir) {
    $more_href .= '&amp;wdir=' . urlencode($wdir);
}
if (isset($add) && $add) {
    $more_href .= '&amp;add=' . urlencode($add);
}
$more_href .= '&amp;page=2';
$widget_id = apms_id();
// Random ID
?>
<div id="<?php 
echo $widget_id;
Ejemplo n.º 5
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
// Owl Carousel
apms_script('owlcarousel');
//add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $widget_url . '/widget.css" media="screen">', 0);
$is_autoplay = isset($wset['auto']) && ($wset['auto'] > 0 || $wset['auto'] == "0") ? $wset['auto'] : 3000;
$is_speed = isset($wset['speed']) && $wset['speed'] > 0 ? $wset['speed'] : 0;
if (G5_IS_MOBLE) {
    $is_lazy = false;
} else {
    $is_lazy = isset($wset['lazy']) && $wset['lazy'] ? true : false;
}
$wset['thumb_w'] = isset($wset['thumb_w']) && $wset['thumb_w'] > 0 ? $wset['thumb_w'] : 400;
$wset['thumb_h'] = isset($wset['thumb_h']) && $wset['thumb_h'] > 0 ? $wset['thumb_h'] : 225;
$img_h = apms_img_height($wset['thumb_w'], $wset['thumb_h'], '56.25');
$wset['line'] = isset($wset['line']) && $wset['line'] > 0 ? $wset['line'] : 2;
$line_height = 20 * $wset['line'];
// 간격
$gap = isset($wset['gap']) && ($wset['gap'] > 0 || $wset['gap'] == "0") ? (int) $wset['gap'] : 15;
$minus = $gap > 0 ? '-' . $gap : 0;
// 가로수
$item = isset($wset['item']) && $wset['item'] > 0 ? (int) $wset['item'] : 1;
// 반응형
if (_RESPONSIVE_) {
    $lg = isset($wset['lg']) && $wset['lg'] > 0 ? (int) $wset['lg'] : 1;
    $md = isset($wset['md']) && $wset['md'] > 0 ? (int) $wset['md'] : 1;
Ejemplo n.º 6
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
// 스크립트
apms_script('masonry');
apms_script('imagesloaded');
apms_script('infinite');
$wset['lb'] = isset($wset['lb']) && $wset['lb'] ? true : false;
// 라이트박스
if ($wset['lb']) {
    apms_script('lightbox');
}
// Lightbox
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $widget_url . '/widget.css" media="screen">', 0);
// 기본값 정리
$wset['garo'] = isset($wset['garo']) && $wset['garo'] > 0 ? $wset['garo'] : 3;
$wset['sero'] = isset($wset['sero']) && $wset['sero'] > 0 ? $wset['sero'] : 2;
$wset['infi'] = isset($wset['infi']) && $wset['infi'] ? true : false;
$gap = !isset($wset['gap']) || $wset['gap'] == "" ? 10 : $wset['gap'];
// 간격
$minus = $gap > 0 ? '-' . $gap : 0;
// 최소크기
$wset['col'] = isset($wset['xs']) && $wset['xs'] ? 'one' : 'two';
// 가로수 조절
$is_big = $wset['garo'] > 4 ? ' col-big' : '';
$wset['in'] = isset($wset['in']) && $wset['in'] ? $wset['in'] : '';
$shadow_in = $shadow_out = $shadow_inner = $shadow_outer = '';
Ejemplo n.º 7
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
// Swiper 불러오기
apms_script('swiper');
//add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
//add_stylesheet('<link rel="stylesheet" href="'.$widget_url.'/widget.css" media="screen">', 0);
//기본값
$wset['item'] = isset($wset['item']) && $wset['item'] > 0 ? $wset['item'] : 3;
$wset['nav'] = isset($wset['nav']) && $wset['nav'] ? true : false;
$wset['scroll'] = isset($wset['scroll']) && $wset['scroll'] ? true : false;
$wset['arrow'] = isset($wset['arrow']) && $wset['arrow'] ? false : true;
$widget_id = apms_id();
// Random ID
?>
<style>
	#<?php 
echo $widget_id;
?>
 .swiper-slide {  width:<?php 
echo apms_img_width($wset['item']);
?>
%; }
	<?php 
if (_RESPONSIVE_) {
    // 반응형일 때만 작동
    ?>
		<?php 
Ejemplo n.º 8
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
// 추출하기
$list = apms_board_rows($wset);
$list_cnt = count($list);
// 링크 열기
$wset['modal'] = isset($wset['modal']) ? $wset['modal'] : '';
$is_modal_js = $is_link_target = '';
if ($wset['modal'] == "1") {
    //모달
    $is_modal_js = apms_script('modal');
} else {
    if ($wset['modal'] == "2") {
        //링크#1
        $is_link_target = ' target="_blank"';
    }
}
// 아이콘
$icon = isset($wset['icon']) && $wset['icon'] ? '<span class="lightgray">' . apms_fa($wset['icon']) . '</span>' : '';
// 랭킹
$rank = apms_rank_offset($wset['rows'], $wset['page']);
// 날짜
$is_date = isset($wset['date']) && $wset['date'] ? true : false;
$is_dtype = isset($wset['dtype']) && $wset['dtype'] ? $wset['dtype'] : 'm.d';
$is_dtxt = isset($wset['dtxt']) && $wset['dtxt'] ? true : false;
// 새글
$is_new = isset($wset['new']) && $wset['new'] ? $wset['new'] : 'red';
Ejemplo n.º 9
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
//개별 페이지 접근 불가
// Flex Slider 불러오기
apms_script('flexslider');
//add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . $widget_url . '/widget.css" media="screen">', 0);
$wset['effect'] = isset($wset['effect']) && $wset['effect'] ? $wset['effect'] : 'slide';
$wset['bs'] = isset($wset['bs']) && $wset['bs'] ? $wset['bs'] : '';
$wset['ba'] = isset($wset['ba']) && $wset['ba'] ? $wset['ba'] : '';
$wset['bg'] = isset($wset['bg']) && $wset['bg'] ? $wset['bg'] : 'black';
$btn = $wset['bg'] == 'light-border' ? 'btn-black' : 'btn-trans';
// Button Type
$wset['barrow'] = isset($wset['barrow']) && $wset['barrow'] ? $wset['bshadow'] : '';
// 하단 꼭지시 하단 그림자 출력안함
// 랜덤아이디
$widget_id = apms_id();
?>

<div class="widget-miso-post-bar bg-<?php 
echo $wset['bg'];
?>
">
	<div class="<?php 
echo isset($wset['noc']) && $wset['noc'] ? 'no-' : '';
?>
container">
		<div class="row">
Ejemplo n.º 10
0
function get_view_thumbnail($contents, $thumb_width = 0)
{
    global $board, $config;
    if (!$thumb_width) {
        $thumb_width = $board['bo_image_width'];
    }
    // $contents 중 img 태그 추출
    $matches = get_editor_image($contents, true);
    if (empty($matches)) {
        return $contents;
    }
    // Exif
    $exif = array();
    $is_exif = isset($board['as_exif']) && $board['as_exif'] ? true : false;
    // Lightbox
    $is_lightbox = false;
    if (isset($board['as_lightbox']) && $board['as_lightbox']) {
        $is_lightbox = true;
        apms_script('lightbox');
    }
    for ($i = 0; $i < count($matches[1]); $i++) {
        $img_tag = $matches[0][$i];
        $img = $matches[1][$i];
        preg_match("/src=[\\'\"]?([^>\\'\"]+[^>\\'\"]+)/i", $img, $m);
        $src = $m[1];
        preg_match("/style=[\"\\']?([^\"\\'>]+)/i", $img, $m);
        $style = $m[1];
        preg_match("/width:\\s*(\\d+)px/", $style, $m);
        $width = $m[1];
        preg_match("/height:\\s*(\\d+)px/", $style, $m);
        $height = $m[1];
        preg_match("/alt=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        $alt = get_text($m[1]);
        preg_match("/link=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        // APMS 추가
        $link = get_text($m[1]);
        preg_match("/align=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        // APMS 추가
        $align = get_text($m[1]);
        $align = $align ? ' align="' . $align . '" ' : '';
        preg_match("/class=[\"\\']?([^\"\\']*)[\"\\']?/", $img, $m);
        // APMS 추가
        $class = get_text($m[1]);
        $class = $class ? ' ' . $align : '';
        // 이미지 path 구함
        $p = @parse_url($src);
        if (strpos($p['path'], '/' . G5_DATA_DIR . '/') != 0) {
            $data_path = preg_replace('/^\\/.*\\/' . G5_DATA_DIR . '/', '/' . G5_DATA_DIR, $p['path']);
        } else {
            $data_path = $p['path'];
        }
        $srcfile = G5_PATH . $data_path;
        $itemprop = $i == 0 ? ' itemprop="image" content="' . $src . '"' : '';
        if (is_file($srcfile)) {
            $size = @getimagesize($srcfile);
            if (empty($size)) {
                continue;
            }
            // jpg 이면 exif 체크
            if ($size[2] == 2 && function_exists('exif_read_data')) {
                $degree = 0;
                $exif = @exif_read_data($srcfile);
                if (!empty($exif['Orientation'])) {
                    switch ($exif['Orientation']) {
                        case 8:
                            $degree = 90;
                            break;
                        case 3:
                            $degree = 180;
                            break;
                        case 6:
                            $degree = -90;
                            break;
                    }
                    // 세로사진의 경우 가로, 세로 값 바꿈
                    if ($degree == 90 || $degree == -90) {
                        $tmp = $size;
                        $size[0] = $tmp[1];
                        $size[1] = $tmp[0];
                    }
                }
            }
            // 원본 width가 thumb_width보다 작다면 썸네일생성 안함
            if ($size[0] <= $thumb_width) {
                if ($width) {
                    $thumb_tag = '<img' . $itemprop . ' src="' . $src . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $align . ' class="img-tag' . $class . '"/>';
                } else {
                    $thumb_tag = '<img' . $itemprop . ' src="' . $src . '" alt="' . $alt . '"' . $align . ' class="img-tag' . $class . '"/>';
                }
                // $img_tag에 editor 경로가 있으면 원본보기 링크 추가
                if (!$link && (strpos($img_tag, G5_DATA_DIR . '/' . G5_EDITOR_DIR) || strpos($img_tag, G5_DATA_DIR . '/file')) && preg_match("/\\.({$config['cf_image_extension']})\$/i", basename($srcfile))) {
                    if ($is_lightbox) {
                        $caption = $alt ? ' data-title="' . $alt . '"' : '';
                        $thumb_tag = '<a href="' . $src . '" data-lightbox="view-lightbox"' . $caption . ' target="_blank">' . $thumb_tag . '</a>';
                    } else {
                        $thumb_tag = '<a href="' . G5_BBS_URL . '/view_image.php?fn=' . urlencode(str_replace(G5_URL, "", $src)) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
                    }
                }
                // Exif 정보출력
                if ($is_exif) {
                    $img_exif = apms_get_view_exif($exif);
                    if ($img_exif) {
                        $thumb_tag = '<div class="img-exif">' . PHP_EOL . $thumb_tag . PHP_EOL . '<div class="exif-data">' . PHP_EOL . '<ul>' . PHP_EOL . $img_exif . PHP_EOL . '</ul>' . PHP_EOL . '</div>' . PHP_EOL . '</div>' . PHP_EOL;
                    }
                }
                $contents = str_replace($img_tag, $thumb_tag, $contents);
                unset($exif);
                continue;
            }
            // Animated GIF 체크
            $is_animated = false;
            if ($size[2] == 1) {
                $is_animated = is_animated_gif($srcfile);
            }
            // 썸네일 높이
            $thumb_height = round($thumb_width * $size[1] / $size[0]);
            $filename = basename($srcfile);
            $filepath = dirname($srcfile);
            // 썸네일 생성
            if (!$is_animated) {
                $thumb_file = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, false);
            } else {
                $thumb_file = $filename;
            }
            if (!$thumb_file) {
                continue;
            }
            if ($width) {
                $thumb_tag = '<img' . $itemprop . ' src="' . G5_URL . str_replace($filename, $thumb_file, $data_path) . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $align . ' class="img-tag' . $class . '"/>';
            } else {
                $thumb_tag = '<img' . $itemprop . ' src="' . G5_URL . str_replace($filename, $thumb_file, $data_path) . '" alt="' . $alt . '"' . $align . ' class="img-tag' . $class . '"/>';
            }
            // $img_tag에 editor 경로가 있으면 원본보기 링크 추가
            if (!$link && preg_match("/\\.({$config['cf_image_extension']})\$/i", $filename)) {
                if ($is_lightbox) {
                    $caption = $alt ? ' data-title="' . $alt . '"' : '';
                    $thumb_tag = '<a href="' . $src . '" data-lightbox="view-lightbox"' . $caption . ' target="_blank">' . $thumb_tag . '</a>';
                } else {
                    if (strpos($img_tag, G5_DATA_DIR . '/' . G5_EDITOR_DIR) || strpos($img_tag, G5_DATA_DIR . '/file')) {
                        $thumb_tag = '<a href="' . G5_BBS_URL . '/view_image.php?fn=' . urlencode(str_replace(G5_URL, "", $src)) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
                    } else {
                        $thumb_tag = '<a href="' . G5_BBS_URL . '/view_img.php?img=' . urlencode($src) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
                    }
                }
            }
            // Exif 정보출력
            if ($is_exif) {
                $img_exif = apms_get_view_exif($exif);
                if ($img_exif) {
                    $thumb_tag = '<div class="img-exif">' . PHP_EOL . $thumb_tag . PHP_EOL . '<div class="exif-data">' . PHP_EOL . '<ul>' . PHP_EOL . $img_exif . PHP_EOL . '</ul>' . PHP_EOL . '</div>' . PHP_EOL . '</div>' . PHP_EOL;
                }
            }
            $contents = str_replace($img_tag, $thumb_tag, $contents);
            unset($exif);
        } else {
            if (preg_match("/\\.({$config['cf_image_extension']})\$/i", basename($src))) {
                $thumb_tag = '<img' . $itemprop . ' src="' . $src . '" alt="' . $alt . '"' . $align . ' class="img-tag' . $class . '"/>';
                if (!$link) {
                    if ($is_lightbox) {
                        $caption = $alt ? ' data-title="' . $alt . '"' : '';
                        $thumb_tag = '<a href="' . $src . '" data-lightbox="view-lightbox"' . $caption . ' target="_blank">' . $thumb_tag . '</a>';
                    } else {
                        $thumb_tag = '<a href="' . G5_BBS_URL . '/view_img.php?img=' . urlencode($src) . '" target="_blank" class="view_image">' . $thumb_tag . '</a>';
                    }
                }
                $contents = str_replace($img_tag, $thumb_tag, $contents);
            }
        }
    }
    return $contents;
}
Ejemplo n.º 11
0
// Font
if (!$at_set['font']) {
    $at_set['font'] = 'ko';
}
if (!$at_set['mfont']) {
    $at_set['mfont'] = 15;
}
// Menu Effect
$is_menu_effect = isset($at_set['meffect']) && $at_set['meffect'] ? 'slide' : 'min';
if (G5_IS_MOBILE) {
    $mobile_menu_effect = '';
    $sidebar_effect = '';
} else {
    $mobile_menu_effect = '';
    $sidebar_effect = ' at-slide';
    apms_script('masonry');
}
//Setup Column
if ($is_wide_layout) {
    //메인은 와이드 고정
    $col_content = 13;
} else {
    $col_content = $at_set['page'] ? $at_set['page'] : 9;
}
$col_content = (int) $col_content;
$container = 'container';
if ($col_content == 13) {
    //Full Wide
    $col_name = '';
} else {
    if ($col_content == 12) {