Beispiel #1
0
function apms_tag_post_rows($arr)
{
    global $g5;
    $list = array();
    $rows = isset($arr['rows']) && $arr['rows'] > 0 ? $arr['rows'] : 7;
    $newtime = isset($arr['newtime']) && $arr['newtime'] > 0 ? $arr['newtime'] : 24;
    $thumb_w = isset($arr['thumb_w']) && $arr['thumb_w'] > 0 ? $arr['thumb_w'] : 0;
    $thumb_h = isset($arr['thumb_h']) && $arr['thumb_h'] > 0 ? $arr['thumb_h'] : 0;
    $thumb_no = isset($arr['thumb_no']) && $arr['thumb_no'] ? true : false;
    $img_rows = isset($arr['img_rows']) && $arr['img_rows'] > 0 ? $arr['img_rows'] : 0;
    $no_img = isset($arr['no_img']) && $arr['no_img'] ? $arr['no_img'] : '';
    $dayterm = isset($arr['dayterm']) && $arr['dayterm'] > 0 ? $arr['dayterm'] : 0;
    $term = isset($arr['term']) && $arr['term'] ? $arr['term'] : '';
    $term = $term == 'day' && $dayterm > 0 ? $dayterm : $term;
    $gr_list = isset($arr['gr_list']) && $arr['gr_list'] ? apms_escape_string($arr['gr_list']) : '';
    $bo_list = isset($arr['bo_list']) && $arr['bo_list'] ? apms_escape_string($arr['bo_list']) : '';
    $bo_table = $gr_list ? apms_group_board($gr_list) : $bo_list;
    $sql_board = '';
    if ($bo_table) {
        $sql_board = isset($arr['except']) && $arr['except'] ? "and find_in_set(bo_table, '{$bo_table}')=0" : "and find_in_set(bo_table, '{$bo_table}')";
    }
    $result = sql_query(" select bo_table, wr_id from {$g5['apms_tag_log']} where bo_table <> '' {$sql_board} group by bo_table, wr_id order by regdate desc limit 0, {$rows} ", false);
    for ($i = 0; $row = sql_fetch_array($result); $i++) {
        $tmp_write_table = $g5['write_prefix'] . $row['bo_table'];
        $post = sql_fetch(" select * from {$tmp_write_table} where wr_id = '{$row['wr_id']}' ", false);
        $post['img_row'] = $arr['img_rows'];
        $list[$i] = thema_widget_write_list('post', $row['bo_table'], $post, $newtime, $thumb_w, $thumb_h, false, true);
        if ($thumb_w) {
            if (!$list[$i]['img']['src'] && $no_img) {
                $list[$i]['img'] = $thumb_no ? apms_thumbnail($no_img, 0, 0, false, true) : apms_thumbnail($no_img, $thumb_w, $thumb_h, false, true);
                // no-image
                $list[$i]['img']['org'] = $no_img;
                $list[$i]['img']['alt'] = '';
            }
        }
    }
    return $list;
}
Beispiel #2
0
function apms_banner_rows($arr)
{
    global $g5, $demo_config;
    $list = array();
    $bn_list = isset($arr['bn_list']) && $arr['bn_list'] ? apms_escape_string($arr['bn_list']) : '';
    $position = isset($arr['loc']) && $arr['loc'] ? apms_escape_string($arr['loc']) : '';
    $rows = isset($arr['rows']) && $arr['rows'] > 0 ? $arr['rows'] : 4;
    $sort = isset($arr['sort']) && $arr['sort'] ? $arr['sort'] : '';
    $thumb_w = isset($arr['thumb_w']) && $arr['thumb_w'] > 0 ? $arr['thumb_w'] : 0;
    $thumb_h = isset($arr['thumb_h']) && $arr['thumb_h'] > 0 ? $arr['thumb_h'] : 0;
    $thumb_no = isset($arr['thumb_no']) && $arr['thumb_no'] ? true : false;
    //데모
    if (isset($demo_config['bn_id']) && $demo_config['bn_id']) {
        $bn_list = $demo_config['bn_id'];
    }
    // 배너
    $sql_bn = '';
    if ($bn_list) {
        $sql_bn = isset($arr['except']) && $arr['except'] ? "and find_in_set(bn_id, '{$bn_list}')=0" : "and find_in_set(bn_id, '{$bn_list}')";
    }
    //위치
    $sql_loc = $position ? "and bn_position = '{$position}'" : "";
    // 정렬
    switch ($sort) {
        case 'rdm':
            $orderby = 'rand()';
            break;
        case 'asc':
            $orderby = 'bn_order desc, bn_id';
            break;
        default:
            $orderby = 'bn_order, bn_id desc';
            break;
    }
    $sql = " select * from {$g5['g5_shop_banner_table']} where '" . G5_TIME_YMDHIS . "' between bn_begin_time and bn_end_time {$sql_po} {$sql_bn} {$sql_loc} order by {$orderby} ";
    $result = sql_query($sql);
    $j = 0;
    for ($i = 0; $row = sql_fetch_array($result); $i++) {
        if (!is_file(G5_DATA_PATH . '/banner/' . $row['bn_id'])) {
            continue;
        }
        $list[$j] = $row;
        $img = apms_thumbnail(G5_DATA_URL . '/banner/' . $row['bn_id'], $thumb_w, $thumb_h, false, true);
        $list[$j]['img'] = $img['src'];
        $list[$j]['alt'] = $row['bn_alt'];
        $list[$j]['target'] = $row['bn_new_win'] ? ' target="_blank"' : '';
        if ($row['bn_url'][0] == '#') {
            $list[$j]['href'] = $row['bn_url'];
        } else {
            if ($row['bn_url'] && $row['bn_url'] != 'http://') {
                $list[$j]['href'] = G5_SHOP_URL . '/bannerhit.php?bn_id=' . $row['bn_id'] . '&amp;url=' . urlencode($row['bn_url']);
            }
        }
        $j++;
    }
    return $list;
}
Beispiel #3
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
// 개별 페이지 접근 불가
$wid = isset($wid) && $wid ? apms_escape_string($wid) : '';
$wname = isset($wname) && $wname ? apms_escape_string($wname) : '';
$thema = isset($thema) && $thema ? apms_escape_string($thema) : '';
if (!$wid || !$thema || !$wname) {
    die('정상적인 접근이 아닙니다.');
}
$add = isset($add) && $add ? apms_escape_string($add) : '';
$wdir = isset($wdir) && $wdir ? apms_escape_string($wdir) : '';
if (!defined('THEMA')) {
    define('THEMA', $thema);
    define('THEMA_PATH', G5_PATH . '/thema/' . $thema);
    define('THEMA_URL', G5_URL . '/thema/' . $thema);
}
if ($wdir) {
    $widget_url = G5_URL . $wdir . '/' . $wname;
    $widget_path = G5_PATH . $wdir . '/' . $wname;
} else {
    if ($add) {
        // 애드온
        $widget_url = G5_SKIN_URL . '/addon/' . $wname;
        $widget_path = G5_SKIN_PATH . '/addon/' . $wname;
    } else {
        $widget_url = THEMA_URL . '/widget/' . $wname;
        $widget_path = THEMA_PATH . '/widget/' . $wname;
    }
Beispiel #4
0
<?php

include_once './_common.php';
$id = apms_escape_string(trim($id));
if (!$id) {
    goto_url(G5_SHOP_URL . '/partner');
}
$author = array();
$mb_id = $id;
$author = apms_member($mb_id);
$is_auth = false;
$is_cf = false;
if ($author['partner']) {
} else {
    if ($is_admin == 'super') {
        $is_auth = true;
    } else {
        if ($mb_id == $config['cf_admin']) {
            $is_cf = true;
        } else {
            alert('등록된 마이샵이 없습니다.', G5_SHOP_URL);
        }
    }
}
// Page ID
$pid = $pid ? $pid : 'myshop';
$at = apms_page_thema($pid);
if (!defined('THEMA_PATH')) {
    include_once G5_LIB_PATH . '/apms.thema.lib.php';
}
// RSS
Beispiel #5
0
        $goto_url .= '&amp;wdir=' . urlencode($wdir);
    }
    if ($del) {
        //초기화시
        sql_query(" delete from {$g5['apms_data']} where type = '{$type}' and data_q = '{$wid}' ", false);
        sql_query(" delete from {$g5['apms_cache']} where c_name = '{$c_name1}' ", false);
        sql_query(" delete from {$g5['apms_cache']} where c_name = '{$c_name2}' ", false);
    }
    goto_url($goto_url);
}
if (!$wdir && !$wdemo && $is_admin != 'super') {
    alert_close("최고관리자만 가능합니다.");
}
$wid = apms_escape_string($wid);
$wname = apms_escape_string($wname);
$thema = apms_escape_string($thema);
if (!$wid || !$thema) {
    alert_close('값이 넘어오지 않았습니다.');
}
define('THEMA', $thema);
define('THEMA_PATH', G5_PATH . '/thema/' . $thema);
define('THEMA_URL', G5_URL . '/thema/' . $thema);
if ($wdir) {
    $widget_url = G5_URL . $wdir . '/' . $wname;
    $widget_path = G5_PATH . $wdir . '/' . $wname;
    $widget_file = $widget_path . '/widget.setup.php';
} else {
    if ($wname) {
        if ($add) {
            $widget_url = G5_SKIN_URL . '/addon/' . $wname;
            $widget_path = G5_SKIN_PATH . '/addon/' . $wname;
Beispiel #6
0
<?php

include_once './_common.php';
$is_apms = true;
$wc_id = apms_escape_string($wc_id);
@(include_once $board_skin_path . '/good.comment.head.skin.php');
// 자바스크립트 사용가능할 때
if ($_POST['js'] == "on") {
    $error = $success = $count = "";
    function print_result($error, $success, $count)
    {
        echo '{ "error": "' . $error . '", "success": "' . $success . '", "count": "' . $count . '" }';
        exit;
    }
    if (!$is_member) {
        $error = '회원만 가능합니다.';
        print_result($error, $success, $count);
    }
    if (!($bo_table && $wr_id && $wc_id)) {
        $error = '값이 제대로 넘어오지 않았습니다.';
        print_result($error, $success, $count);
    }
    $ss_name = 'ss_view_' . $bo_table . '_' . $wr_id;
    if (!get_session($ss_name)) {
        $error = '해당 게시물에서만 추천 또는 비추천 하실 수 있습니다.';
        print_result($error, $success, $count);
    }
    $row = sql_fetch(" select count(*) as cnt from {$g5['write_prefix']}{$bo_table} ", FALSE);
    if (!$row['cnt']) {
        $error = '존재하는 게시판이 아닙니다.';
        print_result($error, $success, $count);